diff --git a/preferences.php b/preferences.php index 37b8128..8597fdd 100644 --- a/preferences.php +++ b/preferences.php @@ -93,7 +93,9 @@ switch ($att->pageparams->action) { foreach ($acronym as $id => $v) { $att->update_status($id, $acronym[$id], $description[$id], $grade[$id], null); } - att_update_all_users_grades($att->id, $att->course, $att->context, $cm); + if ($att->grade > 0) { + att_update_all_users_grades($att->id, $att->course, $att->context, $cm); + } break; } diff --git a/sessions.php b/sessions.php index b32e087..b03b3df 100644 --- a/sessions.php +++ b/sessions.php @@ -85,7 +85,9 @@ switch ($att->pageparams->action) { if (isset($confirm) && confirm_sesskey()) { $att->delete_sessions(array($sessionid)); - att_update_all_users_grades($att->id, $att->course, $att->context, $cm); + if ($att->grade > 0) { + att_update_all_users_grades($att->id, $att->course, $att->context, $cm); + } redirect($att->url_manage(), get_string('sessiondeleted', 'attendance')); } @@ -112,7 +114,9 @@ switch ($att->pageparams->action) { $sessionsids = explode('_', $sessionsids); $att->delete_sessions($sessionsids); - att_update_all_users_grades($att->id, $att->course, $att->context, $cm); + if ($att->grade > 0) { + att_update_all_users_grades($att->id, $att->course, $att->context, $cm); + } redirect($att->url_manage(), get_string('sessiondeleted', 'attendance')); } $sessid = required_param('sessid', PARAM_SEQUENCE);