Add color
This commit is contained in:
@@ -26,10 +26,18 @@ $questionsobj = json_decode(json_encode($questions), false);
|
||||
foreach($questionsobj as $question) {
|
||||
echo("<tr>");
|
||||
echo("<td>$question->question</td>");
|
||||
echo("<td>$question->answer0</td>");
|
||||
|
||||
$color = ($question->solution == 0) ? "background-color: green" : "background-color: red";
|
||||
echo("<td style=$color>$question->answer0</td>");
|
||||
|
||||
$color = ($question->solution == 1) ? "background-color: green" : "background-color: red";
|
||||
echo("<td>$question->answer1</td>");
|
||||
|
||||
$color = ($question->solution == 2) ? "background-color: green" : "background-color: red";
|
||||
echo("<td>$question->answer2</td>");
|
||||
echo("<td>$question->solution</td>");
|
||||
|
||||
echo("<td></td>");
|
||||
echo("<td></td>");
|
||||
echo("</tr>");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user