Skip to content

Commit b21a8a2

Browse files
committed
Exercise: fix delete attempt from pending exercice page - refs BT#22272
1 parent b590a17 commit b21a8a2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

main/exercise/exercise_report.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
$sessionId = api_get_session_id();
6161
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;
6262

63-
if ('export_all_exercises_results' !== $action) {
63+
if ('export_all_exercises_results' !== $action && !(isset($_GET['delete']) && $_GET['delete'] === 'delete')) {
6464
if (empty($exercise_id)) {
6565
api_not_allowed(true);
6666
}
@@ -523,6 +523,10 @@
523523
if (!empty($exe_id)) {
524524
ExerciseLib::deleteExerciseAttempt($exe_id);
525525

526+
if (empty($exercise_id)) {
527+
header('Location: pending.php');
528+
exit;
529+
}
526530
header('Location: exercise_report.php?'.api_get_cidreq().'&exerciseId='.$exercise_id);
527531
exit;
528532
}

0 commit comments

Comments
 (0)