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

Question: get_all_response_file_areas() not work correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 3.9.4, 3.10.1
    • 3.8.6, 3.9.3, 3.10, 3.11
    • Questions
    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • MOODLE_310_STABLE, MOODLE_39_STABLE
    • MDL-70324-master
    • 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)

      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();
      }
      

            jbthong Thong Bui
            jbthong Thong Bui
            Tim Hunt Tim Hunt
            Jake Dallimore Jake Dallimore
            Janelle Barcega Janelle Barcega
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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