Skip to content

Commit 905ea48

Browse files
committed
Tracking: Show progress based on visibles LPs only - refs BT#22396
1 parent 9d2a217 commit 905ea48

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

main/inc/lib/tracking.lib.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3761,6 +3761,9 @@ public static function get_avg_student_progress(
37613761
null,
37623762
false,
37633763
null,
3764+
true,
3765+
false,
3766+
true,
37643767
true
37653768
);
37663769
$lpList = $lpList->get_flat_list();

main/lp/learnpathList.class.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ public function __construct(
4545
$categoryId = null,
4646
$ignoreCategoryFilter = false,
4747
$ignoreLpVisibility = false,
48-
bool $includeSubscribedLp = true
48+
bool $includeSubscribedLp = true,
49+
bool $showOnlyVisibleToStudent = false
4950
) {
5051
if (empty($courseInfo)) {
5152
$courseInfo = api_get_course_info();
@@ -164,7 +165,7 @@ public function __construct(
164165

165166
// If option is not true then don't show invisible LP to user
166167
if ($ignoreLpVisibility === false) {
167-
if ($showBlockedPrerequisite !== true && !$isAllowToEdit) {
168+
if ($showBlockedPrerequisite !== true && (!$isAllowToEdit || $showOnlyVisibleToStudent)) {
168169
$lpVisibility = learnpath::is_lp_visible_for_student(
169170
$row->getId(),
170171
$user_id,

main/mySpace/myStudents.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1274,7 +1274,7 @@
12741274
echo '<tr>
12751275
<th>'.get_lang('Course').'</th>
12761276
<th>'.get_lang('Time').'</th>
1277-
<th>'.get_lang('Progress').'</th>
1277+
<th>'.get_lang('Progress').' (*)</th>
12781278
<th>'.get_lang('Score').'</th>
12791279
<th>'.get_lang('AttendancesFaults').'</th>
12801280
<th>'.get_lang('Evaluations').'</th>
@@ -1589,6 +1589,7 @@
15891589
Session::write('export_course_list', $exportCourseList);
15901590
echo '</tbody>';
15911591
echo '</table>';
1592+
echo '<p>(*) ' . get_lang('progressBasedOnVisiblesLPsInEachCourse') . '</p>';
15921593
echo '</div>';
15931594
}
15941595
} else {

main/tracking/courseLog.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ function loadGraphs () {
696696
$courseProgressHeadTitle = ($lpShowMaxProgress ? get_lang('ScormAndLPMaxProgress') : get_lang('ScormAndLPProgressTotalAverage'));
697697
$table->set_header(
698698
$headerCounter++,
699-
get_lang('CourseProgress').'&nbsp;'.
699+
get_lang('CourseProgress').'&nbsp; (*) &nbsp;'.
700700
Display::return_icon('info3.gif', $courseProgressHeadTitle, [], ICON_SIZE_TINY),
701701
false
702702
);
@@ -831,6 +831,24 @@ function loadGraphs () {
831831

832832
$html .= '<div id="reporting_table">';
833833
$html .= $table->return_table();
834+
$userIdList = Session::read('user_id_list');
835+
if (isset($userIdList[0])) {
836+
$lpList = new LearnpathList(
837+
$studentId,
838+
$courseInfo,
839+
$sessionId,
840+
null,
841+
false,
842+
null,
843+
true,
844+
false,
845+
true,
846+
true
847+
);
848+
$lpList = $lpList->get_flat_list();
849+
$NbVisibleLps = count($lpList);
850+
$html .= '<p>(*) ' . sprintf(get_lang('progressBasedOnXVisiblesLPs'), $NbVisibleLps);
851+
}
834852
$html .= '</div>';
835853
} else {
836854
$html .= Display::return_message(get_lang('NoUsersInCourse'), 'warning');

0 commit comments

Comments
 (0)