Fix for issue #38

This commit is contained in:
PMKuipers 2023-10-07 23:02:57 +02:00
parent db493e8029
commit e50fca0204

View File

@ -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'),