From e50fca020439d2b8dda969343eb42bf1f6f33362 Mon Sep 17 00:00:00 2001 From: PMKuipers Date: Sat, 7 Oct 2023 23:02:57 +0200 Subject: [PATCH] Fix for issue #38 --- classes/corecompletioninfo.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/classes/corecompletioninfo.php b/classes/corecompletioninfo.php index 474af83..dcb8681 100644 --- a/classes/corecompletioninfo.php +++ b/classes/corecompletioninfo.php @@ -126,8 +126,8 @@ class corecompletioninfo { public static function completion_item_editor_structure($value = VALUE_REQUIRED) : \external_description { return new \external_single_structure([ "id" => new \external_value(PARAM_INT, 'criteria id', VALUE_OPTIONAL), - "title" => new \external_value(PARAM_TEXT, 'name of subitem', VALUE_OPTIONAL), - "link" => new \external_value(PARAM_TEXT, 'optional link to more details', VALUE_OPTIONAL), + "title" => new \external_value(PARAM_RAW, 'name of subitem', VALUE_OPTIONAL), + "link" => new \external_value(PARAM_RAW, 'optional link to more details', VALUE_OPTIONAL), "details" => new \external_single_structure([ "type" => new \external_value(PARAM_RAW, 'type', VALUE_OPTIONAL), "criteria" => new \external_value(PARAM_RAW, 'criteria', VALUE_OPTIONAL), @@ -145,8 +145,8 @@ class corecompletioninfo { public static function completion_type_editor_structure($value = VALUE_REQUIRED) : \external_description { return new \external_single_structure([ "items" => new \external_multiple_structure(self::completion_item_editor_structure(), 'subitems', VALUE_OPTIONAL), - "title" => new \external_value(PARAM_TEXT, 'optional title', VALUE_OPTIONAL), - "desc" => new \external_value(PARAM_TEXT, 'optional description', VALUE_OPTIONAL), + "title" => new \external_value(PARAM_RAW, 'optional title', VALUE_OPTIONAL), + "desc" => new \external_value(PARAM_RAW, 'optional description', VALUE_OPTIONAL), "type" => new \external_value(PARAM_TEXT, 'completion type name'), "aggregation" => new \external_value(PARAM_TEXT, 'completion aggregation for this type ["all", "any"]'), ], 'completion type', $value); @@ -175,14 +175,14 @@ class corecompletioninfo { public static function completion_item_user_structure($value = VALUE_REQUIRED) : \external_description { return new \external_single_structure([ "id" => new \external_value(PARAM_INT, 'id of completion', VALUE_OPTIONAL), - "title" => new \external_value(PARAM_TEXT, 'name of subitem', VALUE_OPTIONAL), + "title" => new \external_value(PARAM_RAW, 'name of subitem', VALUE_OPTIONAL), "details" => new \external_single_structure([ "type" => new \external_value(PARAM_RAW, 'type', VALUE_OPTIONAL), "criteria" => new \external_value(PARAM_RAW, 'criteria', VALUE_OPTIONAL), "requirement" => new \external_value(PARAM_RAW, 'requirement', VALUE_OPTIONAL), "status" => new \external_value(PARAM_RAW, 'status', VALUE_OPTIONAL), ]), - "link" => new \external_value(PARAM_TEXT, 'optional link to more details', VALUE_OPTIONAL), + "link" => new \external_value(PARAM_RAW, 'optional link to more details', VALUE_OPTIONAL), "completed" => new \external_value(PARAM_BOOL, 'simple completed or not'), "status" => new \external_value(PARAM_TEXT, 'extended completion status ["incomplete", "progress", "complete", "complete-pass", "complete-fail"]'), @@ -201,8 +201,8 @@ class corecompletioninfo { public static function completion_type_user_structure($value = VALUE_REQUIRED) : \external_description { return new \external_single_structure([ "items" => new \external_multiple_structure(self::completion_item_user_structure(), 'subitems', VALUE_OPTIONAL), - "title" => new \external_value(PARAM_TEXT, 'optional title', VALUE_OPTIONAL), - "desc" => new \external_value(PARAM_TEXT, 'optional description', VALUE_OPTIONAL), + "title" => new \external_value(PARAM_RAW, 'optional title', VALUE_OPTIONAL), + "desc" => new \external_value(PARAM_RAW, 'optional description', VALUE_OPTIONAL), "type" => new \external_value(PARAM_TEXT, 'completion type name'), "aggregation" => new \external_value(PARAM_TEXT, 'completion aggregation for this type ["all", "any"]'), "completed" => new \external_value(PARAM_BOOL, 'current completion value for this type'),