diff --git a/main/newscorm/lp_stats.php b/main/newscorm/lp_stats.php index 7e15fe8d48..9e9831e225 100644 --- a/main/newscorm/lp_stats.php +++ b/main/newscorm/lp_stats.php @@ -78,6 +78,7 @@ $output .= " ".""."'; + $correct_test_link = ''; } else{ - $correct_test_link = ''; + $correct_test_link = ''; } } else{ @@ -284,11 +285,21 @@ foreach ($list as $my_item_id) { if ($row['item_type'] != 'dokeos_chapter') { if($row['item_type'] == 'quiz'){ + + if($_SESSION['status'][$_course["id"]] == 5){ + $sql_last_attempt='SELECT exe_id FROM '.$tbl_stats_exercices.' WHERE exe_exo_id="'.$row['path'].'" AND exe_user_id="'.api_get_user_id().'" AND exe_cours_id="'.$_SESSION['_course']['id'].'" ORDER BY exe_date DESC LIMIT 1'; + } + else{ + $sql_last_attempt='SELECT exe_id FROM '.$tbl_stats_exercices.' WHERE exe_exo_id="'.$row['path'].'" AND exe_user_id="'.$_GET['student_id'].'" AND exe_cours_id="'.$_SESSION['_course']['id'].'" ORDER BY exe_date DESC LIMIT 1'; + } + $resultLastAttempt = api_sql_query($sql_last_attempt); + $id_last_attempt=mysql_result($resultLastAttempt,0,0); + if($_SESSION['status'][$_course["id"]] == 5){ - $correct_test_link = ''; + $correct_test_link = ''; } else{ - $correct_test_link = ''; + $correct_test_link = ''; } } else{