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

New Web Service core_reportbuilder_reports_view

    XMLWordPrintable

Details

    • MOODLE_400_STABLE
    • MOODLE_401_STABLE
    • Hide
      1. Log in as admin
      2. Enable web service
      3. Generate, and make note of, token for the admin user
      4. Select Reports from the user menu
      5. Create a new report
      6. Note the report ID in the URL (<WWWROOT>/reportbuilder/edit.php?id=<REPORTID>)
      7. Execute the following web service request

        $ curl --silent "<WWROOT>/webservice/rest/server.php?moodlewsrestformat=json" --data "wstoken=<TOKEN>&wsfunction=core_reportbuilder_view_report&reportid=<REPORTID>" | python -m "json.tool"
        

      8. Confirm the following output:

        {
            "status": true,
            "warnings": []
        }
        

      9. In Moodle, navigate to your profile
      10. Press Reports > Today's logs
      11. Confirm Report viewed event is logged with ws origin described as:

        The user with id '<USERID>' viewed the custom report with id '<REPORTID>'.
        

      Show
      Log in as admin Enable web service Generate, and make note of, token for the admin user Select Reports from the user menu Create a new report Note the report ID in the URL (<WWWROOT>/reportbuilder/edit.php?id=<REPORTID>) Execute the following web service request $ curl --silent "<WWROOT>/webservice/rest/server.php?moodlewsrestformat=json" --data "wstoken=<TOKEN>&wsfunction=core_reportbuilder_view_report&reportid=<REPORTID>" | python -m "json.tool" Confirm the following output: { "status": true, "warnings": [] } In Moodle, navigate to your profile Press Reports > Today's logs Confirm Report viewed event is logged with ws origin described as: The user with id '<USERID>' viewed the custom report with id '<REPORTID>'.
    • WP 4.0 SP7

    Description

      Web Service to indicate that a report was viewed by someone

      core_reportbuilder_reports_view($reportid)

      Parameters: reportid (the report id obtained from the WS used to list reports)

      // Trigger report viewed event.

      report_viewed::create_from_object($report->get_report_persistent())->trigger();

      Returns:

      'status' => new external_value(PARAM_BOOL, 'status: true if success'),

      'warnings' => new external_warnings()

      Attachments

        Issue Links

          Activity

            People

              pholden Paul Holden
              jleyva Juan Leyva
              David Matamoros David Matamoros
              Shamim Rezaie Shamim Rezaie
              Angelia Dela Cruz Angelia Dela Cruz
              Carlos Castillo, David Matamoros, Mikel Martín Corrales, Paul Holden, Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona)
              Votes:
              1 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                14/Nov/22

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 5 hours, 50 minutes
                  5h 50m