Add color
This commit is contained in:
1 parent
7fa649ee13
commit
0530f4575e
1 file changed
+10
-2
@@ -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