diff --git a/main/newscorm/lp_stats.php b/main/newscorm/lp_stats.php index 33523e0453..091dd9d363 100755 --- a/main/newscorm/lp_stats.php +++ b/main/newscorm/lp_stats.php @@ -618,18 +618,21 @@ if (is_array($list) && count($list) > 0) { if ($num_attempts > 0) { $n = 1; while ($row_attempts = Database :: fetch_array($res_attempts)) { - $my_score = $row_attempts['exe_result']; - $my_maxscore = $row_attempts['exe_weighting']; - $my_exe_id = $row_attempts['exe_id']; - $my_orig_lp = $row_attempts['orig_lp_id']; - $my_orig_lp_item = $row_attempts['orig_lp_item_id']; - $my_exo_exe_id=$row_attempts['exe_exo_id']; - $mktime_start_date = convert_mysql_date($row_attempts['start_date']); - $mktime_exe_date = convert_mysql_date($row_attempts['exe_date']); - $mytime = ((int)$mktime_exe_date-(int)$mktime_start_date); - $time_attemp = learnpathItem :: get_scorm_time('js', $mytime); - $time_attemp = str_replace('NaN', '00' . $h . '00\'00"', $time_attemp); - + $my_score = $row_attempts['exe_result']; + $my_maxscore = $row_attempts['exe_weighting']; + $my_exe_id = $row_attempts['exe_id']; + $my_orig_lp = $row_attempts['orig_lp_id']; + $my_orig_lp_item = $row_attempts['orig_lp_item_id']; + $my_exo_exe_id = $row_attempts['exe_exo_id']; + $mktime_start_date = api_strtotime($row_attempts['start_date'],'UTC'); + $mktime_exe_date = api_strtotime($row_attempts['exe_date'],'UTC'); + if ($mktime_start_date && $mktime_exe_date) { + $mytime = ((int)$mktime_exe_date-(int)$mktime_start_date); + $time_attemp = learnpathItem :: get_scorm_time('js', $mytime); + $time_attemp = str_replace('NaN', '00' . $h . '00\'00"', $time_attemp); + } else { + $time_attemp = ' - '; + } if (!$is_allowed_to_edit && $result_disabled_ext_all) { $view_score = Display::return_icon('invisible.gif', get_lang('ResultsHiddenByExerciseSetting')); } else { @@ -658,16 +661,15 @@ if (is_array($list) && count($list) > 0) { . '
 . 'quiz_na.gif)
 . 'quiz_na.gif)
 . 'quiz.gif)
 . 'quiz.gif)
 . 'quiz_na.gif)
 . 'quiz_na.gif)
 . 'quiz.gif)
 . 'quiz.gif)