2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2010 */
6 /* Inclusive Design Institute */
8 /* This program is free software. You can redistribute it and/or */
9 /* modify it under the terms of the GNU General Public License */
10 /* as published by the Free Software Foundation. */
11 /************************************************************************/
14 define('TR_INCLUDE_PATH', '../include/');
15 require_once(TR_INCLUDE_PATH.'vitals.inc.php');
16 require_once(TR_INCLUDE_PATH.'classes/DAO/TestsDAO.class.php');
17 require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
21 Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
23 $test_type = 'normal';
25 if (isset($_POST['cancel'])) {
26 $msg->addFeedback('CANCELLED');
27 header('Location: index.php?_course_id='.$_course_id);
29 } else if (isset($_POST['submit'])) {
30 $testsDAO = new TestsDAO();
32 if ($testsDAO->Create($_course_id, $_POST['title'], $_POST['description']))
34 $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
35 header('Location: index.php?_course_id='.$_course_id);
40 $onload = 'document.form.title.focus();';
42 $savant->assign('course_id', $_course_id);
44 require_once(TR_INCLUDE_PATH.'header.inc.php');
47 $savant->display('tests/create_edit_test.tmpl.php');
49 require (TR_INCLUDE_PATH.'footer.inc.php');