MDL-31682 - fix for online text assignments
authorDan Poltawski <dan@moodle.com>
Thu, 17 Jan 2013 07:48:29 +0000 (15:48 +0800)
committerDan Poltawski <dan@moodle.com>
Thu, 17 Jan 2013 07:48:29 +0000 (15:48 +0800)
mod/assign/externallib.php
mod/assign/tests/externallib_test.php

index 50e8639..a5ad1c4 100644 (file)
@@ -643,8 +643,8 @@ class mod_assign_external extends external_api {
                                                 array(
                                                     'name' => new external_value(PARAM_TEXT, 'field name'),
                                                     'description' => new external_value(PARAM_TEXT, 'field description'),
-                                                    'text' => new external_value (PARAM_TEXT, 'field value'),
-                                                    'format' => new external_value (PARAM_INT, 'field format')
+                                                    'text' => new external_value (PARAM_RAW, 'field value'),
+                                                    'format' => new external_format_value ('text')
                                                 )
                                             )
                                             , 'editorfields', VALUE_OPTIONAL
index 2df62ea..b56ffee 100644 (file)
@@ -229,7 +229,7 @@ class mod_assign_external_testcase extends externallib_advanced_testcase {
         $submission->id = $sid;
 
         $onlinetextsubmission = new stdClass();
-        $onlinetextsubmission->onlinetext = "online test text";
+        $onlinetextsubmission->onlinetext = "<p>online test text</p>";
         $onlinetextsubmission->onlineformat = 1;
         $onlinetextsubmission->submission = $submission->id;
         $onlinetextsubmission->assignment = $assign1->id;