Skip to content

Commit

Permalink
Webservice: Add created_by/updated_by to course_exercises webservice …
Browse files Browse the repository at this point in the history
…- refs BT#20478
  • Loading branch information
ywarnier committed Feb 17, 2023
1 parent b0823cc commit 1845be2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions main/inc/lib/webservices/Rest.php
Expand Up @@ -3224,6 +3224,18 @@ public function getCourseExercises($fields = []): array
}
}
}
foreach ($list as $id => $row) {
// Get item authoring data
$itemProps = api_get_last_item_property_info($row['c_id'], 'quiz', $row['iid']);
$createdBy = $this->__getConfiguredUsernameById($itemProps['insert_user_id']);
if ($itemProps['insert_user_id'] == $itemProps['lastedit_user_id']) {
$updatedBy = $createdBy;
} else {
$updatedBy = $this->__getConfiguredUsernameById($itemProps['lastedit_user_id']);
}
$list[$id]['created_by'] = $createdBy;
$list[$id]['updated_by'] = $updatedBy;
}
return $list;
}

Expand Down

0 comments on commit 1845be2

Please sign in to comment.