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

Invalid response in mod_assign_get_submission_status WS

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.1.6, 3.2.3
    • 3.2.2
    • Assignment
    • MOODLE_32_STABLE
    • MOODLE_31_STABLE, MOODLE_32_STABLE
    • MDL-58707-master
    • Hide
      1. Create an assignment allow just an online text submission (no attachments/files)
      2. As student, submit the assignment
      3. Now, to test this you need to modify this file: mod/assign/submission/onlinetext/locallib.php
      4. Change this line: return array('onlinetext' => get_string('pluginname', 'assignsubmission_onlinetext'));
      5. With: return array('onlinetext' => 'some <br> html <b>here</b>');
      6. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      7. Now, with the mobile app. Access to the assignment via the Mobile app, and check that you can see correctly the submission you did (date and text submitted).
      Show
      Create an assignment allow just an online text submission (no attachments/files) As student, submit the assignment Now, to test this you need to modify this file: mod/assign/submission/onlinetext/locallib.php Change this line: return array('onlinetext' => get_string('pluginname', 'assignsubmission_onlinetext')); With: return array('onlinetext' => 'some <br> html <b>here</b>'); As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings Now, with the mobile app. Access to the assignment via the Mobile app, and check that you can see correctly the submission you did (date and text submitted).

      This is the invalid response:

      lastattempt => Invalid response value detected: submission => Invalid response value detected: plugins => Invalid response value detected: editorfields => Invalid response value detected: description => Invalid response value detected: Invalid external api response: the value is \"<br \/>\", the server was expecting \"text\" type

      This is happening when there are plugins installed that are returning the editor field description including HTML. The param is set to PARAM_TEXT so the WS response fails.

      Example of get_editor_fields, as we can see is returning a description using get_string (that means that it may content html):

          public function get_editor_fields() {
              return array('onlinetext' => get_string('pluginname', 'assignsubmission_comments'));
          }
      

            jleyva Juan Leyva
            jleyva Juan Leyva
            Dani Palou Dani Palou
            Andrew Lyons Andrew Lyons
            Mark Nelson Mark Nelson
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

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