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

Allow import to respect approval status for database activity entries

XMLWordPrintable

      Issue:
      When exporting entries from a database activity, when enabling the Approval Status option during the export, the generated CSV accurate indicates with 0s and 1s the approval status of each entry; however, this column in the CSV is not respected when importing entries into another database activity. This happens when logged in as a Site Admin and as an Editing Teacher role.

      Steps to Repeat:
      1. Add a new, blank Database activity (as a Teacher or Site Admin role)
      2. Enable "Approval Required" and "Save and view" the activity.
      3. Select "Use a preset"
      4. Select "Resources" and "Use this preset"
      5. Select the "Database" navigation link to navigate back to the database activity page, then and select "Add entry"
      6. Add generic data to each text-field, then click "Click Save and add another"
      7. Add generic data to each text-field, then click "Save"
      8. Change to "List View" and select the options menu for one of the two entries and select "Undo Approval"
      9. Log in as a student role at this point and also submit a new entry - take note that it will also display "Pending Approval" upon submission
      10. Log back in an admin or teacher role - verify "Pending approval" appears next to the student entry and one of the teacher/admin entries.
      11. Click "Actions - Export Entries"
      12. Enable "Include approval status" (can optionally also enable the "Include user details" and "Include time added/modified" settings which will yield the same end result), and click "Export Entries"
      13. Open the CSV and verify the "Approved" column accurately displays a "0" for the unapproved entries, and "1" for the approved entry.
      14. Return to the course page and duplicate the Database activity
      15. Enter the duplicated activity and verify there are no entries ("No entries yet" message will display)
      16. Click "Import entries
      17. Import the CSV and verity the "3 entries saved" message appears
      18. Select the "Database" navigation link to navigate back to the duplicate database activity page, and verify there are three entries
      19. Expectation: two of the entries would display "Pending Approval"
      Actual behavior: all three activities are already approved.

        1. CSV.png
          53 kB
          John Provasnik
        2. Export Test.png
          110 kB
          John Provasnik
        3. Import Test.png
          109 kB
          John Provasnik
        4. DB-2_records-20240409_2026.csv
          0.1 kB
          Paul Holden
        5. (1) 10 Passed -- (Main)MDL-81274.png
          56 kB
          Kim Jared Lucas

            pholden Paul Holden
            jprovasnik John Provasnik
            Amaia Anabitarte Amaia Anabitarte
            Ferran Recio Ferran Recio
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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