$tool_content .= "<div class='alert alert-warning'>{$langNoLearningPath}</div>"; draw($tool_content, 2, null, $head_content); exit; } else { $tool_content .= "<div class='alert alert-info'>\n <b>{$langDumpUserDurationToFile}: </b>1. <a href='dumpuserlearnpathdetails.php?course={$course_code}'>{$langcsvenc2}</a>\n 2. <a href='dumpuserlearnpathdetails.php?course={$course_code}&enc=1253'>{$langcsvenc1}</a> \n </div>"; } // display tab header $tool_content .= "\n <table class='table-default'>\n <tr>\n <th class='left'><div align='left'>{$langStudent}</div></th>\n <th width='120'>{$langAm}</th>\n <th>{$langGroup}</th>\n <th colspan='2'>{$langProgress} </th>\n </tr>\n"; // display tab content $k = 0; foreach ($usersList as $user) { // list available learning paths $learningPathList = Database::get()->queryArray("SELECT learnPath_id FROM lp_learnPath WHERE course_id = ?d", $course_id); $iterator = 1; $globalprog = 0; $tool_content .= " <tr>"; foreach ($learningPathList as $learningPath) { // % progress $prog = get_learnPath_progress($learningPath->learnPath_id, $user->id); if ($prog >= 0) { $globalprog += $prog; } $iterator++; } $total = round($globalprog / ($iterator - 1)); $tool_content .= ' <td><a href="detailsUser.php?course=' . $course_code . '&uInfo=' . $user->id . '">' . q($user->surname) . ' ' . q($user->givenname) . '</a></td>' . ' <td class="center">' . q(uid_to_am($user->id)) . '</td>' . ' <td align="center">' . user_groups($course_id, $user->id) . '</td>' . ' <td class="right" width=\'120\'>' . disp_progress_bar($total, 1) . '</td>' . ' <td align="left" width=\'10\'>' . $total . '%</td>' . '</tr>'; $k++; } // foot of table $tool_content .= '</table>'; draw($tool_content, 2, null, $head_content);
$tool_content .= action_bar(array( array('title' => $langBack, 'url' => "index.php", 'icon' => 'fa-reply', 'level' => 'primary-label'))); // display tab header $tool_content .= '' . "\n\n" . ' <div class="table-responsive"><table class="table-default">' . "\n" . ' <tr class="list-header">' . "\n" . ' <th class="text-left">' . $langStudent . '</th>' . "\n" . ' <th width="5px">' . $langProgress . '</th>' . "\n" . ' </tr>' . "\n"; // display tab content foreach ($usersList as $user) { $lpProgress = get_learnPath_progress($path_id, $user->id); $tool_content .= "\n <tr>"; $tool_content .= '' . "\n" . ' <td><a href="detailsUserPath.php?course=' . $course_code . '&uInfo=' . $user->id . '&path_id=' . $path_id . '">' . q($user->surname) . ' ' . q($user->givenname) . '</a></td>' . "\n" . ' <td align="right">' . disp_progress_bar($lpProgress, 1) . '</td>' . "\n" . ' </tr>' . "\n"; } // foot of table $tool_content .= ' ' . "\n\n" . ' </table></div>' . "\n\n"; } draw($tool_content, 2, null, $head_content);
} if ($progress > 0) { $globalProg += $progress; } if ($module['contentType'] != CTLABEL_) { $moduleNb++; // increment number of modules used to compute global progression except if the module is a title } $tool_content .= ' </tr>' . "\n"; } if ($moduleNb == 0) { $tool_content .= ' <tr class="odd">' . "\n" . '<td align="center" colspan="5">' . $langNoModule . '</td>' . "\n" . ' </tr>' . "\n"; } elseif ($moduleNb > 0) { // display global stats $tool_content .= ' <tr class="odd">' . "\n" . ' <th colspan="' . ($maxDeep + 1) . '"> </th>' . "\n" . ' <th align="right">' . (($global_time != "0000:00:00") ? $langTimeInLearnPath : ' ') . '</th>' . "\n" . ' <th align="center">' . (($global_time != "0000:00:00") ? preg_replace("/\.[0-9]{0,2}/", "", $global_time) : ' ') . '</th>' . "\n" . '<th align="right"><small>' . $langGlobalProgress . '</small></th>' . "\n" . '<th align="right">' . disp_progress_bar(round($globalProg / ($moduleNb)), 1) . '</th>' . "\n" . ' </tr>'; } $tool_content .= "\n</table></div>\n"; draw($tool_content, 2, null, $head_content);
} } } } $tool_content .= '</td>' . "\n"; //-- progression if ($module['contentType'] != CTLABEL_) { // display the progress value for current module $tool_content .= '<td align="right" width="120">' . disp_progress_bar($progress, 1) . '</td>' . "\n"; $tool_content .= '<td align="left" width="10"> ' . $progress . '%</td>' . "\n"; } else { // label $tool_content .= ' <td colspan="2"> </td>' . "\n"; } if ($progress > 0) { $globalProg += $progress; } if ($module['contentType'] != CTLABEL_) { $moduleNb++; // increment number of modules used to compute global progression except if the module is a title } $tool_content .= ' </tr>' . "\n"; } if ($moduleNb == 0) { $tool_content .= ' <tr class="odd">' . "\n" . '<td align="center" colspan="7">' . $langNoModule . '</td>' . "\n" . ' </tr>' . "\n"; } elseif ($moduleNb > 0) { // display global stats $tool_content .= ' <tr class="odd">' . "\n" . ' <td colspan="' . ($maxDeep + 1) . '"> </td>' . "\n" . ' <td align="right">' . ($global_time != "0000:00:00" ? $langTimeInLearnPath : ' ') . '</td>' . "\n" . ' <td align="center">' . ($global_time != "0000:00:00" ? preg_replace("/\\.[0-9]{0,2}/", "", $global_time) : ' ') . '</td>' . "\n" . '<td align="right"><small>' . $langGlobalProgress . '</small></td>' . "\n" . '<td align="right">' . disp_progress_bar(round($globalProg / $moduleNb), 1) . '</td>' . "\n" . ' <td align="left"><small> ' . round($globalProg / $moduleNb) . '%</small></td>' . "\n" . ' </tr>'; } $tool_content .= "\n</table>\n"; draw($tool_content, 2, null, $head_content);
foreach ($result as $row) { $user_id = $row->id; if ($type == 'duration') { $value = format_time_duration(0 + $row->duration); $sortkey = $row->duration; $name = $row->surname . ' ' . $row->givenname; $am = $row->am; } elseif ($type == 'lp') { $name = uid_to_name($user_id); $am = uid_to_am($user_id); $iterator = 0; $progress = 0; foreach ($learningPathList as $learningPath) { $progress += get_learnPath_progress($learningPath->learnPath_id, $user_id); $iterator++; } if ($iterator > 0) { $total = round($progress / $iterator); $sortkey = $total; $value = disp_progress_bar($total, 1) . ' <small>' . $total . '%</small>'; } else { $value = '—'; } } $tool_content .= "<td width='30%'>" . q($name) . "</td><td width='30%'>" . q($am) . "</td><td align='text-center'>$group_name</td>" . "<td>$value</td></tr>"; } } $tool_content .= "</table></div>"; draw($tool_content, 2, null, $head_content);
.'<li>'.$langEmail.': '; if( empty($trackedUser['email']) ) $tool_content .= $langNoEmail; else $tool_content .= $trackedUser['email']; $tool_content .= '</li>'."\n" .'</ul>'."\n" .'</p>'."\n"; */ // get list of learning paths of this course // list available learning paths $lpList = Database::get()->queryArray("SELECT name, learnPath_id\n\t\t\t FROM lp_learnPath \n WHERE course_id = ?d\n\t\t ORDER BY `rank`", $course_id); // table header $tool_content .= '<table width="99%" class="tbl_alt">' . "\n" . ' <tr>' . "\n" . ' <th> </th>' . "\n" . ' <th align="left"><div align="left">' . $langLearningPath . '</div></th>' . "\n" . ' <th colspan="2">' . $langProgress . '</th>' . "\n" . ' </tr>' . "\n"; if (count($lpList) == 0) { $tool_content .= ' <tr>' . "\n" . ' <td colspan="3" align="center">' . $langNoLearningPath . '</td>' . "\n" . ' </tr>' . "\n"; } else { // display each learning path with the corresponding progression of the user $k = 0; foreach ($lpList as $lpDetails) { if ($k % 2 == 0) { $tool_content .= " <tr class=\"even\">"; } else { $tool_content .= " <tr class=\"odd\">"; } $lpProgress = get_learnPath_progress($lpDetails->learnPath_id, $_GET['uInfo']); $tool_content .= '' . "\n" . " <td width='1'><img src='{$themeimg}/arrow.png' alt='' /></td>\n" . ' <td><a href="detailsUserPath.php?course=' . $course_code . '&uInfo=' . $_GET['uInfo'] . '&path_id=' . $lpDetails->learnPath_id . '">' . htmlspecialchars($lpDetails->name) . '</a></td>' . "\n" . ' <td align="right" width="120">' . "" . disp_progress_bar($lpProgress, 1) . '</td>' . "\n" . ' <td align="left" width="10">' . $lpProgress . '%</td>' . "\n" . ' </tr>' . "\n"; $k++; } } $tool_content .= ' </table>' . "\n"; draw($tool_content, 2, null, $head_content);
$tool_content .= ' <tr class="even">' . "\n" . ' <td>' . $langTotalTimeSpent . '</td>' . "\n" . ' ' . "\n" . ' <td align="right">' . $resultBrowsed->total_time . '</td>' . "\n" . ' </tr>' . "\n\n"; //display time passed in last session $tool_content .= ' <tr class="even">' . "\n" . ' <td>' . $langLastSessionTimeSpent . '</td>' . "\n" . ' ' . "\n" . ' <td align="right">' . $resultBrowsed->session_time . '</td>' . "\n" . ' </tr>' . "\n\n"; //display user best score if ($resultBrowsed->scoreMax > 0) { $raw = round($resultBrowsed->raw / $resultBrowsed->scoreMax * 100); } else { $raw = 0; } $raw = max($raw, 0); if ($resultBrowsed->contentType == CTSCORM_ && $resultBrowsed->scoreMax <= 0 && ($resultBrowsed->lesson_status == "COMPLETED" || $resultBrowsed->lesson_status == "PASSED" || $resultBrowsed->raw != -1)) { $raw = 100; } // no sens to display a score in case of a document module if ($resultBrowsed->contentType != CTDOCUMENT_ && $resultBrowsed->contentType != CTLINK_ && $resultBrowsed->contentType != CTCOURSE_DESCRIPTION_ && $resultBrowsed->contentType != CTMEDIA_ && $resultBrowsed->contentType != CTMEDIALINK_) { $tool_content .= '<tr>' . "\n" . ' <td>' . $langYourBestScore . '</td>' . "\n" . ' ' . "\n" . ' <td>' . disp_progress_bar($raw, 1) . ' ' . $raw . '%</td>' . "\n" . ' </tr>' . "\n\n"; } //display lesson status // display a human readable string ... if ($resultBrowsed->lesson_status == "NOT ATTEMPTED") { $statusToDisplay = $langNotAttempted; } else { if ($resultBrowsed->lesson_status == "PASSED") { $statusToDisplay = $langPassed; } else { if ($resultBrowsed->lesson_status == "FAILED") { $statusToDisplay = $langFailed; } else { if ($resultBrowsed->lesson_status == "COMPLETED") { $statusToDisplay = $langAlreadyBrowsed; } else {
} // DISPLAY ADMIN LINK----------------------------------------------------------- if ($is_editor) { // 5 administration columns // LOCK link $is_real_dir = is_dir(realpath($webDir . "/courses/" . $course_code . "/scormPackages/path_" . $list->learnPath_id)); $tool_content .= " <td class='option-btn-cell'>" . action_button(array(array('title' => $langBlock, 'url' => $_SERVER['SCRIPT_NAME'] . "?course={$course_code}&cmd=mkBlock&cmdid=" . $list->learnPath_id, 'icon' => 'fa-unlock', 'show' => $list->lock == 'OPEN'), array('title' => $langAltMakeNotBlocking, 'url' => $_SERVER['SCRIPT_NAME'] . "?course={$course_code}&cmd=mkUnblock&cmdid=" . $list->learnPath_id, 'icon' => 'fa-lock', 'level' => 'primary', 'show' => !($list->lock == 'OPEN')), array('title' => $langTracking, 'url' => "details.php?course={$course_code}&path_id=" . $list->learnPath_id, 'icon' => 'fa-search'), array('title' => $langVisible, 'url' => $_SERVER['SCRIPT_NAME'] . "?course={$course_code}&cmd=mkVisibl&visibility_path_id=" . $list->learnPath_id, 'icon' => 'fa-eye-slash', 'show' => $list->visible == 0), array('title' => $langVisible, 'url' => $_SERVER['SCRIPT_NAME'] . "?course={$course_code}&cmd=mkInvisibl&visibility_path_id=" . $list->learnPath_id, 'icon' => 'fa-plus-circle', 'confirm' => $list->lock == 'CLOSE' ? $langAlertBlockingPathMadeInvisible : null, 'confirm_title' => "", 'confirm_button' => $langAccept, 'show' => $list->visible != 0), array('title' => $langModify, 'url' => "learningPathAdmin.php?course={$course_code}&path_id=" . $list->learnPath_id, 'icon' => 'fa-edit'), array('title' => $langDelete, 'url' => $_SERVER['SCRIPT_NAME'] . "?course={$course_code}&cmd=delete&del_path_id=" . $list->learnPath_id, 'icon' => 'fa-times', 'class' => 'delete', 'confirm' => $is_real_dir ? $langAreYouSureToDeleteScorm + " '" . $list->name . "'" : $langDelete), array('title' => $langUp, 'level' => 'primary', 'url' => $_SERVER['SCRIPT_NAME'] . "?course={$course_code}&cmd=moveUp&move_path_id=" . $list->learnPath_id, 'icon' => 'fa-arrow-up', 'disabled' => $iterator == 1), array('title' => $langDown, 'level' => 'primary', 'url' => $_SERVER['SCRIPT_NAME'] . "?course={$course_code}&cmd=moveDown&move_path_id=" . $list->learnPath_id, 'icon' => 'fa-arrow-down', 'disabled' => $iterator >= $LPNumber), array('title' => $langExport2004, 'url' => $_SERVER['SCRIPT_NAME'] . '?course=' . $course_code . '&cmd=export&path_id=' . $list->learnPath_id, 'icon' => 'fa-download'), array('title' => $langExport12, 'url' => $_SERVER['SCRIPT_NAME'] . '?course=' . $course_code . '&cmd=export12&path_id=' . $list->learnPath_id, 'icon' => 'fa-download'), array('title' => $langExportIMSCP, 'url' => $_SERVER['SCRIPT_NAME'] . '?course=' . $course_code . '&cmd=exportIMSCP&path_id=' . $list->learnPath_id, 'icon' => 'fa-download'))) . "</td>\n"; } elseif ($uid) { // % progress $prog = get_learnPath_progress($list->learnPath_id, $uid); if (!isset($globalprog)) { $globalprog = 0; } if ($prog >= 0) { $globalprog += $prog; } $tool_content .= "<td class='text-right' width='120'>" . disp_progress_bar($prog, 1) . "</td>\n"; $tool_content .= "<td class='text-left' width='10'>" . $prog . "% </td>"; } $tool_content .= "</tr>\n"; $iterator++; $ind++; } // end while if (!$is_editor && $iterator != 1 && $uid) { // add a blank line between module progression and global progression $total = round($globalprog / ($iterator - 1)); $tool_content .= "\n <tr>\n <th colspan='2'><div align='right'><b>{$langPathsInCourseProg}</b>:</div></th>\n <th><div align='right'>" . disp_progress_bar($total, 1) . "</div></th>\n <th><div align='left'>{$total}%</div></th>\n </tr>\n"; } $tool_content .= "\n </table></div>\n"; draw($tool_content, 2, null, $head_content);
} $path_id = intval($_REQUEST['path_id']); // get infos about the learningPath $learnPathName = Database::get()->querySingle("SELECT `name` FROM `lp_learnPath` WHERE `learnPath_id` = ?d AND `course_id` = ?d", $path_id, $course_id); if ($learnPathName) { // display title $titleTab['subTitle'] = htmlspecialchars($learnPathName->name); // display a list of user and their respective progress $sql = "SELECT U.`surname`, U.`givenname`, U.`id`\n\t\tFROM `user` AS U,\n\t\t `course_user` AS CU\n\t\tWHERE U.`id` = CU.`user_id`\n\t\tAND CU.`course_id` = {$course_id}\n\t\tORDER BY U.`surname` ASC, U.`givenname` ASC"; @($tool_content .= get_limited_page_links($sql, 30, $langPreviousPage, $langNextPage)); $usersList = get_limited_list($sql, 30); // display tab header $tool_content .= '' . "\n\n" . ' <p>' . $langLearnPath . ': <b>'; $tool_content .= disp_tool_title($titleTab); $tool_content .= '</b></p>' . "\n" . ' <table width="99%" class="tbl_alt">' . "\n" . ' <tr>' . "\n" . ' <th> </th>' . "\n" . ' <th><div align="left">' . $langStudent . '</div></th>' . "\n" . ' <th colspan="2" width="25%">' . $langProgress . '</th>' . "\n" . ' </tr>' . "\n"; // display tab content $k = 0; foreach ($usersList as $user) { $lpProgress = get_learnPath_progress($path_id, $user->id); if ($k % 2 == 0) { $tool_content .= "\n <tr class=\"even\">"; } else { $tool_content .= "\n <tr class=\"odd\">"; } $tool_content .= '' . "\n" . ' <td width="1"><img src="' . $themeimg . '/arrow.png" alt="bullet" title="bullet" border="0"></td>' . "\n" . ' <td><a href="detailsUserPath.php?course=' . $course_code . '&uInfo=' . $user->id . '&path_id=' . $path_id . '">' . q($user->surname) . ' ' . q($user->givenname) . '</a></td>' . "\n" . ' <td align="right">' . disp_progress_bar($lpProgress, 1) . '</td>' . "\n" . ' <td align="left"><small>' . $lpProgress . '%</small></td>' . "\n" . ' </tr>' . "\n"; $k++; } // foot of table $tool_content .= ' ' . "\n\n" . ' </table>' . "\n\n"; } draw($tool_content, 2, null, $head_content);
if ($uid && $module['contentType'] != CTLABEL_) { // display actions for current module (taking into consideration blocked modules) if (!$is_blocked || !$first_blocked) { $tool_content .= "<td width='18'><a href=\"module.php?course={$course_code}&module_id=" . $module['module_id'] . "\">" . icon('fa-line-chart', $langTracking) . "</a></td>"; } else { $tool_content .= "<td></td>"; } if ($is_blocked) { $first_blocked = true; } // display the progress value for current module $tool_content .= '<td align="right" width="120">' . disp_progress_bar($progress, 1) . '</td>' . "\n" . ' <td align="left" width="10">' . ' ' . $progress . '%' . '</td>' . "\n"; } elseif ($uid && $module['contentType'] == CTLABEL_) { $tool_content .= '<td colspan="2"> </td>' . "\n"; } if ($progress > 0) { $globalProg = $globalProg + $progress; } if ($module['contentType'] != CTLABEL_) { $moduleNb++; // increment number of modules used to compute global progression except if the module is a title } $tool_content .= "</tr>"; $ind++; } if ($uid && $moduleNb > 0) { // add a blank line between module progression and global progression $tool_content .= '<tr class="odd">' . "\n" . '<th colspan="' . ($maxDeep + 2) . '" align="right"><div align="right">' . $langGlobalProgress . '</div></th>' . "\n" . '<th align="right" width="120"><div align="right">' . disp_progress_bar(round($globalProg / $moduleNb), 1) . '</div></th>' . "\n" . '<th align="left" width="10"><div class="center">' . ' ' . round($globalProg / $moduleNb) . '%' . '</div></th>' . "\n" . '</tr>' . ""; } $tool_content .= "</table>"; draw($tool_content, 2);
$globalprog += $prog; } $tool_content .= "<td class='text-right' width='120'>" . disp_progress_bar($prog, 1) . "</td>"; } $tool_content .= "</tr>\n"; $iterator++; $ind++; } // end while if (!$is_editor && $iterator != 1 && $uid) { // add a blank line between module progression and global progression $total = round($globalprog / ($iterator - 1)); $tool_content .= " <tr> <th><div align='right'><b>$langPathsInCourseProg</b>:</div></th> <th><div align='right'>" . disp_progress_bar($total, 1) . "</div></th> </tr>\n"; } $tool_content .= "\n </table></div>\n"; $tool_content .= "<div class='modal fade' id='restrictlp' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'> <div class='modal-dialog'> <div class='modal-content'> <div class='modal-body'>". $langRestrictedLPath ."</div> <div class='modal-footer'> <button type='button' class='btn btn-default' data-dismiss='modal'>Close</button> </div> </div> </div> </div>";
// list available learning paths $learningPathList = Database::get()->queryArray("SELECT learnPath_id FROM lp_learnPath WHERE course_id = ?d", $course_id); $iterator = 1; $globalprog = 0; $tool_content .= " <tr>"; foreach ($learningPathList as $learningPath) { // % progress $prog = get_learnPath_progress($learningPath->learnPath_id, $user->id); if ($prog >= 0) { $globalprog += $prog; } $iterator++; } $total = round($globalprog / ($iterator - 1)); $tool_content .= ' <td><a href="detailsUser.php?course=' . $course_code . '&uInfo=' . $user->id . '&uName=' . $user->givenname . '">' . profile_image($user->id, IMAGESIZE_SMALL, 'img-circle')." ". q($user->surname) . ' ' . q($user->givenname) . '</a></td>' . ' <td class="text-center">' . q(uid_to_am($user->id)) . '</td>' . ' <td class="text-left">' . user_groups($course_id, $user->id) . '</td>' . ' <td class="text-right" width=\'120\'>' . disp_progress_bar($total, 1) . '</td>' . '</tr>'; $k++; } // foot of table $tool_content .= '</table></div>'; draw($tool_content, 2, null, $head_content);