|
|
|
|
@ -246,11 +246,9 @@ if (!empty($courseList) && is_array($courseList)) { |
|
|
|
|
|
|
|
|
|
if (Database::num_rows($resultExercises) > 0) { |
|
|
|
|
while ($exercise = Database::fetch_array($resultExercises, 'ASSOC')) { |
|
|
|
|
|
|
|
|
|
$exerciseSessionId = $exercise['session_id']; |
|
|
|
|
|
|
|
|
|
if (empty($exerciseSessionId)) { |
|
|
|
|
|
|
|
|
|
if ($global) { |
|
|
|
|
// If the exercise was created in the base course. |
|
|
|
|
// Load all sessions. |
|
|
|
|
@ -280,7 +278,6 @@ if (!empty($courseList) && is_array($courseList)) { |
|
|
|
|
$html .= $result['html']; |
|
|
|
|
$export_array_global = array_merge($export_array_global, $result['export_array_global']); |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
if (empty($sessionId)) { |
|
|
|
|
// Load base course. |
|
|
|
|
$result = processStudentList( |
|
|
|
|
@ -298,7 +295,6 @@ if (!empty($courseList) && is_array($courseList)) { |
|
|
|
|
$result['export_array_global'] |
|
|
|
|
); |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
$result = processStudentList( |
|
|
|
|
$filter_score, |
|
|
|
|
$global, |
|
|
|
|
@ -317,7 +313,6 @@ if (!empty($courseList) && is_array($courseList)) { |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
// If the exercise only exists in this session. |
|
|
|
|
|
|
|
|
|
$result = processStudentList( |
|
|
|
|
$filter_score, |
|
|
|
|
$global, |
|
|
|
|
@ -370,7 +365,8 @@ if ($exportToXLS) { |
|
|
|
|
* @param $b |
|
|
|
|
* @return int |
|
|
|
|
*/ |
|
|
|
|
function sort_user($a, $b) { |
|
|
|
|
function sort_user($a, $b) |
|
|
|
|
{ |
|
|
|
|
if (is_numeric($a['score']) && is_numeric($b['score'])) { |
|
|
|
|
if ($a['score'] < $b['score']) { |
|
|
|
|
return 1; |
|
|
|
|
@ -484,8 +480,7 @@ function export_complete_report_xls($filename, $array) |
|
|
|
|
*/ |
|
|
|
|
function processStudentList($filter_score, $global, $exercise, $courseInfo, $sessionId, $newSessionList) |
|
|
|
|
{ |
|
|
|
|
if ( |
|
|
|
|
(isset($exercise['id']) && empty($exercise['id'])) || |
|
|
|
|
if ((isset($exercise['id']) && empty($exercise['id'])) || |
|
|
|
|
!isset($exercise['id']) |
|
|
|
|
) { |
|
|
|
|
return array( |
|
|
|
|
@ -519,7 +514,6 @@ function processStudentList($filter_score, $global, $exercise, $courseInfo, $ses |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$html = null; |
|
|
|
|
|
|
|
|
|
$totalStudents = count($students); |
|
|
|
|
|
|
|
|
|
if (!$global) { |
|
|
|
|
|