Moodle
  1. Moodle
  2. MDL-30209

Regression: undefined function in quiz - print_messages();

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.2, 2.2
    • Fix Version/s: 2.1.3
    • Component/s: Quiz
    • Labels:
    • Testing Instructions:
      Hide

      You really need to be logged in to Moodle with two separate web browsers to test this. Be Teacher in one, and Student in the other.

      1. As teacher, create a quiz as a teacher, with no access restrictions (yet).

      2. As student, start an attempt and go to the summary page.

      3. Now, as teacher, change the settings to restrict things. For example add an IP address restriction, or a close date in the past (or both).

      4. As a student, click reload on the summary page. Verify that you see an error message that explains the problem (not a fatal error about an undefined function.)

      5. As student, click continue, you should get to the view.php page.

      6. As teacher, turn off the access restrictions again, and delete the student's attempt.

      7. As student, click reload. The Start attempt button should re-appear.

      8. As teacher, turn the access restrictions back on.

      9. As student, click the Start attempt button. You should get an error message explaining that you cannot start the attempt now.

      Show
      You really need to be logged in to Moodle with two separate web browsers to test this. Be Teacher in one, and Student in the other. 1. As teacher, create a quiz as a teacher, with no access restrictions (yet). 2. As student, start an attempt and go to the summary page. 3. Now, as teacher, change the settings to restrict things. For example add an IP address restriction, or a close date in the past (or both). 4. As a student, click reload on the summary page. Verify that you see an error message that explains the problem (not a fatal error about an undefined function.) 5. As student, click continue, you should get to the view.php page. 6. As teacher, turn off the access restrictions again, and delete the student's attempt. 7. As student, click reload. The Start attempt button should re-appear. 8. As teacher, turn the access restrictions back on. 9. As student, click the Start attempt button. You should get an error message explaining that you cannot start the attempt now.
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:
    • Rank:
      26459

      Description

      in startattempt.php and summary.php
      $output->print_messages($messages));
      can't find print_messages anywhere in latest 21stable or master code - was it removed at some point?

        Issue Links

          Activity

          Hide
          Dan Marsden added a comment -

          as per MDL-20636 commitid: 13040e14529d2ee5f4313371789f9f51eb95fc97 looks like it was changed to access_messages

          Show
          Dan Marsden added a comment - as per MDL-20636 commitid: 13040e14529d2ee5f4313371789f9f51eb95fc97 looks like it was changed to access_messages
          Hide
          Tim Hunt added a comment -

          Wow! how can that have been broken for so long with no-one noticing? Your diagnosis looks right to me, are you going to make a patch for me to review?

          Show
          Tim Hunt added a comment - Wow! how can that have been broken for so long with no-one noticing? Your diagnosis looks right to me, are you going to make a patch for me to review?
          Hide
          Dan Marsden added a comment -

          not going to happen this week - 'supposed' to be a long weekend here.... I see there's one post in the Italian forums about it but the diagnosis/fix seemed incorrect! - I haven't tested the change to access_messages either.
          http://translate.google.com/translate?hl=en&sl=it&u=http://moodle.org/mod/forum/discuss.php%3Fd%3D185391&ei=-zq7TpuvEoaWiQflt7y4Bw&sa=X&oi=translate&ct=result&resnum=1&ved=0CCEQ7gEwAA&prev=/search%3Fq%3Dsite:moodle.org%2Bprint_messages%2Bplugin_renderer_base%26hl%3Den%26client%3Dubuntu%26hs%3DzLg%26channel%3Dfs%26biw%3D1511%26bih%3D668%26prmd%3Dimvns

          If no-one else gets round to testing/fixing I might submit something late next week.

          thanks!

          Show
          Dan Marsden added a comment - not going to happen this week - 'supposed' to be a long weekend here.... I see there's one post in the Italian forums about it but the diagnosis/fix seemed incorrect! - I haven't tested the change to access_messages either. http://translate.google.com/translate?hl=en&sl=it&u=http://moodle.org/mod/forum/discuss.php%3Fd%3D185391&ei=-zq7TpuvEoaWiQflt7y4Bw&sa=X&oi=translate&ct=result&resnum=1&ved=0CCEQ7gEwAA&prev=/search%3Fq%3Dsite:moodle.org%2Bprint_messages%2Bplugin_renderer_base%26hl%3Den%26client%3Dubuntu%26hs%3DzLg%26channel%3Dfs%26biw%3D1511%26bih%3D668%26prmd%3Dimvns If no-one else gets round to testing/fixing I might submit something late next week. thanks!
          Hide
          Tim Hunt added a comment -

          OK, patch made, and tricky testing instructions written.

          Show
          Tim Hunt added a comment - OK, patch made, and tricky testing instructions written.
          Hide
          Dan Marsden added a comment -

          Thanks Tim - our client just tested the patch (which works as expected) and had this response:

          "kinda expected the the Java pop up to happen, user complete the quiz, and then upon closing the window, be straight back to the main course page or the grade for the quiz, or something like that, rather than the option to take the test again..."

          We've had similar requests in the past for SCORM - wonder if there's a clean way for the pop-up window to trigger some js to disable the button and display a message in the "parent" window instead of allowing the user to try again!

          Show
          Dan Marsden added a comment - Thanks Tim - our client just tested the patch (which works as expected) and had this response: "kinda expected the the Java pop up to happen, user complete the quiz, and then upon closing the window, be straight back to the main course page or the grade for the quiz, or something like that, rather than the option to take the test again..." We've had similar requests in the past for SCORM - wonder if there's a clean way for the pop-up window to trigger some js to disable the button and display a message in the "parent" window instead of allowing the user to try again!
          Hide
          Tim Hunt added a comment -

          Dan, is the quiz set to allow only one attempt?

          If you look at M.mod_quiz.secure_window.close near the end of mod/quiz/module.js you will see that it does reload the opening page (view.php). And view.php does not show a start attempt button if the student has used up all their attempts.

          Show
          Tim Hunt added a comment - Dan, is the quiz set to allow only one attempt? If you look at M.mod_quiz.secure_window.close near the end of mod/quiz/module.js you will see that it does reload the opening page (view.php). And view.php does not show a start attempt button if the student has used up all their attempts.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          PS: Note this is the last message of this type that you will receive along the whole November month, because we are running continuous integration this weeks while QA tests for release of Moodle 2.2 (Dec 1st) are being performed.

          Show
          Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao PS: Note this is the last message of this type that you will receive along the whole November month, because we are running continuous integration this weeks while QA tests for release of Moodle 2.2 (Dec 1st) are being performed.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Integrated, thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Integrated, thanks!
          Hide
          Adrian Greeve added a comment -

          tested and working.

          Show
          Adrian Greeve added a comment - tested and working.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          U P S T R E A M I Z E D !

          Thanks! Closing...

          Show
          Eloy Lafuente (stronk7) added a comment - U P S T R E A M I Z E D ! Thanks! Closing...

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: