From 25e2f3cb679ded3070500d1325a3e11aa3966fb6 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Fri, 16 Aug 2019 16:02:43 +0200 Subject: [PATCH] Fixes after merge with 1.11.x --- main/exercise/overview.php | 6 +++--- main/exercise/recalculate.php | 4 ++-- main/gradebook/lib/be/exerciselink.class.php | 6 +++--- main/gradebook/lib/fe/displaygradebook.php | 2 +- main/gradebook/lib/fe/gradebooktable.class.php | 2 +- main/inc/lib/exercise.lib.php | 12 ++++++------ 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/main/exercise/overview.php b/main/exercise/overview.php index 45acaf451f..e82df62008 100755 --- a/main/exercise/overview.php +++ b/main/exercise/overview.php @@ -215,8 +215,8 @@ if (!empty($attempts)) { foreach ($attempts as $attempt_result) { if (empty($certificateBlock)) { $certificateBlock = ExerciseLib::generateAndShowCertificateBlock( - $attempt_result['exe_result'], - $attempt_result['exe_weighting'], + $attempt_result['score'], + $attempt_result['max_score'], $objExercise, $attempt_result['exe_user_id'], $courseCode, @@ -224,7 +224,7 @@ if (!empty($attempts)) { ); } - $score = ExerciseLib::show_score($attempt_result['exe_result'], $attempt_result['exe_weighting']); + $score = ExerciseLib::show_score($attempt_result['score'], $attempt_result['max_score']); $attempt_url = api_get_path(WEB_CODE_PATH).'exercise/result.php?'; $attempt_url .= api_get_cidreq().'&show_headers=1&'; $attempt_url .= http_build_query(['id' => $attempt_result['exe_id']]); diff --git a/main/exercise/recalculate.php b/main/exercise/recalculate.php index be797b9b61..ec23d96ded 100644 --- a/main/exercise/recalculate.php +++ b/main/exercise/recalculate.php @@ -116,8 +116,8 @@ if (!$useEvaluationPlugin) { $table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES); $sql = "UPDATE $table SET - exe_result = '$totalScore', - exe_weighting = '$totalWeight' + score = '$totalScore', + max_score = '$totalWeight' WHERE exe_id = $exeId"; Database::query($sql); diff --git a/main/gradebook/lib/be/exerciselink.class.php b/main/gradebook/lib/be/exerciselink.class.php index 1c9778fb0b..75a33da555 100755 --- a/main/gradebook/lib/be/exerciselink.class.php +++ b/main/gradebook/lib/be/exerciselink.class.php @@ -362,11 +362,11 @@ class ExerciseLink extends AbstractLink if ($data['max_score'] != 0) { $students[$data['exe_user_id']] = $data['score']; $student_count++; - if ($data['exe_result'] > $bestResult) { - $bestResult = $data['exe_result']; + if ($data['score'] > $bestResult) { + $bestResult = $data['score']; } $sum += $data['score'] / $data['max_score']; - $sumResult += $data['exe_result']; + $sumResult += $data['score']; $weight = $data['max_score']; } } diff --git a/main/gradebook/lib/fe/displaygradebook.php b/main/gradebook/lib/fe/displaygradebook.php index 19a0c53744..9a5515cfe9 100755 --- a/main/gradebook/lib/fe/displaygradebook.php +++ b/main/gradebook/lib/fe/displaygradebook.php @@ -523,7 +523,7 @@ class DisplayGradebook } $score_display_custom = api_get_setting('gradebook_score_display_custom'); if (api_get_setting('teachers_can_change_score_settings') == 'true' && - $score_display_custom['my_display_custom'] == 'true' + $score_display_custom == 'true' ) { $actionsRight .= ''. Display::return_icon('ranking.png', get_lang('ScoreEdit'), '', ICON_SIZE_MEDIUM).''; diff --git a/main/gradebook/lib/fe/gradebooktable.class.php b/main/gradebook/lib/fe/gradebooktable.class.php index f85699aefe..59aa418c60 100755 --- a/main/gradebook/lib/fe/gradebooktable.class.php +++ b/main/gradebook/lib/fe/gradebooktable.class.php @@ -919,7 +919,7 @@ class GradebookTable extends SortableTable $content_html = DocumentManager::replace_user_info_into_html( api_get_user_id(), - $course_code, + api_get_course_info(), api_get_session_id() ); diff --git a/main/inc/lib/exercise.lib.php b/main/inc/lib/exercise.lib.php index 2709ce2fd2..da69270c90 100644 --- a/main/inc/lib/exercise.lib.php +++ b/main/inc/lib/exercise.lib.php @@ -4965,8 +4965,8 @@ EOT; usort( $data, function ($a, $b) { - if ($a['exe_result'] != $b['exe_result']) { - return $a['exe_result'] > $b['exe_result'] ? -1 : 1; + if ($a['score'] != $b['score']) { + return $a['score'] > $b['score'] ? -1 : 1; } if ($a['exe_date'] != $b['exe_date']) { @@ -4978,21 +4978,21 @@ EOT; ); // flags to display the same position in case of tie - $lastScore = $data[0]['exe_result']; + $lastScore = $data[0]['score']; $position = 1; $data = array_map( function ($item) use (&$lastScore, &$position) { - if ($item['exe_result'] < $lastScore) { + if ($item['score'] < $lastScore) { $position++; } - $lastScore = $item['exe_result']; + $lastScore = $item['score']; return [ $position, api_get_user_entity($item['exe_user_id']), - self::show_score($item['exe_result'], $item['exe_weighting'], true, true, true), + self::show_score($item['score'], $item['max_score'], true, true, true), api_convert_and_format_date($item['exe_date'], DATE_TIME_FORMAT_SHORT), ]; },