return; } if ($RESULT->grade > 0) { echo '<p class="alert alert-info" style="clear:both;">Your current grade on this assignment is: ' . percent($RESULT->grade) . '</p>' . "\n"; } if (!$ok) { if ($USER->instructor) { echo '<p class="alert alert-info" style="clear:both;">' . $why . ' (except for the fact that you are the instructor)</p>' . "\n"; } else { echo '<p class="alert alert-danger" style="clear:both;">' . $why . '</p>' . "\n"; } } // parse the GIFT questions $questions = array(); $errors = array(); parse_gift($gift, $questions, $errors); ?> <form method="post"> <ol id="quiz"> </ol> <?php if ($ok || $USER->instructor) { echo '<input type="submit">' . "\n"; } ?> </form> <?php /* $qj = json_encode($questions); echo("<pre>\n");
} $text = $_POST['text']; if (isset($_POST['title'])) { $_SESSION['title'] = $_POST['title']; } if (isset($_POST['name'])) { $_SESSION['name'] = $_POST['name']; } if (isset($_POST['bypass'])) { $_SESSION['novalidate'] = 'bypass'; } echo "<pre>\n"; require_once "parse.php"; $questions = array(); $errors = array(); parse_gift($text, $questions, $errors); if (count($questions) < 1) { print "No questions found."; exit; } else { print "Found " . count($questions) . " questions in the GIFT input.\n"; } if (count($errors) == 0) { print "Initial parse of GIFT data successful\n"; } else { print "Errors in the GIFT data\n"; print_r($errors); } echo "\nCreating and validating the quiz XML....\n"; flush(); // var_dump($questions);