diff --git a/main/exercice/exercise.lib.php b/main/exercice/exercise.lib.php index 7a68a965e2..f24b9b342f 100755 --- a/main/exercice/exercise.lib.php +++ b/main/exercice/exercise.lib.php @@ -1025,7 +1025,7 @@ function get_exam_results_data($from, $number_of_items, $column, $direction) { $id = $results[$i]['exid']; $quiz_name_list = $test; - $dt = api_convert_and_format_date($results[$i]['exweight'], null, date_default_timezone_get()); + $dt = api_convert_and_format_date($results[$i]['exweight']); $res = $results[$i]['exresult']; $duration = intval($results[$i]['exduration']); @@ -1040,14 +1040,14 @@ function get_exam_results_data($from, $number_of_items, $column, $direction) { if ($is_allowedToEdit || $is_tutor) { $user = $results[$i]['col0'] . $results[$i]['col1']; - $date_value = $results[$i]['col4']; + $start_date = $results[$i]['col4']; } else { - $date_value = $results[$i]['col2']; + $start_date = $results[$i]['col2']; } - if ($date_value != "0000-00-00 00:00:00") { - //echo ceil((($results[$i][4] - $results[$i][7]) / 60)) . ' ' . get_lang('MinMinutes'); - $exe_date_timestamp = api_strtotime($results[$i]['exdate'], date_default_timezone_get()); - $start_date_timestamp = api_strtotime($date_value, date_default_timezone_get()); + + if ($start_date != "0000-00-00 00:00:00") { + $start_date_timestamp = api_strtotime($start_date); + $exe_date_timestamp = api_strtotime($results[$i]['exdate']); $my_duration = ceil((($exe_date_timestamp - $start_date_timestamp) / 60)); if ($my_duration == 1 ) { @@ -1059,13 +1059,17 @@ function get_exam_results_data($from, $number_of_items, $column, $direction) { //echo ' ( ' . $results[$i][8] . ' ' . get_lang('Steps') . ' )'; $duration_list = ' ( ' . $results[$i]['exstep'] . ' ' . get_lang('Steps') . ' )'; } - $add_start_date = api_convert_and_format_date($date_value, null, date_default_timezone_get()) . ' / '; + //$add_start_date = api_convert_and_format_date($start_date) . ' / '; } else { $duration_list = get_lang('NoLogOfDuration'); //echo get_lang('NoLogOfDuration'); } // Date conversion - $date_list = api_get_local_time($results[$i]['col4']). ' / ' . api_get_local_time($results[$i]['exdate']); + if ($is_allowedToEdit || $is_tutor) { + $date_list = api_get_local_time($results[$i]['col4']). ' / ' . api_get_local_time($results[$i]['exdate']); + } else { + $date_list = api_get_local_time($results[$i]['col2']). ' / ' . api_get_local_time($results[$i]['exdate']); + } // there are already a duration test period calculated?? //echo '