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

Add phpunit tests to examview import format

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.2.5, 2.3.2, 2.4
    • 2.3.1
    • Questions
    • MOODLE_23_STABLE
    • MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Hide

      GOAL OF THIS FIX

      The examview questions import format was repaired a few weeks aogo in MDL-34483. So here we are testing that :

      • nothing was broken by the changes done to add phpunit tests;
      • while adding the tests, it was discovered that not all matching questions were imported correctly, so we must test that now this problem is fixed.

      NOTICE

      All tests should be done with developer debugging enabled to verify that no warning or error is displayed.

      REDO THE TESTS FROM MDL-34483

      Go to Question Bank -> import.
      Ensure that there is no change on the results of the tests done in MDL-34483. This involve importing the question/format/examview/tests/fixtures/questions.examview.xml file using the "Examview" file format and testing that the 6 imported questions match the exact descriptions included in MDL-34483.

      TEST THE CORRECTED IMPORT OF MATCHING QUESTIONS

      import the examview_sample.xml file attached to this issue using the "Examview" format. 6 questions should be imported with no warning or error displayed.
      I suggest to concentrate on the matching question but all other questions should be OK too.
      Open the "Classify the animals." question for editing. You should see 4 subquestions :

      • question 1 (empty) answer insect
      • question 2 frog answer amphibian
      • question 3 newt answer amphibian
      • question 4 cat answer mammal

      Cancel editing and open the same question in preview window. You should see the question text : Classify the animals. and 3 lines with cat, frog and newt (the order may be different if shuffling is enabled as default on the website you are testing) and for each one a drop down menu with 3 choices : amphibian, mammal, insect. Try to answer both with all correct responses or some wrong ones and verify all is working as expected.
      Reopen the same question for editing but this time click on Save button without changing anything. Verify no warning or validation error is displayed.

      Show
      GOAL OF THIS FIX The examview questions import format was repaired a few weeks aogo in MDL-34483 . So here we are testing that : nothing was broken by the changes done to add phpunit tests; while adding the tests, it was discovered that not all matching questions were imported correctly, so we must test that now this problem is fixed. NOTICE All tests should be done with developer debugging enabled to verify that no warning or error is displayed. REDO THE TESTS FROM MDL-34483 Go to Question Bank -> import. Ensure that there is no change on the results of the tests done in MDL-34483 . This involve importing the question/format/examview/tests/fixtures/questions.examview.xml file using the "Examview" file format and testing that the 6 imported questions match the exact descriptions included in MDL-34483 . TEST THE CORRECTED IMPORT OF MATCHING QUESTIONS import the examview_sample.xml file attached to this issue using the "Examview" format. 6 questions should be imported with no warning or error displayed. I suggest to concentrate on the matching question but all other questions should be OK too. Open the "Classify the animals." question for editing. You should see 4 subquestions : question 1 (empty) answer insect question 2 frog answer amphibian question 3 newt answer amphibian question 4 cat answer mammal Cancel editing and open the same question in preview window. You should see the question text : Classify the animals. and 3 lines with cat, frog and newt (the order may be different if shuffling is enabled as default on the website you are testing) and for each one a drop down menu with 3 choices : amphibian, mammal, insect. Try to answer both with all correct responses or some wrong ones and verify all is working as expected. Reopen the same question for editing but this time click on Save button without changing anything. Verify no warning or validation error is displayed.

      Now that MDL-34483 is closed it would be good (as Dan Poltawski noted in MDL-34483) to add some phpunit tests to this import format, so that we can check it is still working in the future. Rick's example file could serve as a basis for this tests.

            jmvedrine Jean-Michel Vedrine
            jmvedrine Jean-Michel Vedrine
            Tim Hunt Tim Hunt
            Dan Poltawski Dan Poltawski
            David Monllaó David Monllaó
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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