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

Notice on history display of response 0 in cloze numerical question

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 1.9.7
    • 1.9.6
    • Questions
    • None
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE

      There is a notice on numerical cloze because
      line 348
      if (empty($chosenanswer) && !empty($response))

      { $chosenanswer = new stdClass; $chosenanswer->fraction = 0.0; }
      and line 365
      if ($options->feedback && $response != '') { $style = 'class = "'.question_get_feedback_class($chosenanswer->fraction).'"'; $feedbackimg = question_get_feedback_image($chosenanswer->fraction); } else { $style = ''; $feedbackimg = ''; }

      as response = 0 test as empty() , the $chosenanswer->fraction was not initialized.
      change line 348 to
      if (empty($chosenanswer) && $response != '') { $chosenanswer = new stdClass; $chosenanswer->fraction = 0.0; }

            ppichet Pierre Pichet (Inactive)
            ppichet Pierre Pichet (Inactive)
            Dongsheng Cai Dongsheng Cai
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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