-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.php
62 lines (61 loc) · 2.42 KB
/
test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<html>
<header>
</header>
<body>
<?php
$testpath = $_GET['t'];
$testslist = simplexml_load_file('./secure/test/tests.xml');
$testfullname = '';
$numquestions = 0;
for($i = 0; $i <= count($testslist->test); $i++)
{
if($testslist->test[$i]->path == $testpath)
{
$testfullname = $testslist->test[$i]->title;
$numquestions = $testslist->test[$i]->questions;
break;
}
}
?>
<h1>Instructions</h1>
<hr />
<p>You are about to take the test <bold><?php echo $testfullname; ?></bold>. Here are some things to keep in mind:</p>
<ul>
<li>DO NOT click the back button.</li>
<li>DO NOT click refresh.</li>
<li>DO NOT navigate away from the site until you see the results page.</li>
<li>DO NOT attempt to hack the system in any way. Doing so will blacklist your IP address.</li>
<li>DO NOT start the test if your browser does not support JavaScript.</li>
<li>DO NOT attempt to take this test with Internet Explorer.</li>
<li>DO read the question completely before answering.</li>
<li>DO read all the answers before answering.</li>
<li>DO notify your instructor when finished.</li>
<li>DO print out the results page for your records.</li>
<li>DO take your time.</li>
</ul>
<br />
<h1>Browser compatability check</h1>
<hr />
<h4>JavaScript test</h4>
<div id="jstest">Test failed</div>
<br />
<h1>User information</h1>
<hr />
<form method="post" action="./verifytest.php">
<input type="hidden" name="t" value="<?php echo $testpath; ?>" />
<input type="hidden" name="n" value="<?php echo $testfullname; ?>" />
<input type="hidden" name="tq" value="<?php echo $numquestions; ?>" />
<input type="hidden" name="q" value="0" />
<input type="hidden" name="r" value="n" />
Name/ID: <input type="text" name="u" /><br /><br />
Secure testing code: <input type="password" name="sec"> <br /><br />
<div id="jstest2">Uh oh! Your browser doesn't support JavaScript. Try again using a different browser.</div><br />
<input type="submit" disabled="true" name="submit" value="Verify" />
</form>
<script>
document.getElementById("jstest").innerHTML = "Test passed";
document.getElementById("mySubmit").disabled = false;
document.getElementById("jstest2").innerHTML = "";
</script>
</body>
</html>