http://www.atutor.ca/atutor/mantis/view.php?id=4398
authorCindy Li <cli@ocad.ca>
Thu, 29 Jul 2010 19:37:45 +0000 (19:37 -0000)
committerCindy Li <cli@ocad.ca>
Thu, 29 Jul 2010 19:37:45 +0000 (19:37 -0000)
docs/include/classes/testQuestions.class.php
docs/tests/export_test.php

index 64a1880..1c370b1 100644 (file)
@@ -333,7 +333,7 @@ function test_qti_export($tid, $test_title='', $zipfile = null){
        $testsQuestionsAssocDAO = new TestsQuestionsAssocDAO();
        $question_rows = $testsQuestionsAssocDAO->getByTestID($tid);
 
-       if (!is_array($question_rows)) return;
+       if (!is_array($question_rows)) return false;
        else {
                foreach ($question_rows as $row) {
                        $obj = TestQuestions::getQuestion($row['type']);
index a9925d0..96837ea 100644 (file)
@@ -30,5 +30,9 @@ if (!($test_row = $testsDAO->get($tid))) {
 }
 
 //export
-test_qti_export($tid, $test_row['title']);
+if (!test_qti_export($tid, $test_row['title'])) {
+       $msg->addInfo('TEST_NO_QUESTION');
+       header('Location: index.php?_course_id='.$_course_id);
+       exit;
+}
 ?>
\ No newline at end of file