Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-8389 Calculated question: user interface when creating or editing a question
  3. MDL-8447

The default answer fraction is not settled correctly on the edit_calculated form, a solution is proposed

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • 1.8
    • Questions
    • None
    • MOODLE_18_STABLE

      On building the edit_calculated_form.php , the default answer[0] fraction is set to 1 which is the correct value
      line 75 of edit_calculated_form.php
      $mform->addElement('hidden', 'fraction[0]', 1);
      however at line 76 there is another line to setConstants
      $mform->setConstants(array('fraction[0]'=>PARAM_INT));
      written this way the final result on the input form is
      <input name="fraction[0]" type="hidden" value="2" />
      if we comment line 76
      // $mform->setConstants(array('fraction[0]'=>PARAM_INT));
      the result is the one expected
      <input name="fraction[0]" type="hidden" value="1" />

      And the value stored in question_answers table is the right one, the preview.php is working correctly etc.

            ppichet Pierre Pichet (Inactive)
            ppichet Pierre Pichet (Inactive)
            Votes:
            1 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.