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

Return the complete page information in mod_lesson_get_user_attempt

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: 3.4
    • Component/s: Lesson
    • Labels:
    • Testing Instructions:
      Hide
      1. In a course create a lesson with at least two content pages and one question page. Enable multiple attempts in the lesson.
      2. Enrol one user as student and another as teacher in the course where the lesson is.
      3. Access to the lesson as student in the Moodle web interface, and complete the lesson.
      4. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      5. Create a Token for the teacher user
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      6. Next, you can do a CURL REST call simulating a WS client with the teacher user token.
        • You need to replace the wstoken, lessonid (the lesson instance value), userid (the student id)

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'lessonid=11&wsfunction=mod_lesson_get_user_attempt&wstoken=a70d553bbaf6d9b260a9e5c701b3c46e&moodlewssettingfilter=true&userid=138&lessonattempt=0' | python -m "json.tool"

      7. Now check that the information returned match the one in the Moodle web interface (Lesson -> Reports -> Overview -> Go to the first attempt)
      8. Also check that inside each answerpages the complete page record is returned in a field called 'page'
      Show
      In a course create a lesson with at least two content pages and one question page. Enable multiple attempts in the lesson. Enrol one user as student and another as teacher in the course where the lesson is. Access to the lesson as student in the Moodle web interface, and complete the lesson. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings Create a Token for the teacher user Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the teacher user token. You need to replace the wstoken, lessonid (the lesson instance value), userid (the student id) curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'lessonid=11&wsfunction=mod_lesson_get_user_attempt&wstoken=a70d553bbaf6d9b260a9e5c701b3c46e&moodlewssettingfilter=true&userid=138&lessonattempt=0' | python -m "json.tool" Now check that the information returned match the one in the Moodle web interface (Lesson -> Reports -> Overview -> Go to the first attempt) Also check that inside each answerpages the complete page record is returned in a field called 'page'
    • Affected Branches:
      MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-59133-master

      Description

      We need the complete page information to be able to render properly the user attempt data.

      I did the original implementation of the WS but I don't know why I didn't return the complete page object.

        Attachments

          Activity

            People

            Assignee:
            jleyva Juan Leyva
            Reporter:
            jleyva Juan Leyva
            Peer reviewer:
            Dani Palou
            Integrator:
            Eloy Lafuente (stronk7)
            Tester:
            John Okely
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              13/Nov/17