2 /****************************************************************/
\r
4 /****************************************************************/
\r
5 /* Copyright (c) 2002-2008 */
\r
6 /* Written by Greg Gay & Joel Kronenberg & Chris Ridpath */
\r
7 /* Inclusive Design Institute */
\r
8 /* http://atutor.ca */
\r
10 /* This program is free software. You can redistribute it and/or*/
\r
11 /* modify it under the terms of the GNU General Public License */
\r
12 /* as published by the Free Software Foundation. */
\r
13 /****************************************************************/
\r
15 define('AT_INCLUDE_PATH', '../../../include/');
\r
16 require(AT_INCLUDE_PATH.'vitals.inc.php');
\r
17 authenticate(AT_PRIV_ASSIGNMENTS);
\r
19 if (isset($_POST['submit_no'])) {
\r
20 $msg->addFeedback('CANCELLED');
\r
21 Header('Location: index_instructor.php');
\r
24 else if (isset($_POST['submit_yes'])) {
\r
25 $_POST['assignment_id'] = intval($_POST['assignment_id']);
\r
27 // delete the assignment from the table
\r
28 $sql = "DELETE FROM ".TABLE_PREFIX."assignments WHERE course_id=$_SESSION[course_id] AND assignment_id=$_POST[assignment_id]";
\r
29 $result = mysql_query($sql, $db);
\r
31 // delete all the files for this assignment
\r
32 require(AT_INCLUDE_PATH.'../mods/_standard/file_storage/file_storage.inc.php');
\r
33 fs_delete_workspace(WORKSPACE_ASSIGNMENT, $_POST['assignment_id']);
\r
35 $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
\r
36 header('Location: index_instructor.php');
\r
40 require(AT_INCLUDE_PATH.'header.inc.php');
\r
42 $_GET['id'] = intval($_GET['id']);
\r
44 $sql = "SELECT title FROM ".TABLE_PREFIX."assignments WHERE course_id=$_SESSION[course_id] AND assignment_id=$_GET[id]";
\r
45 $result = mysql_query($sql, $db);
\r
47 if ($row = mysql_fetch_assoc($result)){
\r
48 $hidden_vars['assignment_id'] = $_GET['id'];
\r
49 $confirm = array('DELETE_ASSIGNMENT', AT_print($row['title'], 'assignment.title'));
\r
50 $msg->addConfirm($confirm, $hidden_vars);
\r
51 $msg->printConfirm();
\r
54 $msg->addError('ASSIGNMENT_NOT_FOUND');
\r
57 require(AT_INCLUDE_PATH.'footer.inc.php');
\r