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

Question: get_all_response_file_areas() not work correctly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.8.6, 3.9.3, 3.10, 3.11
    • Fix Version/s: 3.9.4, 3.10.1
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      Prerequisites:

      1. Download and install qtype_recordrtc of moodle https://moodle.org/plugins/qtype_recordrtc
      2. A course with an enrolled student, s1.

      Testing multiple file areas in export:

      1. Login as admin and create a quiz in the course
      2. Edit the quiz and add two questions:
        • Essay question with file uploads enabled and
        • Record RTC question
      3. Log out
      4. Log in as student s1
      5. Complete the quiz, making sure you:
        • Make a recording for the RecordRTC question and
        • Upload a file for the Essay question
      6. Log out
      7. Log in as admin
      8. Navigate to "Administration / Users / Privacy and policies / Data request".
      9. Press "New request" button to create a data request export for "student" current status should be "Awaiting approval".
      10. Expand the "Actions" drop-down, select "Approve request" status should be changed to "Approved".
      11. Run the cron job:

        php admin/cli/cron.php
        

      12. The status should now be changed to "Download ready".
      13. Download the export data for the export you just performed (check the date and time to be sure as the interface ordering may have changed). Confirm that:
        • You can see the recording included in the export (You'll find it in "System > CATEGORYNAME > COURSENAME > Quiz X > Attempts > X > Questions > X > _files")
        • You can see the uploaded file included in the export (look in the other directory under the "Questions" parent directory)
      Show
      Prerequisites: Download and install qtype_recordrtc of moodle https://moodle.org/plugins/qtype_recordrtc A course with an enrolled student, s1. Testing multiple file areas in export : Login as admin and create a quiz in the course Edit the quiz and add two questions: Essay question with file uploads enabled and Record RTC question Log out Log in as student s1 Complete the quiz, making sure you: Make a recording for the RecordRTC question and Upload a file for the Essay question Log out Log in as admin Navigate to "Administration / Users / Privacy and policies / Data request". Press "New request" button to create a data request export for "student" current status should be "Awaiting approval". Expand the "Actions" drop-down, select "Approve request" status should be changed to "Approved". Run the cron job: php admin/cli/cron.php The status should now be changed to "Download ready". Download the export data for the export you just performed (check the date and time to be sure as the interface ordering may have changed). Confirm that : You can see the recording included in the export (You'll find it in "System > CATEGORYNAME > COURSENAME > Quiz X > Attempts > X > Questions > X > _files") You can see the uploaded file included in the export (look in the other directory under the "Questions" parent directory)
    • Affected Branches:
      MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_310_STABLE, MOODLE_39_STABLE
    • Pull from Repository:
    • Pull 3.8 Branch:
      MDL-70324-3.8
    • Pull 3.9 Branch:
      MDL-70324-3.9
    • Pull 3.10 Branch:
      MDL-70324-3.10
    • Pull 3.11 Branch:
      MDL-70324-3.11
    • Pull Master Branch:
      MDL-70324-master

      Description

      Currently, get_all_response_file_areas() function in question/engine/lib.php do not work correctly.
      It's using + operator to merge the array, and it seem not correct. Please see below information from php.net

      The + operator returns the right-hand array appended to the left-hand array; for keys that exist in both arrays, the elements from the left-hand array will be used, and the matching elements from the right-hand array will be ignored.

      $variables = array();
      foreach (question_bank::get_all_qtypes() as $qtype) {
            $variables += $qtype->response_file_areas();
      }
      

        Attachments

          Activity

            People

            Assignee:
            jbthong Thong Bui
            Reporter:
            jbthong Thong Bui
            Peer reviewer:
            Tim Hunt
            Integrator:
            Jake Dallimore
            Tester:
            Janelle Barcega
            Participants:
            Component watchers:
            Tim Hunt, Andrew Nicols, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              18/Jan/21

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 20 minutes
                2h 20m