From 5afe49d841961b019b1acfa004136ffdfab0550e Mon Sep 17 00:00:00 2001 From: Isaac Flores Date: Fri, 9 Oct 2009 14:16:24 -0500 Subject: [PATCH] added sortable --- main/exercice/exercice.php | 134 ++++++++++++++++++++++++++----------- 1 file changed, 94 insertions(+), 40 deletions(-) diff --git a/main/exercice/exercice.php b/main/exercice/exercice.php index 0ac4010a75..da8df526cc 100755 --- a/main/exercice/exercice.php +++ b/main/exercice/exercice.php @@ -1109,7 +1109,7 @@ if ($show == 'test') { // if tracking is enabled if ($_configuration['tracking_enabled'] && ($show == 'result')) { ?> - + '; + //echo ''; $add_start_date = $lang_nostartdate; if ($is_allowedToEdit || $is_tutor) { $user = $results[$i][0]; - echo ''; + //echo ''; } - echo ''; - echo ''; + //echo ''; - echo ''; //get_lang('dateTimeFormatLong') - + //echo ''; + //echo ''; //get_lang('dateTimeFormatLong') + $date_list = $add_start_date . format_locale_date('%b %d, %Y %H:%M', $results[$i][4]); // there are already a duration test period calculated?? //echo ''; @@ -1259,8 +1269,8 @@ if ($_configuration['tracking_enabled'] && ($show == 'result')) { $my_res = float_format($results[$i][2],1); $my_total = float_format($results[$i][3],1); - echo ''; - + //echo ''; + $result_list = round(($my_res / ($my_total != 0 ? $my_total : 1)) * 100, 2) . '% (' . $my_res . ' / ' . $my_total . ')'; // Is hard to read this!! /* echo ''; */ - echo ''; + //$list_info [] = array($user_list_name,$quiz_name_list,$duration_list,$date_list,$result_list,$more_details_list); + //echo ''; - echo ''; + //echo ''; } } +//////////////////////////////////////////////////////////////////////////////// + +//Code added by Isaac flores +$parameters=array('cidReq'=>Security::remove_XSS($_GET['cidReq']),'show'=>Security::remove_XSS($_GET['show']),'filter' => Security::remove_XSS($_GET['filter']),'gradebook' =>Security::remove_XSS($_GET['gradebook'])); + + +$table = new SortableTableFromArrayConfig($list_info, 1,20,'quiz_table'); +$table->set_additional_parameters($parameters); +if ($is_allowedToEdit || $is_tutor) { + $table->set_header(0, get_lang('User')); + $secuence = 0; +} else { + $secuence = 1; +} +$table->set_header(-$secuence + 1, get_lang('Exercice')); +$table->set_header(-$secuence + 2, get_lang('Duration'),false); +$table->set_header(-$secuence + 3, get_lang('Date'),false); +$table->set_header(-$secuence + 4, get_lang('Result'),false); +$table->set_header(-$secuence + 5, (($is_allowedToEdit||$is_tutor) ? get_lang("CorrectTest") : get_lang("ViewTest")), false); +$table->display(); + +////////////////////////////////////////////////////////////////////////////////// } else { $NoTestRes = 1; }
' . $user . ' ' . $user . ' ' . $test . ''; + //echo '' . $test . ''; if ($results[$i][7] > 1) { - echo ceil((($results[$i][4] - $results[$i][7]) / 60)) . ' ' . get_lang('MinMinutes'); + //echo ceil((($results[$i][4] - $results[$i][7]) / 60)) . ' ' . get_lang('MinMinutes'); + $duration_list = ceil((($results[$i][4] - $results[$i][7]) / 60)) . ' ' . get_lang('MinMinutes'); if ($results[$i][8] > 1) { - echo ' ( ' . $results[$i][8] . ' ' . get_lang('Steps') . ' )'; + //echo ' ( ' . $results[$i][8] . ' ' . get_lang('Steps') . ' )'; + $duration_list = ' ( ' . $results[$i][8] . ' ' . get_lang('Steps') . ' )'; } $add_start_date = format_locale_date('%b %d, %Y %H:%M', $results[$i][7]) . ' / '; } else { - echo get_lang('NoLogOfDuration'); + $duration_list = get_lang('NoLogOfDuration'); + //echo get_lang('NoLogOfDuration'); } - echo '' . $add_start_date . format_locale_date('%b %d, %Y %H:%M', $results[$i][4]) . '' . $add_start_date . format_locale_date('%b %d, %Y %H:%M', $results[$i][4]) . ''.sprintf(get_lang('DurationFormat'), $duration).'' . round(($my_res / ($my_total != 0 ? $my_total : 1)) * 100, 2) . '% (' . $my_res . ' / ' . $my_total . ')' . round(($my_res / ($my_total != 0 ? $my_total : 1)) * 100, 2) . '% (' . $my_res . ' / ' . $my_total . ')'.(($is_allowedToEdit||$is_tutor)? @@ -1271,34 +1281,78 @@ if ($_configuration['tracking_enabled'] && ($show == 'result')) { :(($revised)?"".get_lang('Show')."":'')).''; + //echo ''; + $html_link = ''; if ($is_allowedToEdit || $is_tutor) { if ($revised) { - echo "".Display :: return_icon('edit.gif', get_lang('Edit')); - echo ' '; + //echo "".Display :: return_icon('edit.gif', get_lang('Edit')); + //echo ' '; + $html_link.= "".Display :: return_icon('edit.gif', get_lang('Edit')); + $html_link.= ' '; + } else { + //echo "".Display :: return_icon('quizz_small.gif', get_lang('Qualify')); + //echo ' '; + $html_link.="".Display :: return_icon('quizz_small.gif', get_lang('Qualify')); + $html_link.=' '; + } + //echo ""; + $html_link.=""; + if (api_is_platform_admin() || $is_tutor) { + //echo ' '.Display :: return_icon('delete.gif', get_lang('Delete')).''; + //echo ' '; + $html_link.=' '.Display :: return_icon('delete.gif', get_lang('Delete')).''; + $html_link.=' '; + } + if ($is_allowedToEdit) { + //echo ' ' .Display :: return_icon('history.gif', get_lang('ViewHistoryChange')).''; + $html_link.=' ' .Display :: return_icon('history.gif', get_lang('ViewHistoryChange')).''; + } + } else { + if ($revised) { + //echo "" . get_lang('Show') . " "; + $html_link.="" . get_lang('Show') . " "; + } else { - echo "".Display :: return_icon('quizz_small.gif', get_lang('Qualify')); - echo ' '; + // echo ' ' . get_lang('NoResult'); + $html_link.=' ' . get_lang('NoResult'); } - echo ""; - if (api_is_platform_admin() || $is_tutor) - echo ' '.Display :: return_icon('delete.gif', get_lang('Delete')).''; - echo ' '; - if ($is_allowedToEdit) - echo ' ' .Display :: return_icon('history.gif', get_lang('ViewHistoryChange')).''; + } + $more_details_list = $html_link; + if ($is_allowedToEdit || $is_tutor) { + $list_info [] = array($user_list_name,$quiz_name_list,$duration_list,$date_list,$result_list,$more_details_list); } else { - if ($revised) - echo "" . get_lang('Show') . " "; - else - echo ' ' . get_lang('NoResult'); + $list_info [] = array($quiz_name_list,$duration_list,$date_list,$result_list,$more_details_list); } - echo '