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

Notice on history display of response 0 in cloze numerical question

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 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

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

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            ppichet Pierre Pichet added a comment -

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

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

            Thanks for fixing it

            Show
            dongsheng 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:
                  Fix Release Date:
                  25/Nov/09