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

Harmonizing calculated questions code with the changes related to the new storage code

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Questions
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      The new code for file storage (MDL-16904) broke some functions when creating calculated questions like creation of datasets on second answer formula.
      like line 565 in calculated/questiontype.php
      function preparedatasets(&$form , $questionfromid='0'){
      // the dataset names present in the edit_question_form and edit_calculated_form are retrieved
      $possibledatasets = $this->find_dataset_names($form->questiontext);
      $mandatorydatasets = array();
      foreach ($form->answers as $answer)

      { $mandatorydatasets += $this->find_dataset_names($answer); }

      changed to
      foreach ($form->answers as $answer)

      { // $mandatorydatasets += $this->find_dataset_names($answer); }

      As this is included in the question saving process, I let the code as is for now
      I need to test (and better understand the new code flow) before doing changes.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              24/Nov/10