diff --git a/main/exercice/exercice.php b/main/exercice/exercice.php index 1d5138cc3b..cd40b53223 100644 --- a/main/exercice/exercice.php +++ b/main/exercice/exercice.php @@ -1,5 +1,5 @@ $key_value) { @@ -170,23 +170,26 @@ if ($show == 'result' && $_REQUEST['comments'] == 'update' && ($is_allowedToEdit $comments_exist=true; } } - //var_dump($comments_exist); + $loop_in_track=($comments_exist===true) ? (count($_POST)/2) : count($_POST); - //var_dump($loop_in_track); - $k=$post_content_id[0]; - for ($i=$k;$i<($loop_in_track+$k);$i++) { - - //echo $_POST['marks_'.$i].' y '.$_POST['comments_'.$i].'
'; + $array_content_id_exe=array(); + if ($comments_exist===true) { + $array_content_id_exe=array_slice($post_content_id,$loop_in_track); + } else { + $array_content_id_exe=$post_content_id; + } + + for ($i=0;$i<$loop_in_track;$i++) { - $my_marks=$_POST['marks_'.$i]; - $contain_comments=$_POST['comments_'.$i]; + $my_marks=$_POST['marks_'.$array_content_id_exe[$i]]; + $contain_comments=$_POST['comments_'.$array_content_id_exe[$i]]; if (isset($contain_comments)) { - $my_comments=$_POST['comments_'.$i]; + $my_comments=$_POST['comments_'.$array_content_id_exe[$i]]; } else { $my_comments=''; } - $my_questionid=$i; + $my_questionid=$array_content_id_exe[$i]; $sql = "SELECT question from $TBL_QUESTIONS WHERE id = '$my_questionid'"; $result =api_sql_query($sql, __FILE__, __LINE__); $ques_name = Database::result($result,0,"question"); @@ -221,7 +224,7 @@ if ($show == 'result' && $_REQUEST['comments'] == 'update' && ($is_allowedToEdit } $post_content_id=array(); - + $array_content_id_exe=array(); /*foreach ($_POST as $key => $v) { $keyexp = explode('_', $key); diff --git a/main/exercice/exercice_history.php b/main/exercice/exercice_history.php index 97c5f5efd4..6ae6cf6a99 100755 --- a/main/exercice/exercice_history.php +++ b/main/exercice/exercice_history.php @@ -60,23 +60,34 @@ if(!$is_allowedToEdit){ exit; } +$interbreadcrumb[]= array ( + 'url' => 'exercice.php'.'?show=result', + 'name' => get_lang('Exercices') +); +$interbreadcrumb[]= array ( + 'url' => 'exercice.php'.'?show=result&filter=2', + 'name' => get_lang('StudentScore') +); +$interbreadcrumb[]= array ( + 'url' => 'exercice_history.php'.'?exe_id='.Security::remove_XSS($_GET['exe_id']), + 'name' => get_lang('Details') +); + $TBL_USER = Database::get_main_table(TABLE_MAIN_USER); $TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST); $TBL_EXERCICES_QUESTION = Database::get_course_table(TABLE_QUIZ_QUESTION); $TBL_TRACK_EXERCICES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES); $TBL_TRACK_ATTEMPT_RECORDING= Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING); //$nameTools=get_lang('Exercices'); - Display::display_header($nameTools,"Exercise"); - if(isset($_GET['message'])) - { - if (in_array($_GET['message'], array('ExerciseEdited'))) - { - Display::display_confirmation_message(get_lang($_GET['message'])); +Display::display_header($nameTools,"Exercise"); + + if(isset($_GET['message'])) { + if (in_array($_GET['message'], array('ExerciseEdited'))) { + $my_message_history=Security::remove_XSS($_GET['message']); + Display::display_confirmation_message(get_lang($my_message_history)); } } - - //include_once(api_get_path(LIBRARY_PATH).'events.lib.inc.php'); //event_access_tool(TOOL_QUIZ); @@ -100,7 +111,6 @@ $TBL_TRACK_ATTEMPT_RECORDING= Database::get_statistic_table(TABLE_STATISTIC_TRAC $sql = 'SELECT * FROM '.$TBL_EXERCICES; $query = api_sql_query($sql,__FILE__,__LINE__); */ - $sql = "SELECT *, quiz_question.question, CONCAT(firstname,' ',lastname) as full_name FROM $TBL_TRACK_ATTEMPT_RECORDING t,$TBL_USER,$TBL_EXERCICES_QUESTION quiz_question WHERE quiz_question.id = question_id AND user_id = author AND exe_id = '".(int)$_GET['exe_id']."' ORDER BY t.insert_date desc,question ASC"; $query = api_sql_query($sql,__FILE__,__LINE__); while($row = Database::fetch_array($query)){