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

            ppichet Pierre Pichet created issue -
            ppichet Pierre Pichet made changes -
            Field Original Value New Value
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            dongsheng Dongsheng Cai made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            QA Assignee dongsheng
            dougiamas Martin Dougiamas made changes -
            Workflow jira [ 34274 ] MDL Workflow [ 63474 ]
            dougiamas Martin Dougiamas made changes -
            Workflow MDL Workflow [ 63474 ] MDL Full Workflow [ 92714 ]

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  25/Nov/09