MDL-55113 assign: Use PARAM_RAW in onlinetext text
authorDani Palou <dani@moodle.com>
Mon, 4 Jul 2016 07:29:29 +0000 (09:29 +0200)
committerDani Palou <dani@moodle.com>
Mon, 4 Jul 2016 07:53:36 +0000 (09:53 +0200)
mod/assign/submission/onlinetext/locallib.php
mod/assign/tests/externallib_test.php

index 0638490..a876880 100644 (file)
@@ -615,7 +615,7 @@ class assign_submission_onlinetext extends assign_submission_plugin {
      * @return external_description|null
      */
     public function get_external_parameters() {
      * @return external_description|null
      */
     public function get_external_parameters() {
-        $editorparams = array('text' => new external_value(PARAM_TEXT, 'The text for this submission.'),
+        $editorparams = array('text' => new external_value(PARAM_RAW, 'The text for this submission.'),
                               'format' => new external_value(PARAM_INT, 'The format for this submission'),
                               'itemid' => new external_value(PARAM_INT, 'The draft area id for files attached to the submission'));
         $editorstructure = new external_single_structure($editorparams, 'Editor structure', VALUE_OPTIONAL);
                               'format' => new external_value(PARAM_INT, 'The format for this submission'),
                               'itemid' => new external_value(PARAM_INT, 'The draft area id for files attached to the submission'));
         $editorstructure = new external_single_structure($editorparams, 'Editor structure', VALUE_OPTIONAL);
index e035af6..f06ac43 100644 (file)
@@ -970,7 +970,7 @@ class mod_assign_external_testcase extends externallib_advanced_testcase {
         // Now try a submission.
         $submissionpluginparams = array();
         $submissionpluginparams['files_filemanager'] = $draftidfile;
         // Now try a submission.
         $submissionpluginparams = array();
         $submissionpluginparams['files_filemanager'] = $draftidfile;
-        $onlinetexteditorparams = array('text'=>'Yeeha!',
+        $onlinetexteditorparams = array('text' => '<p>Yeeha!</p>',
                                         'format'=>1,
                                         'itemid'=>$draftidonlinetext);
         $submissionpluginparams['onlinetext_editor'] = $onlinetexteditorparams;
                                         'format'=>1,
                                         'itemid'=>$draftidonlinetext);
         $submissionpluginparams['onlinetext_editor'] = $onlinetexteditorparams;