Minor improvements to results page

This commit is contained in:
Mark Wane 2019-10-06 17:55:33 +01:00
parent 8592bc0c3c
commit 266c664c06
2 changed files with 28 additions and 3 deletions

View file

@ -2,6 +2,26 @@
A simple system for multiple choice quizes.
N.B. While the system will allow a user to take each quiz multiple time and save the total for each attempt, individual question scores are only saved for the latest attempt.
# Installation
Import the included dump file, copy `config.dist.php` to `config.php` and update the connection details
# Answers to example quizzes
## Quiz A
1. B
2. A
3. False
4. A and C
## Quiz B
1. True
2. D
3. C and D
4. True
5. False
6. B

View file

@ -39,23 +39,28 @@ if ( $scorePer_num > $averagePer_num + 10 ){
</div>
<div class="row">
<div class="col">
<h2 class="text-center">Thank you, <?php echo $user->getName(); ?></h2>
<h2 class="text-center">Thank you, <?php echo $user->getName(); ?><br /><?php echo $quiz->getName(); ?></h2>
</div>
</div>
<div class="row">
<div class="col-md-6">
<p>Your score</p>
<h3>Your score</h3>
<div class="progress">
<div class="progress-bar <?php echo $barColour_str; ?>" role="progressbar" style="width: <?php echo $scorePer_num; ?>%"><?php echo $data_arr['score'] . " / " . $maxScore_int ?></div>
</div>
</div>
<div class="col-md-6">
<p>Average score</p>
<h3>Average score</h3>
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: <?php echo $averagePer_num; ?>%"><?php echo round( $data_arr['average'], 1 ) . " / " . $maxScore_int ?></div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<a href="./" class="mt-3 btn btn-primary">Return to home</a>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>