} $oldgrade = $RESULT->grade; if (isset($_POST['sum']) && isset($_POST['code'])) { $RESULT->setJsonKey('code', $_POST['code']); if ($_POST['sum'] != $actual_sum) { $_SESSION['error'] = "Your sum did not match"; header('Location: ' . addSession('index.php')); return; } $val = validate($sanity, $_POST['code']); if (is_string($val)) { $_SESSION['error'] = $val; header('Location: ' . addSession('index.php')); return; } LTIX::gradeSendDueDate(1.0, $oldgrade, $dueDate); // Redirect to ourself header('Location: ' . addSession('index.php')); return; } // echo($goodsha); if ($LINK->grade > 0) { echo '<p class="alert alert-info">Your current grade on this assignment is: ' . $LINK->grade * 100.0 . '%</p>' . "\n"; } if ($dueDate->message) { echo '<p style="color:red;">' . $dueDate->message . '</p>' . "\n"; } ?> <p> <b>Finding Numbers in a Haystack</b> <p>
$good = 0; foreach ($headers as $key => $val) { if (!in_array($key, $fields)) { continue; } $postkey = mapdown($key); $count++; if (isset($_POST[$postkey]) && mapdown($_POST[$postkey]) == mapdown($val)) { $good++; } } if ($count == 0) { die("No expected fields found"); } $gradetosend = 1.0 * $good / $count; LTIX::gradeSendDueDate($gradetosend, $oldgrade, $dueDate); header('Location: ' . addSession('index.php')); return; } if ($LINK->grade > 0) { echo '<p class="alert alert-info">Your current grade on this assignment is: ' . $LINK->grade * 100.0 . '%</p>' . "\n"; } if ($dueDate->message) { echo '<p style="color:red;">' . $dueDate->message . '</p>' . "\n"; } $postdata = isset($_SESSION['postdata']) ? $_SESSION['postdata'] : array(); unset($_SESSION['postdata']); ?> <p> <b>Exploring the HyperText Transport Protocol</b> <p>