diff --git a/public/main/exercise/exercise.class.php b/public/main/exercise/exercise.class.php index 9619381ff20..2f1ca23311b 100644 --- a/public/main/exercise/exercise.class.php +++ b/public/main/exercise/exercise.class.php @@ -8988,18 +8988,6 @@ public static function exerciseGridResource( } } - // Blocking empty start times see BT#2800 - // @todo replace global - /*global $_custom; - if (isset($_custom['exercises_hidden_when_no_start_date']) && - $_custom['exercises_hidden_when_no_start_date'] - ) { - if (empty($startTime)) { - $time_limits = true; - $is_actived_time = false; - } - }*/ - $cut_title = $exercise->getCutTitle(); $alt_title = ''; if ($cut_title != $exerciseEntity->getTitle()) { @@ -9035,7 +9023,7 @@ public static function exerciseGridResource( ''.$sessionStar; if (ExerciseLib::isQuizEmbeddable($exerciseEntity)) { - $embeddableIcon = Display::getMdiIcon('book-music-outline', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('ThisQuizCanBeEmbeddable')); + $embeddableIcon = Display::getMdiIcon('book-music-outline', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('This quiz can be embeddable')); $url .= Display::div($embeddableIcon, ['class' => 'pull-right']); } @@ -9118,7 +9106,7 @@ public static function exerciseGridResource( if (true === $allowClean) { if (!$locked) { $clean = Display::url( - Display::getMdiIcon(ActionIcon::RESET, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('CleanStudentResults') + Display::getMdiIcon(ActionIcon::RESET, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Clean student results') ), '', [ @@ -9134,7 +9122,7 @@ public static function exerciseGridResource( ] ); } else { - $clean = Display::getMdiIcon(ActionIcon::RESET, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('ResourceLockedByGradebook') + $clean = Display::getMdiIcon(ActionIcon::RESET, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('Resource locked by gradebook') ); } } @@ -9190,14 +9178,14 @@ public static function exerciseGridResource( $actions .= $export; } else { // not session - $actions = Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('ExerciseEditionNotAvailableInSession') + $actions = Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('Exercise edition not available in session') ); // Check if this exercise was added in a LP $visibility = ''; if (api_is_platform_admin()) { if ($exercise->exercise_was_added_in_lp) { - $visibility = Display::getMdiIcon(StateIcon::PRIVATE_VISIBILITY, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('AddedToLPCannotBeAccessed') + $visibility = Display::getMdiIcon(StateIcon::PRIVATE_VISIBILITY, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Added to learnpath cannot be accessed') ); } else { if (0 === $exerciseEntity->getActive() || 0 == $visibility) { @@ -9291,14 +9279,14 @@ public static function exerciseGridResource( $random_number_of_question ); $number_of_questions = $nbQuestionsTotal.' '; - $number_of_questions .= ($nbQuestionsTotal > 1) ? get_lang('QuestionsLowerCase') : get_lang( - 'QuestionLowerCase' + $number_of_questions .= ($nbQuestionsTotal > 1) ? get_lang('Questions lower case') : get_lang( + 'Question lower case' ); $number_of_questions .= ' - '; $number_of_questions .= min( TestCategory::getNumberMaxQuestionByCat($exerciseId), $random_number_of_question - ).' '.get_lang('QuestionByCategory'); + ).' '.get_lang('Question by category'); } else { $random_label = ' ('.get_lang('Random').') '; $number_of_questions = $random_number_of_question.' '.$random_label.' / '.$rowi; @@ -9391,14 +9379,14 @@ public static function exerciseGridResource( $today = time(); if ($today < $start_time) { $attempt_text = sprintf( - get_lang('ExerciseWillBeActivatedFromXToY'), + get_lang('Exercise will be activated from %s to %s'), api_convert_and_format_date($start_time), api_convert_and_format_date($end_time) ); } else { if ($today > $end_time) { $attempt_text = sprintf( - get_lang('ExerciseWasActivatedFromXToY'), + get_lang('Exercise was activated from %s to %s'), api_convert_and_format_date($start_time), api_convert_and_format_date($end_time) ); @@ -9407,13 +9395,13 @@ public static function exerciseGridResource( } else { if (!empty($startTime)) { $attempt_text = sprintf( - get_lang('ExerciseAvailableFromX'), + get_lang('Exercise available from %s'), api_convert_and_format_date($start_time) ); } if (!empty($endTime)) { $attempt_text = sprintf( - get_lang('ExerciseAvailableUntilX'), + get_lang('Exercise available until %s'), api_convert_and_format_date($end_time) ); } @@ -9452,6 +9440,7 @@ public static function exerciseGridResource( } $currentRow['attempt'] = $attempt_text; + $currentRow['iid'] = $exerciseId; if ($is_allowedToEdit) { $additionalActions = ExerciseLib::getAdditionalTeacherActions($exerciseId); @@ -9461,7 +9450,7 @@ public static function exerciseGridResource( } if (!empty($myActions) && is_callable($myActions)) { - $actions = $myActions($row); + $actions = $myActions($currentRow); } $currentRow = [ $exerciseId, diff --git a/public/plugin/Positioning/start_student.php b/public/plugin/Positioning/start_student.php index 30d5605dc5d..0633e01b543 100644 --- a/public/plugin/Positioning/start_student.php +++ b/public/plugin/Positioning/start_student.php @@ -11,8 +11,6 @@ api_not_allowed(true); } -//$htmlHeadXtra[] = api_get_js('chartjs/Chart.min.js'); - $currentUrl = api_get_self().'?'.api_get_cidreq(); $courseId = api_get_course_int_id(); $courseCode = api_get_course_id(); @@ -45,11 +43,14 @@ } } +$course = api_get_course_entity($courseId); +$session = $sessionId ? api_get_session_entity($sessionId) : null; + $studentAverage = Tracking::get_avg_student_progress( $currentUserId, - $courseCode, + $course, [], - $sessionId + $session ); $averageToUnlock = (float) $plugin->get('average_percentage_to_unlock_final_exercise'); diff --git a/public/plugin/Positioning/view/start_student.tpl b/public/plugin/Positioning/view/start_student.tpl index d6dae4a20fd..5e1fa8ecd0a 100644 --- a/public/plugin/Positioning/view/start_student.tpl +++ b/public/plugin/Positioning/view/start_student.tpl @@ -1,25 +1,37 @@ -
-
-
- - - - - - - - - - - -
{{ "InviteToTakePositioningTest"| get_plugin_lang('Positioning') }}
{{ "InitialTest"| get_plugin_lang('Positioning') }}: {{ initial_exercise }}
{{ "YouMustCompleteAThresholdToTakeFinalTest"| get_plugin_lang('Positioning') | format(average_percentage_to_unlock_final_exercise) }}
{{ "Average"| get_lang }}: {{ lp_url_and_progress }}
{{ "FinalTest"| get_plugin_lang('Positioning') }}: {{ final_exercise }}
+
+
+
+ Positioning line + +
+
+

+ {{ "InviteToTakePositioningTest"| get_plugin_lang('Positioning') }} +

+

+ {{ "InitialTest"| get_plugin_lang('Positioning') }}: {{ initial_exercise|raw }} +

+
+ +
+

+ {{ "YouMustCompleteAThresholdToTakeFinalTest"| get_plugin_lang('Positioning') | format(average_percentage_to_unlock_final_exercise) }} +

+

+ {{ "Average"| get_lang }}: {{ lp_url_and_progress|raw }} +

+
+ +
+

+ {{ "FinalTest"| get_plugin_lang('Positioning') }}: {{ final_exercise|raw }} +

+
+
-
-
-
- {{ radars }} + +
+ {{ radars|raw }}
- -