| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?php /** @noinspection PhpUnhandledExceptionInspection */
- /**
- * @controller test.php
- *
- * @var Test $test
- * @var Location $location
- * @var Project $project
- * @var Template $template
- */
- ?>
- <div class="container mt-3 py-4">
- <?php
- if($test->isConfirmed()) {
- $template->renderBeforeTestForm($project);
- }
- else if($test->hasStarted()) {
- $template->renderDuringTestForm();
- }
- else if($test->isPendingVerification()) {
- $json = json_decode($template->getJSON());
- $fields = $json->duringTest;
- $values = $test->getValues(true);
- ?>
- <div class="alert alert-info">
- <i class="fal fa-fw fa-info-circle"></i>
- <?=htmlspecialchars(__("Answer as clearly and accurately as you can otherwise you may be contacted after the test for clarification and/or verification purposes."))?>
- </div>
- <form method="post" id="test-form">
- <?php
- foreach($fields as $field) {
- $name = $field->name ?? false;
- if($name) {
- if(isset($test->$name)) $field->value = $test->$name;
- if(isset($values[$name])) $field->value = $values[$name];
- }
- $field->template = $template;
- Form::renderField($field);
- }
- ?>
- <input type="hidden" name="submit" value="<?=htmlspecialchars($_SESSION["csrf_token"])?>" />
- <input type="hidden" name="void" id="void" value="0" />
- <div class="form-group">
- <button class="btn btn-block btn-success" type="submit" id="test-submit-button">
- <?=htmlspecialchars(__("Submit Test Results"))?>
- </button>
- </div>
- <div class="text-center">
- <small class="form-text text-muted d-none" id="test-no-internet-text">
- <span class="text-danger"><?=htmlspecialchars(__("No Internet Connectivity"))?></span><br />
- <?=htmlspecialchars(__("Please check your Internet connectivity and try again."))?>
- </small>
- <small id="test-submit-status">
- </small>
- </div>
- </form>
- <?php
- }
- else {
- ?>
- <h2><?=htmlspecialchars(__("Test Completed"))?></h2>
- <div class="alert alert-success">
- <?=sprintf(htmlspecialchars(__("This test is now completed. %sClick here%s to return to the Account page.")), '<a href="/account">', '</a>')?>
- </div>
- <?php
- }
- ?>
- </div>
|