| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <div class="container mt-3 py-4">
- <?php
- if($test->status == Test::STATUS_CONFIRMED) {
- $template->renderBeforeTestForm();
- }
- else if($test->status == Test::STATUS_STARTED) {
- $template->renderDuringTestForm();
- }
- else if($test->status == Test::STATUS_PENDING_VERIFICATION) {
- $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];
- }
- Form::renderField($field);
- }
- ?>
- <div class="bg-light text-center p-3 mt-3">
- <input type="hidden" name="submit" value="<?=htmlspecialchars($_SESSION["csrf_token"])?>" />
- <button class="btn btn-block btn-primary" type="submit" id="test-submit-button"><?=htmlspecialchars(__("Submit Test Results"))?></button>
- <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>
|