Línea 230... |
Línea 230... |
230 |
*
|
230 |
*
|
231 |
* @param \stdClass $user The user. If provided will delete completion information for just this user. Else all users.
|
231 |
* @param \stdClass $user The user. If provided will delete completion information for just this user. Else all users.
|
232 |
* @param int $courseid The course id. Provide this if you want course completion and activity completion deleted.
|
232 |
* @param int $courseid The course id. Provide this if you want course completion and activity completion deleted.
|
233 |
* @param int $cmid The course module id. Provide this if you only want activity completion deleted.
|
233 |
* @param int $cmid The course module id. Provide this if you only want activity completion deleted.
|
234 |
*/
|
234 |
*/
|
235 |
public static function delete_completion(\stdClass $user = null, int $courseid = null, int $cmid = null) {
|
235 |
public static function delete_completion(?\stdClass $user = null, ?int $courseid = null, ?int $cmid = null) {
|
236 |
global $DB;
|
236 |
global $DB;
|
Línea 237... |
Línea 237... |
237 |
|
237 |
|
238 |
if (isset($cmid)) {
|
238 |
if (isset($cmid)) {
|
239 |
$params = (isset($user)) ? ['userid' => $user->id, 'coursemoduleid' => $cmid] : ['coursemoduleid' => $cmid];
|
239 |
$params = (isset($user)) ? ['userid' => $user->id, 'coursemoduleid' => $cmid] : ['coursemoduleid' => $cmid];
|
Línea 283... |
Línea 283... |
283 |
*
|
283 |
*
|
284 |
* @param approved_userlist $userlist The approved userlist of users to delete completion information for.
|
284 |
* @param approved_userlist $userlist The approved userlist of users to delete completion information for.
|
285 |
* @param int $courseid The course id. Provide this if you want course completion and activity completion deleted.
|
285 |
* @param int $courseid The course id. Provide this if you want course completion and activity completion deleted.
|
286 |
* @param int $cmid The course module id. Provide this if you only want activity completion deleted.
|
286 |
* @param int $cmid The course module id. Provide this if you only want activity completion deleted.
|
287 |
*/
|
287 |
*/
|
288 |
public static function delete_completion_by_approved_userlist(approved_userlist $userlist, int $courseid = null, int $cmid = null) {
|
288 |
public static function delete_completion_by_approved_userlist(approved_userlist $userlist, ?int $courseid = null, ?int $cmid = null) {
|
289 |
global $DB;
|
289 |
global $DB;
|
290 |
$userids = $userlist->get_userids();
|
290 |
$userids = $userlist->get_userids();
|
Línea 291... |
Línea 291... |
291 |
|
291 |
|
292 |
if (empty($userids)) {
|
292 |
if (empty($userids)) {
|