Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-52440

Clicking "Finish Review" in secured quiz popup does not work in some browsers

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 2.8.9, 2.9.2
    • Quiz
    • None
    • MOODLE_28_STABLE, MOODLE_29_STABLE

      Before I go into the description of this problem, I want to state that the affected versions are the only ones I have tested. I have downloaded 3.0, and although I have not yet installed and tested it (not sure when I will get a chance), the code I believe to be the root of the problem has not changed.

      The Finish Review button does not seem to work in Microsoft Edge, Microsoft Internet Explorer, or Google Chrome on the final page of a review when JavaScript security with popup is enabled on a quiz. Chrome reports an uncaught type exception on the page.

      Through my own testing, I believe I have located the source of the problem as the definition of the function finish_review_link() in renderer.php. There is a call to $this->page->requires->js_init_call() that only receives three parameters, while the definition of js_init_call() is looking for four. The code in question is here:

      $this->page->requires->js_init_call('M.mod_quiz.secure_window.init_close_button',
                          array($url), quiz_get_js_module());
      

      The third parameter expected by js_init_call() is a boolean value called $ondomready. However, the above code is passing the module (and the dependencies of the module) into this parameter instead of the fourth parameter where it belongs. I seem to have fixed this problem in my own system by changing the above line to the following:

      $this->page->requires->js_init_call('M.mod_quiz.secure_window.init_close_button',
                          array($url), false, quiz_get_js_module());
      

      Testing Instructions:

      1. Create a quiz with browser security configured to "Full screen pop-up with some JavaScript security."
      2. Make sure that attempts can be reviewed
      3. Add several questions to the quiz
      4. Switch role to Student
      5. Attempt the quiz
      6. Answer at least one question on the quiz
      7. Finish the attempt
      8. Either view all questions on one page or go to the last page of the review
      9. Click either of the "Finish Review" buttons on the page
      10. The window should close and the Moodle window behind it should refresh. With this problem, nothing happens.

            timhunt Tim Hunt
            matt.pruett Matthew Pruett
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.