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

The checking that there is at least one dataset item to allow back to quiz when editing calculated question is not working properly

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8
    • Fix Version/s: None
    • Component/s: Questions
    • Labels:
      None
    • Affected Branches:
      MOODLE_18_STABLE

      Description

      In datasetitems_form.php there is a validation so back to quiz is not allowed if there is no items
      function validation($data){
      $errors = array();
      if (isset($data['backtoquiz']) && ($this->noofitems===0))

      { $errors['addbutton'] = get_string('youmustaddatleastoneitem', 'qtype_datasetdependent'); }

      return $errors;
      }
      line 204 is written
      if (isset($data['backtoquiz']) && ($this->noofitems===0)){
      the test is not working properly with the identity === but works correctly with equal ==
      if (isset($data['backtoquiz']) && ($this->noofitems==0)){

        Attachments

          Activity

            People

            Assignee:
            ppichet Pierre Pichet
            Reporter:
            ppichet Pierre Pichet
            Participants:
            Component watchers:
            Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: