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

Quiz report overview throwing notices some times...

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.0.2
    • 2.0.1
    • Quiz
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE
    • Easy

      To reproduce:

      • Create one quiz with time limit (timefinish).
      • As student, complete one attempt.
      • As admin, preview it, submit it partially (not finishing it)
      • Go to the Overview report. This notice is shown: "Undefined property: stdClass::$id in /mod/quiz/locallib.php on line 920"

      To fix:

       
      diff --git a/mod/quiz/locallib.php b/mod/quiz/locallib.php
      index e085c18..32b95ee 100644
      --- a/mod/quiz/locallib.php
      +++ b/mod/quiz/locallib.php
      @@ -916,7 +916,7 @@ function quiz_get_reviewoptions($quiz, $attempt, $context) {
           }
       
           // Show a link to the comment box only for closed attempts
      -    if ($attempt->timefinish && has_capability('mod/quiz:grade', $context)) {
      +    if (!empty($attempt->id) && $attempt->timefinish && has_capability('mod/quiz:grade', $context)) {
               $options->questioncommentlink = new moodle_url('/mod/quiz/comment.php', array('attempt' => $attempt->id));
           }

      Ciao

            timhunt Tim Hunt
            stronk7 Eloy Lafuente (stronk7)
            Helen Foster Helen Foster
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

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