]> git.mjollnir.org Git - moodle.git/commitdiff
quiz / questions: MDL-17919 Bad link edit questions from quiz preview page.
authortjhunt <tjhunt>
Fri, 16 Jan 2009 04:47:23 +0000 (04:47 +0000)
committertjhunt <tjhunt>
Fri, 16 Jan 2009 04:47:23 +0000 (04:47 +0000)
Thanks to Ann Adamcik for noticing this. It was a regression from MDL-6085.

mod/quiz/attemptlib.php
question/type/questiontype.php

index d56eb67407138d76496ce872db8d75eb1dd5ad29..609b817c1756a9f2b9683f44ed1bc06598cbe7d4 100644 (file)
@@ -54,6 +54,7 @@ class quiz {
     function __construct($quiz, $cm, $course, $getcontext = true) {
         $this->quiz = $quiz;
         $this->cm = $cm;
+        $this->quiz->cmid = $this->cm->id;
         $this->course = $course;
         if ($getcontext && !empty($cm->id)) {
             $this->context = get_context_instance(CONTEXT_MODULE, $cm->id);
@@ -655,10 +656,6 @@ class quiz_attempt extends quiz {
                 $this->page_and_question_fragment($questionid, $page, $showall);
     }
 
-    public function set_this_page_url($url) {
-        $this->quiz->thispageurl = $url;
-    }
-
     // Bits of content =====================================================================
     public function get_html_head_contributions($page = 'all') {
         return get_html_head_contributions($this->get_question_ids($page),
index c8f6bc77208fb368fd20049ba92cf74aa2509bb7..3b10d63708b503ab40a60f4d20def5272ff8da9a 100644 (file)
@@ -1026,8 +1026,8 @@ class default_questiontype {
 
     /// Work out the right URL.
         $linkurl = '/question/question.php?id=' . $question->id;
-        if (!empty($cmoptions->id)) {
-            $linkurl .= '&amp;cmid=' . $cmoptions->id;
+        if (!empty($cmoptions->cmid)) {
+            $linkurl .= '&amp;cmid=' . $cmoptions->cmid;
         } else if (!empty($cmoptions->course)) {
             $linkurl .= '&amp;courseid=' . $cmoptions->course;
         } else {