made a copy
[atutor.git] / tools / tests / export_test.php
1 <?php
2 /************************************************************************/
3 /* ATutor                                                                                                                               */
4 /************************************************************************/
5 /* Copyright (c) 2002-2008 by Greg Gay, Harris Wong                                             */
6 /* Adaptive Technology Resource Centre / University of Toronto                  */
7 /* http://atutor.ca                                                                                                             */
8 /*                                                                                                                                              */
9 /* This program is free software. You can redistribute it and/or                */
10 /* modify it under the terms of the GNU General Public License                  */
11 /* as published by the Free Software Foundation.                                                */
12 /************************************************************************/
13 // $Id$
14 define('AT_INCLUDE_PATH', '../../include/');
15 require(AT_INCLUDE_PATH.'vitals.inc.php');
16 require(AT_INCLUDE_PATH.'classes/testQuestions.class.php');
17
18 authenticate(AT_PRIV_TESTS);
19
20 $tid = intval($_GET['tid']);
21
22 /* Retrieve the content_id of this test */
23 $sql = "SELECT title, random, num_questions, instructions FROM ".TABLE_PREFIX."tests WHERE test_id=$tid";
24 $result = mysql_query($sql, $db); 
25 if (!($test_row = mysql_fetch_assoc($result))) {
26         $msg->addError('ITEM_NOT_FOUND');
27         header(url_rewrite('tools/tests/index.php', AT_PRETTY_URL_IS_HEADER));
28         exit;
29 }
30
31 //export
32 test_qti_export($tid, $test_row['title']);
33 ?>