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

Editing quizzes should be logged in detail

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 4.0
    • 3.11.4, 4.0
    • Quiz
    • MOODLE_311_STABLE, MOODLE_400_STABLE
    • MOODLE_400_STABLE
    • MDL-73337-master
    • Hide

      Setup

      1. Create a course C1.
      2. Create a user t1 and enrol as teacher in C1.
      3. Login as t1.
      4. Create a quiz and go to the quiz editing page.

      The edit page itself

      1. Update the maximum grade or re-paginate the quiz.
        => After the page is reloaded the system should log the Quiz edit page viewed one time. (Ex: The user with id '2' viewed the edit page for the quiz with course module id '2'.)

      Slots

      1. Slot create: create a new slot using "Add new question", "from question bank" or "a random question" menu to add question to quiz.
        => the slot created event should be logged. (Example description: The user with id '2' created a new slot with id '70' and slot number '2' on page '1' of the quiz with course module id '2'.)
      2. Slot deleted: delete a question by clicking on the trash bin icon.
        => the slot deleted event should be logged (Ex: The user with id '2' deleted the slot with id '52' and slot number '4' from the quiz with course module id '2'.)
      3. Slot moved:
        a. Move a question from middle or bottom to the first position of quiz
        => the slot moved event should be logged (Ex: The user with id '2' has moved the slot with id '54' and slot number '2' to the new position before the first slot on page '1' belonging to the quiz with course module id '2'.)
        b. Move a question to another position (not the first position)
        => the slot moved event should be logged (Ex: The user with id '2' has moved the slot with id '54' and slot number '1' to the new position after slot number '2' on page '2' belonging to the quiz with course module id '2'.)
      4. Slot mark updated: Click on the pen icon after the Slot mark, edit a new mark then press enter
        => the slot mark updated event should be logged (Ex: The user with id '2' updated the slot with id '54' belonging to the quiz with course module id '2'. Its max mark was changed from '1' to '3'.)
      5. Slot require previous updated: Click on the lock icoin to turn on/off the require previous option of question
        => the slot require previous updated event should be logged (Ex: The user with id '2' updated the slot with id '70' belonging to the quiz with course module id '2'. Its require previous value was set to '1'.)

      Pages

      1. Page break created: Click on the insert page break icon
        => The page break created event should be logged (Ex: The user with id '2' created the page break before the slot with id '58' and slot number '4' belonging to the quiz with course module id '2'.) and the insert page break icon should be change to the remove page break icon
      2. Page break deleted: Click on the remove page break icon
        => The page break deleted event should be logged (Ex: The user with id '2' deleted the page break before the slot with id '58' and slot number '4' belonging to the quiz with course module id '2'.)

      Sections

      1. Section break created: Open the editing actions menu of a page which do not have a section title, click on the add new section heading menu
        => The section break created event should be logged (Ex: The user with id '2' created a new section break with id '16' and title 'New heading' before the slot with id '57' and slot number '8' belonging to the quiz with course module id '2'.)
      2. Section break deleted: Click on the trash bin icon on the right of the section title
        => The section break deleted event should be logged (Ex: The user with id '2' deleted the section break with id '14' before the slot with id '53' and slot number '3' belonging to the quiz with course module id '2'.)
      3. Section title updated:
        a. Click on the pen icon on the right of the title, input a new title and press enter
        => The section title updated should be logged (Ex: The user with id '2' updated the section with id '16' before the slot with id '57' and slot number '8' belonging to the quiz with course module id '2'. Its title was changed to 'Section 2'.)

      b. Test the section title updated special case: Create a blank quiz and go to quiz editting page. Click on the pen icon on the top section, input a new title and press enter => The section title updated should be logged without slot id and slot number (Ex: The user with id '2' updated the section with id '16' belonging to the quiz with course module id '2'. Its title was changed to 'Section 2'.)

      1. Section shuffle updated: Check/uncheck the shuffle checkbox on the right of section header
        => The section shuffle updated event should be logged (Ex: The user with id '2' updated the section with id '16' before the slot with id '57' and slot number '8' belonging to the quiz with course module id '2'. Its shuffle option was set to '1'.)

      The whole quiz

      1. Quiz re-paginated: Click on the Repaginate button, choose the Repaginate with X question in page and then click on the go button
        => The quiz re-paginated event should be logged (Ex: The user with id '2' re-paginated the quiz with course module id '2' with the new option '3' slot(s) per page.)
      2. Quiz grade updated: Edit the quiz maximum grade and click on save button
        => The quiz grade updated event should be logged (Ex: The user with id '2' updated the maximum grade for the quiz with course module id '2'. The maximum grade was changed from '5' to '10'.)

      Backup/restore quiz with logs

      1. Login as admin.
      2. Backup the course and select only the quiz above. On the backup settings step, check on the "Include course logs" option.
      3. Download the backup file. Restore this file to a new quiz
      4. Check the /report/log/index.php, filter by the new quiz
        => All the old event logs should display in the log report:
        1. The Username should link to the right user.
        2. The Event context link should link to the new quiz viewing page.
        3. The Event name should link to the quiz editing page.
        4. The course module id in all events' description should be the new course module id of the new quiz.
        5. The slot id in all events' description should be the new slot id (different with the original quiz slots's id). Some slots which have been deleted will show id '-31338' (id is not found const NOT_FOUND = -31338). The reason is the deleted slots have been removed from the database and have not been include into the backup file, so they will not be restored to the new quiz.
        6. The section id in all events's description should be the new section id. Some sections which have been deleted will show id '-31338'

      The events' detail is in the Quiz editing log events - suggestions from Tim.xlsx

      Show
      Setup Create a course C1. Create a user t1 and enrol as teacher in C1. Login as t1. Create a quiz and go to the quiz editing page. The edit page itself Update the maximum grade or re-paginate the quiz. => After the page is reloaded the system should log the Quiz edit page viewed one time. (Ex: The user with id '2' viewed the edit page for the quiz with course module id '2'.) Slots Slot create : create a new slot using "Add new question", "from question bank" or "a random question" menu to add question to quiz. => the slot created event should be logged. (Example description: The user with id '2' created a new slot with id '70' and slot number '2' on page '1' of the quiz with course module id '2'.) Slot deleted : delete a question by clicking on the trash bin icon. => the slot deleted event should be logged (Ex: The user with id '2' deleted the slot with id '52' and slot number '4' from the quiz with course module id '2'.) Slot moved : a. Move a question from middle or bottom to the first position of quiz => the slot moved event should be logged (Ex: The user with id '2' has moved the slot with id '54' and slot number '2' to the new position before the first slot on page '1' belonging to the quiz with course module id '2'.) b. Move a question to another position (not the first position) => the slot moved event should be logged (Ex: The user with id '2' has moved the slot with id '54' and slot number '1' to the new position after slot number '2' on page '2' belonging to the quiz with course module id '2'.) Slot mark updated : Click on the pen icon after the Slot mark, edit a new mark then press enter => the slot mark updated event should be logged (Ex: The user with id '2' updated the slot with id '54' belonging to the quiz with course module id '2'. Its max mark was changed from '1' to '3'.) Slot require previous updated : Click on the lock icoin to turn on/off the require previous option of question => the slot require previous updated event should be logged (Ex: The user with id '2' updated the slot with id '70' belonging to the quiz with course module id '2'. Its require previous value was set to '1'.) Pages Page break created : Click on the insert page break icon => The page break created event should be logged (Ex: The user with id '2' created the page break before the slot with id '58' and slot number '4' belonging to the quiz with course module id '2'.) and the insert page break icon should be change to the remove page break icon Page break deleted : Click on the remove page break icon => The page break deleted event should be logged (Ex: The user with id '2' deleted the page break before the slot with id '58' and slot number '4' belonging to the quiz with course module id '2'.) Sections Section break created : Open the editing actions menu of a page which do not have a section title, click on the add new section heading menu => The section break created event should be logged (Ex: The user with id '2' created a new section break with id '16' and title 'New heading' before the slot with id '57' and slot number '8' belonging to the quiz with course module id '2'.) Section break deleted : Click on the trash bin icon on the right of the section title => The section break deleted event should be logged (Ex: The user with id '2' deleted the section break with id '14' before the slot with id '53' and slot number '3' belonging to the quiz with course module id '2'.) Section title updated : a. Click on the pen icon on the right of the title, input a new title and press enter => The section title updated should be logged (Ex: The user with id '2' updated the section with id '16' before the slot with id '57' and slot number '8' belonging to the quiz with course module id '2'. Its title was changed to 'Section 2'.) b. Test the section title updated special case: Create a blank quiz and go to quiz editting page. Click on the pen icon on the top section, input a new title and press enter => The section title updated should be logged without slot id and slot number (Ex: The user with id '2' updated the section with id '16' belonging to the quiz with course module id '2'. Its title was changed to 'Section 2'.) Section shuffle updated : Check/uncheck the shuffle checkbox on the right of section header => The section shuffle updated event should be logged (Ex: The user with id '2' updated the section with id '16' before the slot with id '57' and slot number '8' belonging to the quiz with course module id '2'. Its shuffle option was set to '1'.) The whole quiz Quiz re-paginated : Click on the Repaginate button, choose the Repaginate with X question in page and then click on the go button => The quiz re-paginated event should be logged (Ex: The user with id '2' re-paginated the quiz with course module id '2' with the new option '3' slot(s) per page.) Quiz grade updated : Edit the quiz maximum grade and click on save button => The quiz grade updated event should be logged (Ex: The user with id '2' updated the maximum grade for the quiz with course module id '2'. The maximum grade was changed from '5' to '10'.) Backup/restore quiz with logs Login as admin. Backup the course and select only the quiz above. On the backup settings step, check on the "Include course logs" option. Download the backup file. Restore this file to a new quiz Check the /report/log/index.php, filter by the new quiz => All the old event logs should display in the log report: 1. The Username should link to the right user. 2. The Event context link should link to the new quiz viewing page. 3. The Event name should link to the quiz editing page. 4. The course module id in all events' description should be the new course module id of the new quiz. 5. The slot id in all events' description should be the new slot id (different with the original quiz slots's id). Some slots which have been deleted will show id '-31338' (id is not found const NOT_FOUND = -31338). The reason is the deleted slots have been removed from the database and have not been include into the backup file, so they will not be restored to the new quiz. 6. The section id in all events's description should be the new section id. Some sections which have been deleted will show id '-31338' The events' detail is in the Quiz editing log events - suggestions from Tim.xlsx

      All actions in the 'Edit quiz' page are not logged. As discuss with timhunt in https://moodle.org/mod/forum/discuss.php?d=423702#p1729801, they should be logged in detail:

      The edit page itself

      • edit_page_viewed Tim has agreed that 'Quiz edit page viewed' should only be logged if the page is being displayed, not when a POST is being post is being processed.

      Slots

      Note that, within the quiz code, the separate 'questions' a better referred to as slots. They correspond to rows in the quiz_slots table.

      • slot_created Add question (all options)
      • slot_deleted Delete a question from quiz
      • slot_moved Move question to another position
      • slot_mark_updated Update max mark for question
      • slot_requireprevious_updated Update dependency of questions (lock icon)

      For the last two here, we could, instead, have a single slot_updated event, and require people to dig into the data to see what is going on, but acutally, I think that two separate events is better.
       
      Tim has suggested that, for "Delete multiple questions from quiz" it is best to just log this as multiple 'slot_deleted' events, all with the same timestamp.

      Pages

      Page breaks are not really entities in the quiz, but I still think that these two events are the clearest way to log it.

      • page_break_created Update page break
      • page_break_deleted Update page break

      Sections

      • section_break_created Add new section heading at page
      • section_break_deleted Delete section heading
      • section_title_updated Update section title
      • section_shuffle_updated Update shuffle option

      The whole quiz

      • quiz_repaginated Re-paginate
      • quiz_grade_updated Change the Maximum grade and click on Save

        1. MDL-73337_backup restore quiz.webm
          3.61 MB
        2. MDL-73337_edit page.png
          MDL-73337_edit page.png
          186 kB
        3. MDL-73337_page break.png
          MDL-73337_page break.png
          188 kB
        4. MDL-73337_section a.png
          MDL-73337_section a.png
          198 kB
        5. MDL-73337_section b.png
          MDL-73337_section b.png
          189 kB
        6. MDL-73337_section shuffle.png
          MDL-73337_section shuffle.png
          194 kB
        7. MDL-73337_slot create.png
          MDL-73337_slot create.png
          179 kB
        8. MDL-73337_slot delete.png
          MDL-73337_slot delete.png
          184 kB
        9. MDL-73337_slot move.png
          MDL-73337_slot move.png
          230 kB
        10. MDL-73337_slot require previous updated.png
          MDL-73337_slot require previous updated.png
          189 kB
        11. MDL-73337_slot updated.png
          MDL-73337_slot updated.png
          175 kB
        12. MDL-73337_whole quiz.png
          MDL-73337_whole quiz.png
          270 kB
        13. Quiz editing log events - suggestions from Tim.xlsx
          12 kB
        14. Screen Shot 2022-01-11 at 3.54.00 PM.png
          Screen Shot 2022-01-11 at 3.54.00 PM.png
          665 kB

            tiennguyenphuc Tien Nguyen
            tiennguyenphuc Tien Nguyen
            Tim Hunt Tim Hunt
            Victor Déniz Falcón Victor Déniz Falcón
            Angelia Dela Cruz Angelia Dela Cruz
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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