Debugging

This commit is contained in:
PMKuipers 2023-12-01 11:14:14 +01:00
parent 41eee1a7aa
commit 97552704ce

View File

@ -117,7 +117,9 @@ class studentstudyplanservice extends \external_api {
webservicehelper::require_capabilities(self::CAP_VIEWOTHER, $studyplan->context()); webservicehelper::require_capabilities(self::CAP_VIEWOTHER, $studyplan->context());
if ($studyplan->exist_for_user($userid)) { if ($studyplan->exist_for_user($userid)) {
return $studyplan->user_model($userid);
$model = $studyplan->user_model($userid);
return $model;
} else { } else {
return null; return null;
} }
@ -363,7 +365,6 @@ class studentstudyplanservice extends \external_api {
foreach ($studyplans as $studyplan) { foreach ($studyplans as $studyplan) {
$list[] = $studyplan->simple_model($userid); $list[] = $studyplan->simple_model($userid);
} }
return $list; return $list;
} }
@ -405,7 +406,9 @@ class studentstudyplanservice extends \external_api {
$studyplan = studyplan::find_by_id($studyplanid); $studyplan = studyplan::find_by_id($studyplanid);
if ($studyplan->exist_for_user($userid)) { if ($studyplan->exist_for_user($userid)) {
return debug::dump($studyplan->user_model($userid)); $model = $studyplan->user_model($userid);
debug::dump($model);
return $model;
} else { } else {
throw new \moodle_exception("You do not have access to this studyplan"); throw new \moodle_exception("You do not have access to this studyplan");
} }