Added active info for badge

This commit is contained in:
PMKuipers 2023-11-01 23:48:47 +01:00
parent dd7fa5f620
commit 24370631ab

View file

@ -119,6 +119,7 @@ class badgeinfo {
'number of studyplan students that can get this badge', VALUE_OPTIONAL), 'number of studyplan students that can get this badge', VALUE_OPTIONAL),
"issuedcount" => new \external_value(PARAM_INT, "issuedcount" => new \external_value(PARAM_INT,
'number of studyplan students that have got this badge', VALUE_OPTIONAL), 'number of studyplan students that have got this badge', VALUE_OPTIONAL),
"active" => new \external_value(PARAM_BOOL, 'badge is available'),
], "Badge info", $value); ], "Badge info", $value);
} }
@ -149,6 +150,7 @@ class badgeinfo {
'description' => $this->badge->description, 'description' => $this->badge->description,
'imageurl' => \moodle_url::make_pluginfile_url($context->id, 'imageurl' => \moodle_url::make_pluginfile_url($context->id,
'badges', 'badgeimage', $this->badge->id, '/', 'f1')->out(false), 'badges', 'badgeimage', $this->badge->id, '/', 'f1')->out(false),
"active" => $this->badge->is_active(),
]; ];
// Add badge issue stats if a studentlist is attached to the request. // Add badge issue stats if a studentlist is attached to the request.