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

V4.0: Wildcards disappear when editing a calculated question

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 4.0.5
    • 4.0.1
    • Questions
    • MOODLE_400_STABLE
    • MOODLE_400_STABLE
    • MDL-75041-401
    • Hide
      1. As teacher, open a course in Moodle.
      2. Click in menu More → Question bank.
      3. Click "Create a new question...".
      4. Select "Calculated" and click in "Add".
      5. Create the question with Question name "Addition" and Question text "Add those two numbers: {a} and {b}" and "Answer formula 1" "{a} +{b}" and "Grade" for that answer formula "100%" and click "Save changes".
      6. Leave everything in the next page and click "continue".
      7. On "Add item", click the "Add" button.
      8. For "Wild card {a}" set "3.0" and for "Wild card {b}" set "4.0"
      9. Click "Save Changes"
      10. In question "Addition" click in "Edit" -> "Edit question"
      11. In bottom click in "Save changes"
      12. In bottom click in "Next page"
      13. Verify the values 3.0 and 4.0 for {a} and {b} do exit. <- Error but not fail, then follow 14
      14. On "Add item", click the "Add" button.
      15. For "Wild card {a}" set "3.0" and for "Wild card {b}" set "4.0"
      16. Click "Save Changes"
      17. In question "Addition" click in "Edit" -> "Edit question"
      18. In bottom click in "Save changes"
      19. Click in Home Close tab browser with moodle.
      20. Open new tab browser and visit URL moodle other time.
      21. As teacher, open the same course in Moodle
      22. Click in menu More → Question bank
      23. In question "Addition" click in "Edit" -> "Preview"
      24. ERROR: 
        Cannot get the specified dataset for a dataset dependent question! (question: 3, datasetitem: 0)

      More information about this error

      Show
      As teacher, open a course in Moodle. Click in menu More → Question bank. Click "Create a new question...". Select "Calculated" and click in "Add". Create the question with Question name "Addition" and Question text "Add those two numbers: {a} and {b}" and "Answer formula 1" "{a} +{b}" and "Grade" for that answer formula "100%" and click "Save changes". Leave everything in the next page and click "continue". On "Add item", click the "Add" button. For "Wild card {a}" set "3.0" and for "Wild card {b}" set "4.0" Click "Save Changes" In question "Addition" click in "Edit" -> "Edit question" In bottom click in "Save changes" In bottom click in "Next page" Verify the values 3.0 and 4.0 for {a} and {b} do exit. <- Error but not fail, then follow 14 On "Add item", click the "Add" button. For "Wild card {a}" set "3.0" and for "Wild card {b}" set "4.0" Click "Save Changes" In question "Addition" click in "Edit" -> "Edit question" In bottom click in "Save changes" Click in Home Close tab browser with moodle. Open new tab browser and visit URL moodle other time . As teacher, open the same course in Moodle Click in menu More → Question bank In question "Addition" click in "Edit" -> "Preview" ERROR:  Cannot get the specified dataset for a dataset dependent question! (question: 3, datasetitem: 0) More information about this error

      EDIT: Always, even for new questions created in version 4, both in private and shared set, wildcards need to be redefined when you edit a question. If you cancel editing the question because you don't know the variables, the database is corrupted and the question causes errors in PHP.

      STEPS to reproduce error:

      1.- Create or open a course in Moodle 4.x

      2.- Go to More - Question bank

      3.- Press in "Create a new question..."

      4.- Choice: Calculated, create the question with wildcards.

      5.- Save the question.

      6.- Edit the question -> the values of wildcards don't exist

      View debugging in https://tracker.moodle.org/browse/MDL-75041?focusedCommentId=932090&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-932090

      Before I wrote:

      When upgrading Moodle 3.11.6 to 4.0.x the calculated questions with shared wildcards work until I edit them.
      I don't know if other types of questions will have the same problem but in those calculated with variables with a shared set of values, when I edit the question the shared variables do not appear and if I continue editing I have to recreate them, with the problem that I do not remember limits, decimals, etc.

            lucaboesch Luca Bösch
            gmolleda Guillermo Molleda Jimena
            Votes:
            9 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.