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');
20 Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
22 $tid = intval($_REQUEST['tid']);
23 $testsDAO = new TestsDAO();
24 $row = $testsDAO->get($tid);
26 if (isset($_POST['cancel'])) {
27 $msg->addFeedback('CANCELLED');
28 header('Location: index.php?_course_id='.$_course_id);
30 } else if (isset($_POST['submit'])) {
31 if ($testsDAO->Update($_POST['tid'], $_POST['title'], $_POST['description']))
33 $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
34 header('Location: index.php?_course_id='.$_course_id);
39 $onload = 'document.form.title.focus();';
41 require_once(TR_INCLUDE_PATH.'header.inc.php');
44 $savant->assign('course_id', $_course_id);
45 $savant->assign('tid', $tid);
46 $savant->assign('row', $row);
48 $savant->display('tests/create_edit_test.tmpl.php');
50 require (TR_INCLUDE_PATH.'footer.inc.php');