]> git.mjollnir.org Git - moodle.git/commitdiff
question preview: MDL-19820 set_url and generaltype = popup on question preview page
authortjhunt <tjhunt>
Thu, 1 Oct 2009 10:09:59 +0000 (10:09 +0000)
committertjhunt <tjhunt>
Thu, 1 Oct 2009 10:09:59 +0000 (10:09 +0000)
question/preview.php

index d1d583dad2c499ee9a34553c69d9e4e2585bc5ab..7eb808a49b759a783e3f9e86e9f58b707a38b5e1 100644 (file)
     // if no quiz id is specified then a dummy quiz with default options is used
     $quizid = optional_param('quizid', 0, PARAM_INT);
     // if no quiz id is specified then tell us the course
+
+    $pageurl = new moodle_url($CFG->wwwroot . '/question/preview.php', array('id' => $id, 'continue' => 1));
     if (empty($quizid)) {
         $courseid = required_param('courseid', PARAM_INT);
+        $pageurl->param('courseid', $courseid);
+    } else {
+        $pageurl->param('quizid', $quizid);
     }
+    $PAGE->set_url($pageurl);
+    $PAGE->set_generaltype('popup');
 
     // Test if we are continuing an attempt at a question
     $continue = optional_param('continue', 0, PARAM_BOOL);