removed mods directory from the ATutor codebase
[atutor.git] / mods / gradebook / gradebook_edit_tests.php
diff --git a/mods/gradebook/gradebook_edit_tests.php b/mods/gradebook/gradebook_edit_tests.php
deleted file mode 100644 (file)
index 8593b56..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-<?php\r
-/************************************************************************/\r
-/* ATutor                                                                                                                              */\r
-/************************************************************************/\r
-/* Copyright (c) 2002-2008 by Greg Gay, Joel Kronenberg & Heidi Hazelton*/\r
-/* Adaptive Technology Resource Centre / University of Toronto                 */\r
-/* http://atutor.ca                                                                                                            */\r
-/*                                                                                                                                             */\r
-/* This program is free software. You can redistribute it and/or               */\r
-/* modify it under the terms of the GNU General Public License                 */\r
-/* as published by the Free Software Foundation.                                               */\r
-/************************************************************************/\r
-// $Id: grade_scale_add.php 7208 2008-05-28 16:07:24Z cindy $\r
-\r
-$page = 'gradebook';\r
-\r
-define('AT_INCLUDE_PATH', '../../include/');\r
-require_once(AT_INCLUDE_PATH.'vitals.inc.php');\r
-authenticate(AT_PRIV_GRADEBOOK);\r
-\r
-require_once("lib/gradebook.inc.php");\r
-if (isset($_POST['cancel'])) \r
-{\r
-       $msg->addFeedback('CANCELLED');\r
-       header('Location: gradebook_tests.php');\r
-       exit;\r
-} \r
-else if (isset($_POST['save'])) \r
-{\r
-       $missing_fields = array();\r
-\r
-       if (isset($_POST['title']) && $_POST['title'] == '') {\r
-               $missing_fields[] = _AT('title');\r
-       }\r
-\r
-       if ($missing_fields) {\r
-               $missing_fields = implode(', ', $missing_fields);\r
-               $msg->addError(array('EMPTY_FIELDS', $missing_fields));\r
-       }\r
-\r
-       if (!$msg->containsErrors()) \r
-       {\r
-               $sql = "UPDATE ".TABLE_PREFIX."gradebook_tests SET ";\r
-               \r
-               if (isset($_POST["title"])) $sql .= "title = '".$_POST["title"]. "', ";\r
-               if ($_POST["has_due_date"] == 'true')\r
-               {\r
-                       $due_date = $_POST["year_due"]. '-' .str_pad ($_POST["month_due"], 2, "0", STR_PAD_LEFT). '-' .str_pad ($_POST["day_due"], 2, "0", STR_PAD_LEFT). ' '.str_pad ($_POST["hour_due"], 2, "0", STR_PAD_LEFT). ':' .str_pad ($_POST["min_due"], 2, "0", STR_PAD_LEFT) . ':00';\r
-                       $sql .= "due_date = '".$due_date. "', ";\r
-               }\r
-               else\r
-                       $sql .= "due_date = '', ";\r
-               \r
-               $sql .= "grade_scale_id=".$_POST["selected_grade_scale_id"]." WHERE gradebook_test_id = ". $_REQUEST["gradebook_test_id"];\r
-               $result = mysql_query($sql, $db) or die(mysql_error());\r
-\r
-               $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');\r
-               header('Location: gradebook_tests.php');\r
-               exit;\r
-       }\r
-} \r
-\r
-$sql = "SELECT * FROM ".TABLE_PREFIX."gradebook_tests WHERE gradebook_test_id=" . $_REQUEST["gradebook_test_id"];\r
-$result = mysql_query($sql, $db) or die(mysql_error());\r
-\r
-$sql = "(SELECT g.gradebook_test_id, g.type, t.title, DATE_FORMAT(end_date, '%Y-%m-%d %H:%i:00') AS due_date, g.grade_scale_id".\r
-                               " FROM ".TABLE_PREFIX."gradebook_tests g, ".TABLE_PREFIX."tests t".\r
-                               " WHERE g.type='ATutor Test'".\r
-                               " AND g.id = t.test_id".\r
-                               " AND g.gradebook_test_id=".$_GET['gradebook_test_id'].")".\r
-                               " UNION (SELECT g.gradebook_test_id, g.type, a.title, DATE_FORMAT(date_due, '%Y-%m-%d %H:%i:00') AS due_date, g.grade_scale_id".\r
-                               " FROM ".TABLE_PREFIX."gradebook_tests g, ".TABLE_PREFIX."assignments a".\r
-                               " WHERE g.type='ATutor Assignment'".\r
-                               " AND g.id = a.assignment_id".\r
-                               " AND g.gradebook_test_id=".$_GET['gradebook_test_id'].")".\r
-                               " UNION (SELECT gradebook_test_id, type, title, DATE_FORMAT(due_date, '%Y-%m-%d %H:%i:00') AS due_date,grade_scale_id ".\r
-                               " FROM ".TABLE_PREFIX."gradebook_tests".\r
-                               " WHERE type='External'".\r
-                               " AND gradebook_test_id=".$_GET['gradebook_test_id'].")";\r
-$result        = mysql_query($sql, $db) or die(mysql_error());\r
-$row_this = mysql_fetch_assoc($result);\r
-\r
-if ($row_this["type"] == "External")\r
-{\r
-       $array1                 = explode (' ', $row_this['due_date'], 2);\r
-       $array_date_due = explode ('-', $array1[0],3);\r
-       $array_time_due = explode (':', $array1[1]);\r
-       $today_year             = $array_date_due[0];\r
-       $today_mon              = $array_date_due[1];\r
-       $today_day                      = $array_date_due[2];\r
-       $today_hour             = $array_time_due[0];\r
-       $today_min              = $array_time_due[1];\r
-\r
-       if ($today_year == '0000')\r
-       {\r
-               $has_due_date = 'false';\r
-               \r
-               // if due date is not set, use today's date as default\r
-               $today = getdate();\r
-               $today_day              = $today['mday'];\r
-               $today_mon      = $today['mon'];\r
-               $today_year     = $today['year'];\r
-               $today_hour     = $today['hours'];\r
-               $today_min      = $today['minutes'];\r
-               // round the minute to the next highest multiple of 5 \r
-               $today_min = round($today_min / '5' ) * '5' + '5';\r
-               if ($today_min > '55')  $today_min = '55';\r
-       } \r
-       else\r
-               $has_due_date = 'true';\r
-}\r
-\r
-if ($has_due_date == 'false') $onload .= ' disable_dates (true, \'_due\');';\r
-require(AT_INCLUDE_PATH.'header.inc.php');\r
-\r
-?>\r
-<form method="post" name="form" action="<?php echo $_SERVER['PHP_SELF'].'?gradebook_test_id='.$_REQUEST['gradebook_test_id']; ?>">\r
-<div class="input-form">\r
-       <fieldset class="group_form"><legend class="group_form"><?php echo _AT('edit_tests'); ?></legend>\r
-\r
-<?php\r
-if ($row_this["type"] == "External")\r
-{\r
-?>\r
-       <div class="row">\r
-               <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="title"><?php echo _AT('title'); ?></label><br />\r
-               <input type="text" id="title" size="40" name="title" value="<?php echo $row_this["title"]; ?>" />\r
-       </div>\r
-\r
-<?php\r
-}\r
-else\r
-{\r
-?>\r
-       <div class="row">\r
-               <?php echo _AT('title'); ?><br />\r
-               <?php echo $row_this["title"]; ?>\r
-       </div>\r
-\r
-<?php\r
-}\r
-?>\r
-       <div class="row">\r
-               <label for="selected_grade_scale_id"><?php echo _AT('grade_scale'); ?></label><br />\r
-<?php \r
-               print_grade_scale_selectbox($row_this['grade_scale_id']); \r
-?>\r
-       </div>\r
-\r
-       <div class="row">\r
-               <?php  echo _AT('due_date'); ?><br />\r
-\r
-<?php \r
-if ($row_this["type"] == "External")\r
-{\r
-?>\r
-               <input type="radio" name="has_due_date" value="false" id="noduedate"  <?php if ($has_due_date == 'false') { echo 'checked="checked"'; } ?> \r
-               onfocus="disable_dates (true, '_due');" />\r
-               <label for="noduedate" title="<?php echo _AT('due_date'). ': '. _AT('none');  ?>"><?php echo _AT('none'); ?></label><br />\r
-\r
-               <input type="radio" name="has_due_date" value="true" id="hasduedate"  <?php if ($has_due_date == 'true') { echo 'checked="checked"'; } ?> onfocus="disable_dates (false, '_due');" />\r
-               <label for="hasduedate"  title="<?php echo _AT('due_date') ?>"><?php  echo _AT('date'); ?></label>\r
-\r
-<?php\r
-               $name = '_due';\r
-               require(AT_INCLUDE_PATH.'html/release_date.inc.php');\r
-       }\r
-       else\r
-       {\r
-               echo $row_this["due_date"];\r
-       }\r
-?>\r
-       </div>\r
-\r
-       <div class="row buttons">\r
-               <input type="submit" name="save" value="<?php echo _AT('save'); ?>" />\r
-               <input type="submit" name="cancel" value="<?php echo _AT('cancel'); ?>" />\r
-       </div>\r
-\r
-       </fieldset>\r
-\r
-</div>\r
-</form>\r
-\r
-<script language="javascript" type="text/javascript">\r
-function disable_dates (state, name) {\r
-       document.form['day' + name].disabled=state;\r
-       document.form['month' + name].disabled=state;\r
-       document.form['year' + name].disabled=state;\r
-       document.form['hour' + name].disabled=state;\r
-       document.form['min' + name].disabled=state;\r
-}\r
-</script>\r
-\r
-<?php require (AT_INCLUDE_PATH.'footer.inc.php');  ?>\r