Skip to content

Commit

Permalink
Indentation
Browse files Browse the repository at this point in the history
Fixed indentation while trying to fix #118
  • Loading branch information
DocDoctorGoose committed Mar 23, 2018
1 parent 62c5d71 commit d89321a
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 48 deletions.
2 changes: 1 addition & 1 deletion pages/logged_in_teacher.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
} //TODO: link poll class to the class poll using the proper parameter send structure

if (empty($removeZerothIndex)) {
echo "<br><H3 class=\"display-5 text-center\">You have no classes! Create one!</H3>";
echo "<br><h3 class=\"display-5 text-center\">You have no classes! Create one!</h3>";
}

?>
Expand Down
90 changes: 43 additions & 47 deletions pages/manage_questions.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,57 +121,53 @@
<div class="container">
<h1 class="display-5 text-center">Current Questions</h1>
<div class="card-deck mb-3 text-center" id="questionDeck">
<?php

$retVal = searchQuestionsByTeacherID($_SESSION['id']);
$retVal = json_decode($retVal,true);
$removeZerothIndex = $retVal;
unset($removeZerothIndex[0]);

foreach($removeZerothIndex as $value){
$question_type = $value['question_type'];
$description = $value['description'];

$answers = json_decode($value['potential_answers'], TRUE);
if(is_null($answers) || empty($answers))
$answers = "There are no answers!";
else
$answers = implode("<br>", $answers);

$correct_answers = json_decode($value['correct_answers'], TRUE);
if(is_null($correct_answers) || empty($correct_answers))
$correct_answers = "There are no correct answers!";
else
$correct_answers = implode(" ", $correct_answers);


echo "<div class=\"card mb-4\">
<div class=\"card-header\">
<h4 class=\"my-0 font-weight-normal\">$description</h4>
</div>
<div class=\"card-body\">
<h5 class=\"card-title pricing-card-title\">$answers</h5>
</div>
<div class=\"card-footer\">
<h6>$correct_answers</h6>
</div>
</div>";
}

if (empty($removeZerothIndex)) {
echo "<br><H3 class=\"display-5 text-center\">You have no questions! Create one!</H3>";
}

?>
<?php

</div>


$retVal = searchQuestionsByTeacherID($_SESSION['id']);
$retVal = json_decode($retVal,true);
$removeZerothIndex = $retVal;
unset($removeZerothIndex[0]);

<?php
foreach($removeZerothIndex as $value){
$question_type = $value['question_type'];
$description = $value['description'];

$answers = json_decode($value['potential_answers'], TRUE);
if(is_null($answers) || empty($answers))
$answers = "There are no answers!";
else
$answers = implode("<br>", $answers);

$correct_answers = json_decode($value['correct_answers'], TRUE);
if(is_null($correct_answers) || empty($correct_answers))
$correct_answers = "There are no correct answers!";
else
$correct_answers = implode(" ", $correct_answers);


echo "<div class=\"card mb-4\">
<div class=\"card-header\">
<h4 class=\"my-0 font-weight-normal\">$description</h4>
</div>
<div class=\"card-body\">
<h5 class=\"card-title pricing-card-title\">$answers</h5>
</div>
<div class=\"card-footer\">
<h6>$correct_answers</h6>
</div>
</div>";
}

if (empty($removeZerothIndex)) {
echo "<h3 class=\"display-5 text-center\">Get started by creating some questions!</h3>";
}

?>
</div>

<?php
include("../lib/php/footer.php");
?>
?>
</div>


Expand Down

0 comments on commit d89321a

Please sign in to comment.