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

The submission statement custom text should be returned for assignments with requiresubmissionstatement on

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Create a course with a student.
      2. Create an assignment with the following configuration: Submission settings ▶︎ Require that students accept the submission statement ▶︎ No.
      3. Enable "Mobile services": Plugins ► Web Services ► Mobile
      4. Create a Token for the student:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      5. Next, you can do a CURL REST call simulating a WS client with the student user.
        • You need to replace the wstoken, courseid and the URL of your moodle instance.

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseids%5B0%5D=2&wsfunction=mod_assign_get_assignments&wstoken=5b6154a56566a194f60f7f395f235179'

          Note, you can use jsonlint.com to validate and format the json returned string or append "| python -m json.tool" to automatically format the command output

      6. Confirm that requiresubmissionstatement is set to 0 and submissionstatement is NOT returned.
      7. Now edit the assign and set requiresubmissionstatement to Yes (see step 2).
      8. Perform the request again and check that now requiresubmissionstatement is set to 1 and you receive the submissionstatement. Check that submissionstatement matches the value you've set in the admin settings:
        • Site administration ▶︎ Plugins ▶︎ Activity modules ▶︎ Assignment ▶︎ Assignment settings ▶︎ Submission statement
      Show
      Create a course with a student. Create an assignment with the following configuration: Submission settings ▶︎ Require that students accept the submission statement ▶︎ No . Enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for the student: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the student user. You need to replace the wstoken, courseid and the URL of your moodle instance. curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseids%5B0%5D=2&wsfunction=mod_assign_get_assignments&wstoken=5b6154a56566a194f60f7f395f235179' Note, you can use jsonlint.com to validate and format the json returned string or append "| python -m json.tool" to automatically format the command output Confirm that requiresubmissionstatement is set to 0 and submissionstatement is NOT returned. Now edit the assign and set requiresubmissionstatement to Yes (see step 2). Perform the request again and check that now requiresubmissionstatement is set to 1 and you receive the submissionstatement . Check that submissionstatement matches the value you've set in the admin settings: Site administration ▶︎ Plugins ▶︎ Activity modules ▶︎ Assignment ▶︎ Assignment settings ▶︎ Submission statement
    • Affected Branches:
      MOODLE_31_STABLE, MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-55046-master

      Description

      We need to retrieve the text of the statement only in case is required. We'll need that for the Mobile app (to be able to display the text)

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  5/Dec/16