<?php
echo "<li id=\"li_17\">";
echo "<label class=\"description\" for=\"element_17\">Question :</label>";
$row = mysql_query("SELECT * FROM quiz_lcd where datesent = CURDATE()");
while($ib_row = mysql_fetch_array($row))
{
echo $ib_row['question'];
echo "</li>";
echo "<li id=\"li_18\">";
echo "<label class=\"description\" for=\"element_18\"></label>";
echo "<span>";
// Radio Button for Option1
if ($ib_row['option1'] == $ib_row['correctanswer'])
{ echo "<input id=\"element_18_1\" name=\"element_18\" class=\"element radio\" type=\"radio\" value=\"1\" checked/>";
}
else
{
echo "<input id=\"element_18_1\" name=\"element_18\" class=\"element radio\" type=\"radio\" value=\"1\" />";
}
echo "<label class=\"choice\" for=\"element_18_1\">";
echo $ib_row['option1'];
echo "</label>";
// Radio Button for Option2
if ($ib_row['option2'] == $ib_row['correctanswer'])
{ echo "<input id=\"element_18_2\" name=\"element_18\" class=\"element radio\" type=\"radio\" value=\"2\" checked/>";
}
else
{
echo "<input id=\"element_18_2\" name=\"element_18\" class=\"element radio\" type=\"radio\" value=\"2\" />";
}
echo "<label class=\"choice\" for=\"element_18_2\">";
echo $ib_row['option2'];
echo "</label>";
// Radio Button for Option3
if ($ib_row['option3'] == $ib_row['correctanswer'])
{ echo "<input id=\"element_18_4\" name=\"element_18\" class=\"element radio\" type=\"radio\" value=\"4\" checked/>";
}
else
{
echo "<input id=\"element_18_4\" name=\"element_18\" class=\"element radio\" type=\"radio\" value=\"4\" />";
}
echo "<label class=\"choice\" for=\"element_18_3\">";
echo $ib_row['option3'];
echo "</label>";
// Radio Button for Option4
if ($ib_row['option4'] == $ib_row['correctanswer'])
{
echo "<input id=\"element_18_4\" name=\"element_18\" class=\"element radio\" type=\"radio\" value=\"4\" checked/>";
}
else
{
echo "<input id=\"element_18_4\" name=\"element_18\" class=\"element radio\" type=\"radio\" value=\"4\" />";
}
echo "<label class=\"choice\" for=\"element_18_3\">";
echo $ib_row['option4'];
echo "</label>";
}
?>
No comments:
Post a Comment