Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-1649

Assignments submission comments cannot be accessed via webservice

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Create a course with a student. The course must have at least one section.
      2. Add and assignment with submission comments.
      3. As the student submit and add some comments to the submission comments.
      4. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
      5. Create a Token for the student user.
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      6. Take note of the student token (to be used in following instructions).
      7. Next, you can do a CURL REST call simulating a WS client with the student user.
        • You need to replace the wstoken, instanceid, itemid and the URL of your moodle instance.
        • Where:
          • wstoken is the token of the student user you created.
          • instanceid is the coursemodule id of the assignment.
          • itemid is the submission id.
        • curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=core_comment_get_comments&contextlevel=module&component=assignsubmission_comments&area=submission_comments&page=0&instanceid=72&itemid=34&wstoken=cd2be328e7db5fefa407274d1e1073a7' --compressed

      8. Confirm that the comments info is returned.
      Show
      Create a course with a student. The course must have at least one section. Add and assignment with submission comments. As the student submit and add some comments to the submission comments. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for the student user. Click on Site administration ► Plugins ► Web services ► Manage tokens Take note of the student token (to be used in following instructions). Next, you can do a CURL REST call simulating a WS client with the student user. You need to replace the wstoken, instanceid, itemid and the URL of your moodle instance. Where: wstoken is the token of the student user you created. instanceid is the coursemodule id of the assignment. itemid is the submission id. curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=core_comment_get_comments&contextlevel=module&component=assignsubmission_comments&area=submission_comments&page=0&instanceid=72&itemid=34&wstoken=cd2be328e7db5fefa407274d1e1073a7' --compressed Confirm that the comments info is returned.
    • Difficulty:
      Moderate
    • Affected Branches:
      MOODLE_31_STABLE
    • Sprint:
      Moodle Mobile 3.2
    • Issue size:
      Small

      Description

      When retrieving comments for Assignment submissions an error is raised informfing that course module does not exists.
      It happens because course is not informed and it search in site course.

      I can be solved via Local Mobile passing courseid arg when creating the new comment object in core_comment_get_comments.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              pferre22 Pau Ferrer
              Reporter:
              pferre22 Pau Ferrer
              Participants:
              Component watchers:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: