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

WS mod_lesson_get_attempts_overview is failing when there aren't attempts

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: 3.3
    • Component/s: Lesson
    • Labels:
    • Testing Instructions:
      Hide
      1. In a course create a lesson with just one question page.
      2. Enrol one user as teacher in the course where the lesson is.
      3. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      4. Create a Token for the teacher user
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      5. 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)

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'lessonid=4&wsfunction=mod_lesson_get_attempts_overview&wstoken=a70d553bbaf6d9b260a9e5c701b3c46e&moodlewssettingfilter=true' | python -m "json.tool"

      6. Now check that in the information returned you only see a warnings array (empty).
      7. You should check that you don't see a field called 'data' in the curl response
      Show
      In a course create a lesson with just one question page. Enrol one user as teacher in the course where the lesson is. 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) curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'lessonid=4&wsfunction=mod_lesson_get_attempts_overview&wstoken=a70d553bbaf6d9b260a9e5c701b3c46e&moodlewssettingfilter=true' | python -m "json.tool" Now check that in the information returned you only see a warnings array (empty). You should check that you don't see a field called 'data' in the curl response
    • Affected Branches:
      MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-58860-master

      Description

      The WS should not return the $data object because is empty

        Attachments

          Activity

            People

            • Assignee:
              jleyva Juan Leyva
              Reporter:
              jleyva Juan Leyva
              Peer reviewer:
              Dani Palou
              Integrator:
              Jun Pataleta
              Tester:
              Jun Pataleta
              Participants:
              Component watchers:
              Adrian Greeve, Mihail Geshoski, Peter Dias
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                15/May/17