@ -810,14 +810,16 @@ if ($show_results) {
$real_list[$real_answer['id']]= $real_answer['answer'];
$real_list[$real_answer['id']]= $real_answer['answer'];
}
}
$sql_select_answer = 'SELECT id, answer, correct, id_auto FROM '.$table_ans.' WHERE question_id="'.Database::escape_string($questionId).'" AND correct< >0';
$sql_select_answer = 'SELECT id, answer, correct, id_auto FROM '.$table_ans.'
WHERE question_id="'.Database::escape_string($questionId).'" AND correct < > 0 ORDER BY id_auto';
$res_answers = Database::query($sql_select_answer);
$res_answers = Database::query($sql_select_answer);
echo '< table width = "100%" height = "71" border = "0" cellspacing = "3" cellpadding = "3" > ';
echo '< table width = "100%" height = "71" border = "0" cellspacing = "3" cellpadding = "3" > ';
echo '< tr > < td colspan = "2" > < / td > < / tr > ';
echo '< tr > < td colspan = "2" > < / td > < / tr > ';
echo '< tr >
echo '< tr >
< td > < span style = "font-style: italic;" > '.get_lang("ElementList" ).'< / span > < / td >
< td > < span style = "font-style: italic;" > '.get_lang('ElementList' ).'< / span > < / td >
< td > < span style = "font-style: italic;" > '.get_lang("CorrespondsTo" ).'< / span > < / td >
< td > < span style = "font-style: italic;" > '.get_lang('CorrespondsTo' ).'< / span > < / td >
< / tr > ';
< / tr > ';
echo '< tr > < td colspan = "2" > < / td > < / tr > ';
echo '< tr > < td colspan = "2" > < / td > < / tr > ';
@ -826,13 +828,13 @@ if ($show_results) {
while ($a_answers = Database::fetch_array($res_answers)) {
while ($a_answers = Database::fetch_array($res_answers)) {
$i_answer_id = $a_answers['id']; //3
$i_answer_id = $a_answers['id']; //3
$s_answer_label = $a_answers['answer']; // your dady - you mother
$s_answer_label = $a_answers['answer']; // your dadd y - your mother
$i_answer_correct_answer = $a_answers['correct']; //1 - 2
$i_answer_correct_answer = $a_answers['correct']; //1 - 2
$i_answer_id_auto = $a_answers['id_auto']; // 3 - 4
$i_answer_id_auto = $a_answers['id_auto']; // 3 - 4
$sql_user_answer = "SELECT answer
$sql_user_answer = "SELECT answer FROM $TBL_TRACK_ATTEMPT
FROM $TBL_TRACK_ATTEMPT
WHERE exe_id = '$id' AND question_id = '$questionId' AND position='$i_answer_id_auto'";
WHERE exe_id = '$id' AND question_id = '$questionId' AND position='$i_answer_id_auto'";
$res_user_answer = Database::query($sql_user_answer);
$res_user_answer = Database::query($sql_user_answer);
if (Database::num_rows($res_user_answer)>0 ) {
if (Database::num_rows($res_user_answer)>0 ) {
@ -844,6 +846,7 @@ if ($show_results) {
$i_answerWeighting=$objAnswerTmp->selectWeighting($i_answer_id);
$i_answerWeighting=$objAnswerTmp->selectWeighting($i_answer_id);
$user_answer = '';
$user_answer = '';
if (!empty($s_user_answer)) {
if (!empty($s_user_answer)) {
if ($s_user_answer == $i_answer_correct_answer) {
if ($s_user_answer == $i_answer_correct_answer) {
$questionScore += $i_answerWeighting;
$questionScore += $i_answerWeighting;