Exemple #1
0
  <tr><td><?php 
echo $classname;
?>
</td></tr></table>
  <h2 align="center">Quiz</h2>
  <table style="text-align: center;" class="table table-striped table-hover table-bordered table-responsive">
    <tr><th>Question</th><th>Answer</th><th>Student Answer</th></tr>
    <?php 
$x = mysql_fetch_array($getstudentanswers);
$i = 0;
$n = 0;
include "methods/spellcheck.php";
while ($row = mysql_fetch_array($getquiz)) {
    $ans = mysql_fetch_assoc($getstudentanswers);
    $i = $i + 1;
    if (checkSpell($x[$i], $row['answer']) == 1) {
        $mark = "<span class=\"glyphicon glyphicon-ok\"></span>  ";
        $n = $n + 1;
        $s = $s + 1;
    } else {
        $mark = "<span class=\"glyphicon glyphicon-remove\"></span>  ";
        $n = $n + 1;
    }
    echo "<tr><td>" . $row["question"] . "</td><td>" . $row['answer'] . "</td><td align=\"left\">" . $mark . $x[$i] . "</td></tr>";
}
?>
  </table>
  <?php 
$score = $s / $n * 100;
if ($score >= 85) {
    $grade = "A";
Exemple #2
0
?>
</strong> <?php 
if (checkSpell($_GET['9'], "Lancaster")) {
    $score = $score + 1;
    echo '<img src="https://upload.wikimedia.org/wikipedia/en/e/e4/Green_tick.png" height="20px">';
} else {
    echo '<img src="http://www.rsc.org/learn-chemistry/wiki/images/a/a5/X.png" height="20px">';
}
?>
</p>
<p>The correct answer is <strong>Lancaster</strong></p>

<h3>Question 10</h3>
<p>You answered <strong><?php 
echo $_GET['10'];
?>
</strong> <?php 
if (checkSpell($_GET['10'], "leaching")) {
    $score = $score + 1;
    echo '<img src="https://upload.wikimedia.org/wikipedia/en/e/e4/Green_tick.png" height="20px">';
} else {
    echo '<img src="http://www.rsc.org/learn-chemistry/wiki/images/a/a5/X.png" height="20px">';
}
?>
</p>
<p>The correct answer is <strong>leaching</strong></p>

<?php 
$percentage = $score / 10;
$percentage = $percentage * 100;
$percentage = $percentage . "%";