From 102b715697dd16f91119bb139193b7e2e661bd66 Mon Sep 17 00:00:00 2001 From: Julian Prud'homme Date: Thu, 2 Aug 2007 09:59:39 +0200 Subject: [PATCH] [svn r12854] Fix a bug introduced in the last commit --- main/newscorm/lp_stats.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) 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{