AC_4897, AC_4898, AC_4899: Multifile uploader fixes.
[acontent.git] / docs / tests / question_cats.php
1 <?php\r
2 /************************************************************************/\r
3 /* AContent                                                             */\r
4 /************************************************************************/\r
5 /* Copyright (c) 2010                                                   */\r
6 /* Inclusive Design Institute                                           */\r
7 /*                                                                      */\r
8 /* This program is free software. You can redistribute it and/or        */\r
9 /* modify it under the terms of the GNU General Public License          */\r
10 /* as published by the Free Software Foundation.                        */\r
11 /************************************************************************/\r
12 \r
13 $page = 'tests';\r
14 define('TR_INCLUDE_PATH', '../include/');\r
15 require_once(TR_INCLUDE_PATH.'vitals.inc.php');\r
16 require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsCategoriesDAO.class.php');\r
17 require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');\r
18 \r
19 global $_course_id, $msg;\r
20 \r
21 Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);\r
22 \r
23 if (isset($_POST['edit'], $_POST['category'])) {\r
24 //      debug('question_cats_manage.php?catid='.$_POST['category'].'&_course_id='.$_course_id);exit;\r
25         header('Location: question_cats_manage.php?catid='.$_POST['category'].'&_course_id='.$_course_id);\r
26         exit;\r
27 } else if (isset($_POST['delete'], $_POST['category'])) {\r
28         header('Location: question_cats_delete.php?catid='.$_POST['category'].'&_course_id='.$_course_id);\r
29         exit;\r
30 } else if (!empty($_POST)) {\r
31         $msg->addError('NO_ITEM_SELECTED');\r
32 }\r
33 \r
34 require_once(TR_INCLUDE_PATH.'header.inc.php');\r
35 \r
36 $testsQuestionsCategories = new TestsQuestionsCategoriesDAO();\r
37 $rows = $testsQuestionsCategories->getByCourseID($_course_id);\r
38 \r
39 $savant->assign('course_id', $_course_id);\r
40 $savant->assign('rows', $rows);\r
41 $savant->assign('msg', $msg);\r
42 \r
43 $savant->display('tests/question_cats.tmpl.php');\r
44 \r
45 require_once(TR_INCLUDE_PATH.'footer.inc.php'); ?>