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

Assignment submission text is not being formatted in WS

XMLWordPrintable

    • MOODLE_31_STABLE
    • MOODLE_31_STABLE
    • MDL-55225-master
    • Hide
      1. Create a course with a student.
      2. Create an assignment accepting only online text. Please remember the assignid since you'll need it later.
      3. As the student, add a submission with at least 1 embedded image or media.
      4. Enable "Mobile services": Plugins ► Web Services ► Mobile
      5. Create a Token for the student:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      6. Next, you can do a CURL REST call simulating a WS client with the student user.
        • You need to replace the wstoken, assignid and the URL of your moodle instance.

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'assignid=2&wstoken=5b6154a56566a194f60f7f395f235179&wsfunction=mod_assign_get_submission_status&moodlewssettingfilter=true'

          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.

      7. Check that the submission text is formatted (it's inside "lastattempt" > "submission" > "plugins" > "editorfields" > "text"). That is:
        • URLs don't contain the wildcard "@@PLUGINFILE@@".
        • If multimedia plugin is enabled and you added a video/audio, you receive an HTML5 player instead of a link to the file.
      8. Additionally, you can perform the request again but using moodlewssettingfilter=false&moodlewssettingfileurl=false and check that now the response isn't formatted.
      Show
      Create a course with a student. Create an assignment accepting only online text. Please remember the assignid since you'll need it later. As the student, add a submission with at least 1 embedded image or media. 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, assignid and the URL of your moodle instance. curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'assignid=2&wstoken=5b6154a56566a194f60f7f395f235179&wsfunction=mod_assign_get_submission_status&moodlewssettingfilter=true' 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. Check that the submission text is formatted (it's inside "lastattempt" > "submission" > "plugins" > "editorfields" > "text"). That is: URLs don't contain the wildcard "@@PLUGINFILE@@". If multimedia plugin is enabled and you added a video/audio, you receive an HTML5 player instead of a link to the file. Additionally, you can perform the request again but using moodlewssettingfilter=false&moodlewssettingfileurl=false and check that now the response isn't formatted.

      get_plugins_data is not returning the html text correctly formatted (filtered) via external_format_text

            dpalou Dani Palou
            jleyva Juan Leyva
            Jake Dallimore Jake Dallimore
            Dan Poltawski Dan Poltawski
            Marina Glancy Marina Glancy
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.