Skip to content

Commit 95619a1

Browse files
authored
Update model.ajax.php
1 parent 6990c05 commit 95619a1

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

main/inc/ajax/model.ajax.php

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66

77
require_once __DIR__.'/../global.inc.php';
88

9-
// --- DATE FILTERS ---
10-
$search_start_date = isset($_REQUEST['start_date']) && !empty($_REQUEST['start_date']) ? $_REQUEST['start_date'] : null;
11-
$search_end_date = isset($_REQUEST['end_date']) && !empty($_REQUEST['end_date']) ? $_REQUEST['end_date'] : null;
12-
139
// 1. Setting variables needed by jqgrid
1410
$action = $_GET['a'];
1511
$page = (int) $_REQUEST['page']; //page
@@ -649,19 +645,20 @@ function getWhereClause($col, $oper, $val)
649645
break;
650646

651647
case 'get_exercise_pending_results':
652-
if ((false === api_is_teacher()) && (false === api_is_session_admin())) {
653-
exit;
654-
}
655-
656-
$courseId = $_REQUEST['course_id'] ?? 0;
657-
$exerciseId = $_REQUEST['exercise_id'] ?? 0;
658-
$status = $_REQUEST['status'] ?? 0;
659-
$questionType = $_REQUEST['questionType'] ?? 0;
660-
$showAttemptsInSessions = $_REQUEST['showAttemptsInSessions'] ? true : false;
661-
if (isset($_GET['filter_by_user']) && !empty($_GET['filter_by_user'])) {
662-
$filter_user = (int) $_GET['filter_by_user'];
663-
if (empty($whereCondition)) {
664-
$whereCondition .= " te.exe_user_id = '$filter_user'";
648+
if ((false === api_is_teacher()) && (false === api_is_session_admin())) {
649+
exit;
650+
}
651+
$search_start_date = isset($_REQUEST['start_date']) && !empty($_REQUEST['start_date']) ? $_REQUEST['start_date'] : null;
652+
$search_end_date = isset($_REQUEST['end_date']) && !empty($_REQUEST['end_date']) ? $_REQUEST['end_date'] : null;
653+
$courseId = $_REQUEST['course_id'] ?? 0;
654+
$exerciseId = $_REQUEST['exercise_id'] ?? 0;
655+
$status = $_REQUEST['status'] ?? 0;
656+
$questionType = $_REQUEST['questionType'] ?? 0;
657+
$showAttemptsInSessions = $_REQUEST['showAttemptsInSessions'] ? true : false;
658+
if (isset($_GET['filter_by_user']) && !empty($_GET['filter_by_user'])) {
659+
$filter_user = (int) $_GET['filter_by_user'];
660+
if (empty($whereCondition)) {
661+
$whereCondition .= " te.exe_user_id = '$filter_user'";
665662
} else {
666663
$whereCondition .= " AND te.exe_user_id = '$filter_user'";
667664
}

0 commit comments

Comments
 (0)