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

Replace add_to_log with an event trigger - mod_choice

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Major Major
    • 2.6
    • 2.5
    • Events API, Logging
    • MOODLE_25_STABLE
    • MOODLE_26_STABLE
    • wip-MDL-40049-master-i
    • Hide

      Unit tests

      • Run the following unit tests:
        • events_test.php
        • generator_test.php

      Manual tests

      answers_created

      1. Create a choice activity.
      2. Add some options.
      3. Change this settings:
        • [Options] "Allow choice to be updated" - Yes
        • [Results] "publish results" - Always show results to students.
        • "Privacy of results" - Publish full results, showing names and their choices.
        • "Show column for unanswered" - Yes
      4. Log in as a student and make a choice.
      5. Log back in as an admin and view the logs. Check that a 'choice choose' log is made and that no errors are shown.

      answers_updated

      1. Change to another student and make a choice, then change the choice to something else.
      2. Log back in as an admin and view the logs. Check that a 'choice choose again' log is made and that no errors are shown.

      course_module_viewed

      1. While still looking at the logs, check for "choice view".

      instances_list_viewed

      1. As a admin go to [mod/choice/index.php?id=X where 'X' is the course id.
      2. Go back to the logs and check for the following log entry "choice view all"

      report_viewed

      1. Go to the choice activity as an admin and go to the following page [Administration ► Choice administration ► View x responses].
      2. Go back to the logs and search for and find the "choice report" log.

      You're done!

      Show
      Unit tests Run the following unit tests: events_test.php generator_test.php Manual tests answers_created Create a choice activity. Add some options. Change this settings: [Options] "Allow choice to be updated" - Yes [Results] "publish results" - Always show results to students. "Privacy of results" - Publish full results, showing names and their choices. "Show column for unanswered" - Yes Log in as a student and make a choice. Log back in as an admin and view the logs. Check that a 'choice choose' log is made and that no errors are shown. answers_updated Change to another student and make a choice, then change the choice to something else. Log back in as an admin and view the logs. Check that a 'choice choose again' log is made and that no errors are shown. course_module_viewed While still looking at the logs, check for "choice view". instances_list_viewed As a admin go to [mod/choice/index.php?id=X where 'X' is the course id. Go back to the logs and check for the following log entry "choice view all" report_viewed Go to the choice activity as an admin and go to the following page [Administration ► Choice administration ► View x responses] . Go back to the logs and search for and find the "choice report" log. You're done!
    • 20
    • BACKEND Sprint 5

      Replace the add_to_log calls for the following area, with a call to the get_legacy_logdata function in the event class.

      mod/choice (5 calls)
      /mod/choice/report.php:46: add_to_log($course->id, "choice", "report", "report.php?id=$cm->id", "$choice->id",$cm->id);
      /mod/choice/index.php:17: add_to_log($course->id, "choice", "view all", "index.php?id=$course->id", "");
      /mod/choice/lib.php:296: add_to_log($course->id, "choice", "choose again", "view.php?id=$cm->id", $choice->id, $cm->id);
      /mod/choice/lib.php:310: add_to_log($course->id, "choice", "choose", "view.php?id=$cm->id", $choice->id, $cm->id);
      /mod/choice/view.php:79: add_to_log($course->id, "choice", "view", "view.php?id=$cm->id", $choice->id, $cm->id);

            abgreeve Adrian Greeve
            abgreeve Adrian Greeve
            Ankit Agarwal Ankit Agarwal
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Jérôme Mouneyrac Jérôme Mouneyrac
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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