<?php
global $USER;
$date_time = $USER->GetID();
// $date_time = date('Y-m-d H:i:s');
global $DB;
$res = $DB->Query("SELECT max(ID) as ID FROM `b_learn_attempt` WHERE STUDENT_ID='".$date_time."'");
$pop_id = $res->Fetch("ID");
//$pop_id[ID] = "8";
$res2 = $DB->Query("SELECT * FROM b_learn_test_result WHERE ATTEMPT_ID='".$pop_id[ID]."' AND CORRECT='N'");
// Цикл вывода списка неправельных ответов
while ($quest = $res2 -> GetNext())
{
$res3 = $DB->Query("SELECT NAME FROM b_learn_question WHERE ID='".$quest[QUESTION_ID]."'");
while ($quest_name = $res3 -> GetNext()) {
echo "<p><b>", $quest_name[NAME], "</b></p>";
$res4 = $DB->Query("SELECT * FROM b_learn_answer WHERE QUESTION_ID='".$quest[QUESTION_ID]."'");
while ($quest_name = $res4 -> GetNext()) {
if ($quest[RESPONSE] == $quest_name[ID]) {
echo "<p><s>", $quest_name[ANSWER], "</s> ", GetMessage("NEW_PRINT_YOU_TRUE"), "</p>"; }
if ($quest_name[CORRECT]==Y) {
echo "<p><ins>", $quest_name[ANSWER], "</ins> ", GetMessage("NEW_PRINT_TRUE"), "</p>"; }
else echo "<p>", $quest_name[ANSWER], "</p>";
}
}
}
?>
|