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

        Pierre Pichet created issue -
        Pierre Pichet made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Dongsheng Cai made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        QA Assignee dongsheng
        Martin Dougiamas made changes -
        Workflow jira [ 34274 ] MDL Workflow [ 63474 ]
        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: