From 9ae58c83e68e55fe8f651e2170d4f5d224859b21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Ra=C3=B1a?= Date: Fri, 9 Oct 2009 22:18:55 +0200 Subject: [PATCH 1/2] fix list order of groups (second send) --- main/group/group_creation.php | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/main/group/group_creation.php b/main/group/group_creation.php index af98c8fa4d..cb1fcb5fe3 100755 --- a/main/group/group_creation.php +++ b/main/group/group_creation.php @@ -255,7 +255,30 @@ EOT; } //$group_el[] = & $form->createElement('select', 'group_'.$group_number.'_tutor', null, $tutor_options, array ('id' => 'tutor_'.$group_number)); $group_el[] = & $form->createElement('text', 'group_'.$group_number.'_places', null, array ('size' => 3, 'id' => 'places_'.$group_number)); - $defaults['group_'.$group_number.'_name'] = get_lang('GroupSingle').' 0'.$group_id ++; + + + if($_POST['number_of_groups']<10000) + { + if ($group_id<10) + { + $prev='000'; + } + elseif ($group_id<100) + { + $prev='00'; + } + elseif ($group_id<1000) + { + $prev='0'; + } + else + { + $prev=''; + } + } + + $defaults['group_'.$group_number.'_name'] = get_lang('GroupSingle').' '.$prev.$group_id ++; + $form->addGroup($group_el, 'group_'.$group_number, null, '', false); } $defaults['action'] = 'create_groups'; From b76d3ae394e2d3a9347ea88981e33fd21fad799b Mon Sep 17 00:00:00 2001 From: iflores Date: Fri, 9 Oct 2009 15:50:46 -0500 Subject: [PATCH 2/2] Allow sort quiz --- main/exercice/exercice.php | 136 ++++++++++++++++++++++++++----------- 1 file changed, 95 insertions(+), 41 deletions(-) diff --git a/main/exercice/exercice.php b/main/exercice/exercice.php index 0ac4010a75..a62c53d6c6 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')); +$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; } @@ -1346,4 +1400,4 @@ if ($origin != 'learnpath') { //so we are not in learnpath tool +?> \ No newline at end of file
' . $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 ' '; + //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 ""; + //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') . " "; - 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')).''; + } else { + // echo ' ' . get_lang('NoResult'); + $html_link.=' ' . get_lang('NoResult'); + } + + } + $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 '