|
16 | 16 | require_once '../exercice/exercise.lib.php'; |
17 | 17 |
|
18 | 18 | $course_code = api_get_course_id(); |
| 19 | +$user_id = api_get_user_id(); |
| 20 | +// Declare variables to be used in lp_stats.php. |
| 21 | +$lp_id = $_SESSION['oLP']->get_id(); |
| 22 | +$list = $_SESSION['oLP']->get_flat_ordered_items_list($lp_id); |
19 | 23 |
|
20 | 24 | $is_allowed_to_edit = api_is_allowed_to_edit(null, true); |
21 | 25 |
|
|
292 | 296 |
|
293 | 297 | $my_lesson_status = get_lang($mylanglist[$lesson_status]); |
294 | 298 |
|
295 | | - if ($row['item_type'] != 'dokeos_chapter') { |
| 299 | + if ($row['item_type'] != 'dokeos_chapter') { |
296 | 300 | if (!$is_allowed_to_edit && $result_disabled_ext_all) { |
297 | 301 | $view_score = Display::return_icon('invisible.gif', get_lang('ResultsHiddenByExerciseSetting')); |
298 | | - } else { |
299 | | - //$view_score = ($score == 0 ? '/' : ($maxscore === 0 ? $score : $score . '/' . float_format($maxscore, 1))); |
300 | | - if ($row['item_type'] == 'sco') { |
301 | | - if ($maxscore == 0 ) { |
302 | | - $view_score = $score; |
303 | | - } else { |
| 302 | + } else { |
| 303 | + switch ($row['item_type']) { |
| 304 | + case 'sco': |
| 305 | + if ($maxscore == 0 ) { |
| 306 | + $view_score = $score; |
| 307 | + } else { |
| 308 | + $view_score = show_score($score, $maxscore, false); |
| 309 | + } |
| 310 | + break; |
| 311 | + case 'document': |
| 312 | + $view_score = ($score == 0 ? '/' : show_score($score, $maxscore, false)); |
| 313 | + break; |
| 314 | + default: |
304 | 315 | $view_score = show_score($score, $maxscore, false); |
305 | | - } |
306 | | - } else { |
307 | | - $view_score = show_score($score, $maxscore, false); |
308 | | - } |
| 316 | + break; |
| 317 | + } |
309 | 318 | } |
310 | | - $output .= "<tr class='$oddclass'>" . "<td></td>" . "<td>$extend_attempt_link</td>" . '<td colspan="3">' . get_lang('Attempt') . ' ' . $row['iv_view_count'] . "</td>" |
311 | | - . '<td colspan="2">' . Display::label($my_lesson_status, $class_status) . "</td>\n" . '<td colspan="2"><div class="mystatus" align="center">' . $view_score . "</div></td>" . '<td colspan="2"><div class="mystatus">'.$time.'</div></td><td></td></tr>'; |
| 319 | + $output .= '<tr class="'.$oddclass.'"> |
| 320 | + <td></td> |
| 321 | + <td>'.$extend_attempt_link.'</td> |
| 322 | + <td colspan="3">'.get_lang('Attempt').' '.$row['iv_view_count'].'</td> |
| 323 | + <td colspan="2">'.Display::label($my_lesson_status, $class_status).'</td> |
| 324 | + <td colspan="2"><div class="mystatus" align="center">'.$view_score.'</div></td> |
| 325 | + <td colspan="2"><div class="mystatus">'.$time.'</div></td> |
| 326 | + <td></td> |
| 327 | + </tr>'; |
312 | 328 |
|
313 | 329 | if (!empty($export_csv)) { |
314 | 330 | $temp = array (); |
|
0 commit comments