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

Calculated questions should allow more than one unit with multiplier equal to 1

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.2.1, 2.6.1, 3.3.3, 3.4
    • 3.3.4, 3.4.1
    • Questions
    • MOODLE_22_STABLE, MOODLE_26_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE
    • MOODLE_33_STABLE, MOODLE_34_STABLE
    • MDL-31521-master
    • Hide
      1. Go to a course.
      2. Add a quiz activity.
      3. Click on the quiz activity.
      4. Under the settings cog choose 'Import' under 'Question bank'.
      5. Set "File format" to "Moodle XML format" and "Import questions from file" attach the file "questions-Physics-Default for zzz-20120206-1453.xml" and press "Import".
      6. Click "Continue" on the next page.
      7. Stay in question bank but go to questions.
      8. Select category "Default for zzz".
      9. Edit the question "zzz Force of two 1 kg masses..." (clicking on the gear).
      10. At the bottom of the following page, click "Save changes".
      11. In the next page, leave "Synchronise the data from shared datasets with other questions in a quiz" to "Do not synchronise", click "Next page".
      12. The process continues without error messages.
      Show
      Go to a course. Add a quiz activity. Click on the quiz activity. Under the settings cog choose 'Import' under 'Question bank'. Set "File format" to "Moodle XML format" and "Import questions from file" attach the file "questions-Physics-Default for zzz-20120206-1453.xml" and press "Import". Click "Continue" on the next page. Stay in question bank but go to questions. Select category "Default for zzz". Edit the question "zzz Force of two 1 kg masses..." (clicking on the gear). At the bottom of the following page, click "Save changes". In the next page, leave "Synchronise the data from shared datasets with other questions in a quiz" to "Do not synchronise", click "Next page". The process continues without error messages.

    Description

      Allow me to rephrase the full steps to reproduce.

      • Go to a course.
      • Open question bank import and do "Import questions from file" taking the attached file "questions-Physics-Default for zzz-20120206-1453.xml" in file formet "Moodle XML format".
      • Stay in question bank but go to questions.
      • Select category "Default for zzz".
      • Edit the question "zzz Force of two 1 kg masses..." (clicking on the gear).
      • At the bottom of the following page, click "Save changes".
      • In the next page, leave "Synchronise the data from shared datasets with other questions in a quiz" to "Do not synchronise", click "Next page".

      What you expect:

      • You're going to continue to edit the question.

      What actually happens:

      • Error: mdb->get_record() found more than one record! errors are shown.

       

      See http://moodle.org/mod/forum/discuss.php?d=195449
      the
      public function comment_on_datasetitems($qtypeobj, $questionid, $questiontext,
      $answers, $data, $number) {
      global $DB;
      $comment = new stdClass();
      $comment->stranswers = array();
      $comment->outsidelimit = false;
      $comment->answers = array();
      // Find a default unit:
      if (!empty($questionid) && $unit = $DB->get_record('question_numerical_units',
      array('question' => $questionid, 'multiplier' => 1.0))) {
      $unit = $unit->unit;
      should use another $DB function call to allow for more than one record.

      Attachments

        Issue Links

          Activity

            People

              lucaboesch Luca Bösch
              ppichet Pierre Pichet
              Tim Hunt Tim Hunt
              David Monllaó David Monllaó
              Mark Nelson Mark Nelson
              Safat Shahin, Tim Hunt, Amaia Anabitarte, Bas Brands, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Kevin Percy, Laurent David, Mathew May, Mihail Geshoski, Raquel Ortega, Sabina Abellan, Sander Bangma, Sara Arjona (@sarjona), Shamim Rezaie
              Votes:
              2 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                15/Jan/18