Moodle
  1. Moodle
  2. MDL-20960

Notice on history display of response 0 in cloze numerical question

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.6
    • Fix Version/s: 1.9.7
    • Component/s: Questions
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE
    • Rank:
      24667

      Description

      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; }

        Activity

        Hide
        Pierre Pichet added a comment -

        tested, seems OK.
        Even with the notice the history was rendered correctly.

        Show
        Pierre Pichet added a comment - tested, seems OK. Even with the notice the history was rendered correctly.
        Hide
        Dongsheng Cai added a comment -

        Thanks for fixing it

        Show
        Dongsheng Cai added a comment - Thanks for fixing it

          People

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

            Dates

            • Created:
              Updated:
              Resolved: