* the URL, and it guarantees than it will be received by the * server. The reason of this trick, is because, sometimes, * when file upload fails, no form data are received at all by * the server. For example when the size of the sent file is so * huge that its reception exceeds the max execution time * allowed for the script. When no 'cmd' argument are sent it is * impossible to manage this error gracefully. That's why, * exceptionally, we pass 'cmd' in the 'action' attribute of * the form. */ $dialogBox->title(get_lang('Upload file')); $agreementText = claro_text_zone::get_content('textzone_upload_file_disclaimer'); if (!empty($agreementText)) { $dialogBox->info($agreementText); } $form = '<form action="' . claro_htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post" enctype="multipart/form-data">' . '<fieldset>' . claro_form_relay_context() . '<input type="hidden" name="claroFormId" value="' . uniqid('') . '" />' . "\n" . '<input type="hidden" name="cmd" value="exUpload" />' . "\n" . '<input type="hidden" name="cwd" value="' . claro_htmlspecialchars($cwd) . '" />' . "\n" . '<dl>' . '<dt><label for="userFile">' . get_lang('File') . ' <span class="required">*</span></label>' . '</dt>' . "\n" . '<dd>' . '<input type="file" id="userFile" name="userFile" />' . "\n" . '<p class="notice">' . get_lang("Max file size") . ' : ' . format_file_size($maxUploadSize) . '</p>' . "\n" . '</dd>' . '<dt>' . get_lang("Disk space available") . '</dt>' . '<dd>' . claro_html_progress_bar($spaceAlreadyOccupied / $maxFilledSpace * 100, 1) . ' <span class="notice">' . format_file_size($remainingDiskSpace) . '</span>' . '</dd>' . "\n"; if ($is_allowedToUnzip) { // uncompress $form .= '<dt>' . "\n" . '<label for="uncompress"><img src="' . get_icon_url('mime/package-x-generic') . '" alt="" /> ' . get_lang('uncompress zipped (.zip) file on the server') . '</label>' . "\n" . '</dt>' . '<dd>' . '<input type="checkbox" id="uncompress" name="uncompress" value="1" />' . '</dd>' . "\n"; } if ($courseContext) { if (!isset($oldComment)) { $oldComment = ""; } // comment $form .= '<dt>' . "\n" . '<label for="comment">' . get_lang('Comment') . '</label>' . '</dt>' . "\n" . '<dd>' . '<textarea rows=2 cols=50 id="comment" name="comment">' . claro_htmlspecialchars($oldComment) . '</textarea>' . "\n" . '</dd>' . "\n"; } $form .= '</dl>' . '</fieldset>' . '<p><span class="required">*</span> ' . get_lang('Denotes required fields') . '</p>' . "\n" . '<input type="submit" value="' . get_lang('Ok') . '" /> ' . claro_html_button(claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=exChDir&file=' . base64_encode($cwd))), get_lang('Cancel')) . '</form>'; $dialogBox->form($form); } }
$out .= '<tr>' . "\n" . '<td>' . get_lang('Total time') . '</td>' . "\n" . '<td>' . $resultBrowsed['total_time'] . '</td>' . "\n" . '</tr>' . "\n\n"; //display time passed in last session $out .= '<tr>' . "\n" . '<td>' . get_lang('Last session time') . '</td>' . "\n" . '<td>' . $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_) { $out .= '<tr>' . "\n" . '<td>' . get_lang('Your best performance') . '</td>' . "\n" . '<td>' . claro_html_progress_bar($raw, 1) . ' ' . $raw . '%</td>' . "\n" . '</tr>' . "\n\n"; } //display lesson status // document are just browsed or not, but not completed or passed... if ($resultBrowsed['contentType'] == CTDOCUMENT_) { if ($resultBrowsed['lesson_status'] == "COMPLETED") { $statusToDisplay = get_lang('Already browsed'); } else { $statusToDisplay = get_lang('Never browsed'); } } else { $statusToDisplay = $resultBrowsed['lesson_status']; } $out .= '<tr>' . "\n" . '<td>' . get_lang('Module status') . '</td>' . "\n" . '<td>' . $statusToDisplay . '</td>' . "\n" . '</tr>' . "\n\n" . '</tbody>' . "\n\n" . '</table>' . "\n\n"; } //end display stats
// display tab header $out .= '<table class="claroTable emphaseLine" width="100%" border="0" cellspacing="2">' . "\n\n" . '<tr class="headerX" align="center" valign="top">' . "\n" . '<th>' . get_lang('Student') . '</th>' . "\n" . '<th colspan="2">' . get_lang('Progress') . '</th>' . "\n" . '</tr>' . "\n\n" . '<tbody>' . "\n\n"; // display tab content foreach ($usersList as $user) { // list available learning paths $sql = "SELECT LP.`learnPath_id`\n FROM `" . $tbl_lp_learnPath . "` AS LP"; $learningPathList = claro_sql_query_fetch_all($sql); $iterator = 1; $globalprog = 0; foreach ($learningPathList as $learningPath) { // % progress $prog = get_learnPath_progress($learningPath['learnPath_id'], $user['user_id']); if ($prog >= 0) { $globalprog += $prog; } $iterator++; } if ($iterator == 1) { $out .= '<tr><td align="center" colspan="8">' . get_lang('No learning path') . '</td></tr>' . "\n\n"; } else { $total = round($globalprog / ($iterator - 1)); $out .= '<tr>' . "\n" . '<td><a href="' . get_path('clarolineRepositoryWeb') . 'tracking/userReport.php?userId=' . $user['user_id'] . '">' . $user['nom'] . ' ' . $user['prenom'] . '</a></td>' . "\n" . '<td align="right">' . claro_html_progress_bar($total, 1) . '</td>' . "\n" . '<td align="left"><small>' . $total . '%</small></td>' . "\n" . '</tr>' . "\n\n"; } } // foot of table $out .= '</tbody>' . "\n\n" . '</table>' . "\n\n"; } else { $out .= get_lang('Tracking has been disabled by system administrator.'); } $claroline->display->body->appendContent($out); echo $claroline->display->render();
$globalProg += $progress; } if ($module['contentType'] != CTLABEL_) { $moduleNb++; } // increment number of modules used to compute global progression except if the module is a title $out .= '</tr>' . "\n\n"; } $out .= '</tbody>' . "\n" . '<tfoot>' . "\n"; if ($moduleNb == 0) { $out .= '<tr><td align="center" colspan="6">' . get_lang('No module') . '</td></tr>'; } elseif ($moduleNb > 0) { // add a blank line between module progression and global progression $out .= '<tr><td colspan="' . ($maxDeep + 6) . '"> </td></tr>' . "\n"; // display global stats $out .= '<tr>' . "\n" . '<small>' . "\n" . '<td colspan="' . ($maxDeep + 1) . '"> </td>' . "\n" . '<td align="right">' . ($global_time != "0000:00:00" ? get_lang('Time in learning path') : ' ') . '</td>' . "\n" . '<td align="center">' . ($global_time != "0000:00:00" ? preg_replace("/\\.[0-9]{0,2}/", "", $global_time) : ' ') . '</td>' . "\n" . '<td align="right">' . get_lang('Learning path progression : ') . '</td>' . "\n" . '<td align="right">' . claro_html_progress_bar(round($globalProg / $moduleNb), 1) . '</td>' . "\n" . '<td align="left"><small> ' . round($globalProg / $moduleNb) . '%</small></td>' . "\n" . '</tr>'; } $out .= "\n" . '</tfoot>' . "\n" . '</table>' . "\n"; } else { if (!get_conf('is_trackingEnabled')) { $out .= get_lang('Tracking has been disabled by system administrator.'); } else { $out .= get_lang('Not allowed'); } } $claroline->display->body->appendContent($out); echo $claroline->display->render(); //********************************** function isAnwsersViewingSupported($moduleType = '') { $supportedTypes = array(CTSCORM_);
} elseif (claro_is_user_authenticated() && $module['contentType'] == CTLABEL_) { $out .= '<td colspan="2"> </td>' . "\n"; } //-- reset link for current module if (claro_is_user_authenticated() && (get_conf('cllnp_resetByUserAllowed', false) || claro_is_allowed_to_edit())) { if (getModuleProgression(claro_get_current_user_id(), $_SESSION['path_id'], $module['learnPath_module_id'])) { $out .= '<td><a href="' . Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=resetModuleProgression&learnPath_module_id=' . $module['learnPath_module_id'] . '&path_id=' . $_SESSION['path_id']) . '" onclick="return confirm(\'' . clean_str_for_javascript(get_lang('Do you really want to reset module ') . $module['name']) . '?\');"><img src="' . get_icon_url('delete') . '" alt="' . get_lang('Reset') . '" /></a></td>' . "\n"; } else { $out .= '<td>' . get_lang('No results available') . '</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 $out .= '</tr>' . "\n\n"; $atleastOne = true; } $out .= '</tbody>' . "\n\n"; if ($atleastOne == false) { $out .= '<tfoot>' . "\n\n" . '<tr>' . "\n" . '<td align="center" colspan="3">' . get_lang('No module') . '</td>' . "\n" . '</tr>' . "\n\n" . '</tfoot>' . "\n\n"; } elseif (claro_is_user_authenticated() && $moduleNb > 0) { // add a blank line between module progression and global progression $out .= '<tfoot>' . "\n\n" . '<tr>' . "\n" . '<td colspan="' . ($maxDeep + 3) . '"> </td>' . "\n" . '</tr>' . "\n\n" . '<tr>' . "\n" . '<td align="right" colspan="' . ($maxDeep + 1) . '">' . get_lang('Learning path progression :') . '</td>' . "\n" . '<td align="right">' . claro_html_progress_bar(round($globalProg / $moduleNb), 1) . '</td>' . "\n" . '<td align="left">' . '<small> ' . round($globalProg / $moduleNb) . '%</small>' . '</td>' . "\n" . '</tr>' . "\n\n" . '</tfoot>' . "\n\n"; } $out .= '</table>' . "\n\n"; $claroline->display->body->appendContent($out); echo $claroline->display->render();
/** * Display a 4 column array * Columns are : hour of day, graph, number of hits and % * First line are titles * next are informations * Last is total number of hits * * @param period_array : an array provided by hoursTab($sql) or daysTab($sql) * @param periodTitle : title of the first column, type of period * @param linkOnPeriod : * * @return * */ function makeHitsTable($period_array, $periodTitle, $linkOnPeriod = "???") { $out = ''; $out .= '<table class="claroTable emphaseLine" width="100%" cellpadding="0" cellspacing="1" align="center">' . "\n"; // titles $out .= '<tr class="headerX">' . "\n" . '<th width="15%">' . $periodTitle . '</th>' . "\n" . '<th width="60%"> </th>' . "\n" . '<th width="10%">' . get_lang('Hits') . '</th>' . "\n" . '<th width="15%"> % </th>' . "\n" . '</tr>' . "\n\n" . '<tbody>' . "\n\n"; $factor = 4; $maxSize = $factor * 100; //pixels while (list($periodPiece, $cpt) = each($period_array)) { if ($periodPiece !== 'total') { if ($period_array['total'] == 0) { $pourcent = 0; } else { $pourcent = round(100 * $cpt / $period_array['total']); } $out .= '<tr>' . "\n" . '<td align="center" width="15%">' . $periodPiece . '</td>' . "\n" . '<td width="60%" align="center">' . claro_html_progress_bar($pourcent, 4) . '</td>' . "\n" . '<td align="center" width="10%">' . $cpt . '</td>' . "\n" . '<td align="center" width="15%">' . $pourcent . ' %</td>' . "\n" . '</tr>' . "\n\n"; } } // footer $out .= '</tbody>' . "\n\n" . '<tfoot>' . "\n" . '<tr>' . "\n" . '<td width="15%" align="center">' . get_lang('Total') . '</td>' . "\n" . '<td align="right" width="60%"> </td>' . "\n" . '<td align="center" width="10%">' . $period_array['total'] . '</td>' . "\n" . '<td width="15%"> </td>' . "\n" . '</tr>' . "\n" . '</tfoot>' . "\n\n" . '</table>' . "\n\n"; return $out; }
$out .= '<td>' . "\n" . '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=export&path_id=' . $list['learnPath_id'])) . '" >' . '<img src="' . get_icon_url('export') . '" alt="' . get_lang('Export') . '" />' . '</a>' . "\n" . '</td>' . "\n"; if (get_conf('is_trackingEnabled')) { // statistics links $out .= '<td>' . "\n" . '<a href="' . claro_htmlspecialchars(Url::Contextualize(get_path('clarolineRepositoryWeb') . 'tracking/learnPath_details.php?path_id=' . $list['learnPath_id'])) . '">' . "\n" . '<img src="' . get_icon_url('statistics') . '" alt="' . get_lang('Tracking') . '" />' . '</a>' . "\n" . '</td>' . "\n"; } } elseif ($lpUid) { // % progress $prog = get_learnPath_progress($list['learnPath_id'], $lpUid); if (!isset($globalprog)) { $globalprog = 0; } if ($prog >= 0) { $globalprog += $prog; } $out .= '<td align="right">' . claro_html_progress_bar($prog, 1) . '</td>' . "\n" . '<td align="left">' . '<small>' . $prog . '% </small>' . '</td>'; } $out .= '</tr>' . "\n"; $iterator++; } // end while $out .= '</tbody>' . "\n" . '<tfoot>'; if ($iterator == 1) { $out .= '<tr>' . "\n" . '<td align="center" colspan="8">' . "\n" . get_lang('No learning path') . '</td>' . "\n" . '</tr>'; } elseif (!claro_is_allowed_to_edit() && $iterator != 1 && $lpUid) { // add a blank line between module progression and global progression $total = round($globalprog / ($iterator - 1)); $out .= '<tr>' . "\n" . '<td colspan="3">' . "\n" . ' ' . "\n" . '</td>' . "\n" . '</tr>' . "\n" . '<tr>' . "\n" . '<td align ="right">' . "\n" . get_lang('Course progression') . "\n" . ' :' . "\n" . '</td>' . "\n" . '<td align="right" >' . "\n" . claro_html_progress_bar($total, 1) . '</td>' . "\n" . '<td align="left">' . "\n" . '<small>' . $total . '%' . "\n" . '</small>' . "\n" . '</td>' . "\n" . '</tr>' . "\n"; } $out .= '</tfoot>' . "\n" . '</table>' . "\n"; $claroline->display->body->appendContent($out); echo $claroline->display->render();
function getLearnpathProgressStudentRow($path_id, $user) { if (!isLearnPathProgressionEmpty($user['user_id'], $path_id)) { $groupBy = empty($_GET['groupBy']) ? '' : $_GET['groupBy']; $resetCell = '<td align="center"><a href="' . Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=resetLearnPath&path_id=' . (int) $path_id . '&user_id=' . (int) $user['user_id'] . '&groupBy=' . $groupBy) . '" onclick="return confirm(\'' . clean_str_for_javascript(get_lang('Do you really want to reset the learning path of ') . $user['prenom'] . ' ' . $user['nom']) . '?\');"><img src="' . get_icon_url('delete') . '" alt="' . get_lang('Reset') . '" /></a></td>' . "\n"; } else { $resetCell = '<td align="center">' . get_lang('No results available') . '</td>' . "\n"; } $lpProgress = get_learnPath_progress($path_id, $user['user_id']); $out = '<tr>' . "\n" . '<td><a href="lp_modules_details.php?uInfo=' . $user['user_id'] . '&path_id=' . $path_id . '">' . $user['nom'] . ' ' . $user['prenom'] . '</a></td>' . "\n" . '<td align="right">' . claro_html_progress_bar($lpProgress, 1) . '</td>' . "\n" . '<td align="left"><small>' . $lpProgress . '%</small></td>' . "\n" . $resetCell . '</tr>' . "\n\n"; return $out; }
$class = ' class="correct" '; } else { $class = ''; } $out .= '<tr >' . '<td ' . $class . '>'; if (empty($result['answer'])) { $out .= '(' . get_lang('Empty') . ')'; } else { $out .= $result['answer']; } if ($result['nbr'] == 0) { $pourcent = 0; } else { $pourcent = round(100 * $result['nbr'] / $fillInBlanksTotal[$i]); } $out .= '</td>' . "\n" . '<td align="right">' . claro_html_progress_bar($pourcent, 1) . '</td>' . "\n" . '<td align="left"><small>' . $result['nbr'] . ' ( ' . $pourcent . '% )</small></td>' . "\n" . '</tr>'; } } else { $out .= '<tr >' . '<td colspan="2" align="center">' . get_lang('No result') . '</td>' . "\n" . '</tr>'; } $out .= '</table>' . "\n\n" . '<br />' . "\n\n"; $i++; } } elseif ($question->getType() == 'MATCHING') { // for each left proposal display the number of time each right proposal has been choosen $out .= '<table class="claroTable emphaseLine" border="0" cellspacing="2">' . "\n" . '<tr class="headerX">' . "\n" . '<td> </td>' . "\n"; // these two values are used for numbering of columns and lines $letter = 'A'; $number = 1; // display top headers for ($i = 1; $i <= $nbrColumn; $i++) {