From 97640329565bf93299a0995e0f5c4d8f489d199e Mon Sep 17 00:00:00 2001 From: structix Date: Thu, 4 Jul 2019 09:40:54 +0200 Subject: [PATCH] Update --- cgi-bin/uebung09/questions-show.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/cgi-bin/uebung09/questions-show.php b/cgi-bin/uebung09/questions-show.php index f9c3045..4bc8a8a 100644 --- a/cgi-bin/uebung09/questions-show.php +++ b/cgi-bin/uebung09/questions-show.php @@ -19,8 +19,9 @@ END; $db = new Database(); $questions = $db->getQuestions(); -// -//This is ugly but does the job (I'm used to the laravel collections) + +//This will convert the array into objects for easier access. +//The conversion is ugly but does the job (I'm used to the laravel collections) $questionsobj = json_decode(json_encode($questions), false); foreach($questionsobj as $question) { @@ -36,9 +37,13 @@ foreach($questionsobj as $question) { $color = ($question->solution == 2) ? "background-color: green" : "background-color: red"; echo("$question->answer2"); - echo("$question->solution"); - echo(""); - echo(""); +echo <<
+ +
+ +END; + }