-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.php
More file actions
168 lines (120 loc) · 3.69 KB
/
index.php
File metadata and controls
168 lines (120 loc) · 3.69 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<html>
<head>
<title>Enter Flags</title>
<style>
table.flag { padding: 10px; border-radius: 15px; background-color: #ffffff; border: 10px solid #0066ff; }
table.scoreboard { padding: 10px; border-radius: 15px; background-color: #ffffff; border: 10px solid #cccccc; }
</style>
</head>
<body bgcolor="#ffffff" style="font-family:Arial">
<!-- Import answers.php -->
<?php
include 'answers.php';
if (! isset($poss_chals) ) {
print '<h3>Error: poss_chals not set in answers.php</h3>';
exit;
}
$nposs_chals = count($poss_chals);
if (! isset($description) ) {
print '<h3>Error: description not set in answers.php</h3>';
exit;
}
$remove = '_'; # Challenge ID delimiter
?>
<!-- Print Header -->
<?php
$header = $description;
$header .= "<h3 align='center'><a href='scoreboard.php?summary=1'>Scoreboard</a> · ";
$header .= "<a href='scoreboard.php'>Details</a></h3>";
print $header;
?>
<!-- Flag Submission Form -->
<form action='grade.php' method='post'>
<blockquote>
<table align='center' class='flag'><tr><td colspan=2><h2 align='center'>Enter Flag</h2></td></tr>
<tr><td><big><b>Challenge:</b></big></td>
<td>
<select name='chalnum'>
<?php
for( $j=0; $j<$nposs_chals; $j++ ) {
$curr_chal = $poss_chals[$j];
$cclean = str_replace($remove, "", $curr_chal);
$mark = substr(strtolower($cclean),0,5);
if ( ($mark != "break") && ($mark != "label") ) {
print "<option value='$curr_chal'>$cclean</option>";
}
} ?>
</select>
</td></tr>
<tr><td><big><b>Name:</b></big></td>
<td><textarea name='name' rows='1' cols='25'></textarea></td></tr>
<tr><td><big><b>Flag:</b></big></td>
<td><textarea name='answer' rows='1' cols='25'></textarea>
</td></tr>
<tr><td colspan=2 align='center'><big><b>
<input type='submit' value='Submit'>
</td></tr>
</table>
</blockquote>
</form>
<!--
<h2>Special Scoreboards</h2>
<b>
<a href="scoreboard.php?refresh=1&summary=1">Scoreboard that Refreshes</a><br>
<a href="scoreboard.php?showtest=1&summary=1">Scoreboard Including "TESTING"</a><br>
<a href="scoreboard.php?refresh=1">Detailed Scoreboard that Refreshes</a><br>
<a href="scoreboard.php?showtest=1">Detailed Scoreboard Including "TESTING"</a><br>
<p>
-->
<p>
<form action='scoreboard_filtered.php' method='get'>
<blockquote>
<table align='center' class='scoreboard'>
<tr><td colspan=2 align="center"><h2>Special Scoreboards</h2></td></tr>
<tr><td><big><b>Challenge:</b></big></td>
<td><input name='challenge' rows='1' cols='25'></textarea></td></tr>
<tr><td><big><b>Refresh:</b></big></td>
<td><input type="checkbox" name="refresh" value="1">Refresh<br></td></tr>
<tr><td><big><b>Summary:</b></big></td>
<td><input type="checkbox" name="summary" value="1">Summary<br></td></tr>
<tr><td><big><b>Testing:</b></big></td>
<td><input type="checkbox" name="testing" value="1">Testing<br></td></tr>
<tr><td colspan=2 align='center'><big><b>
<input type='submit' value='View'>
</td></tr>
</table>
</blockquote>
</form>
<p>
<p>
<blockquote>
<table><tr><td>
<h2>Challenges</h2>
<h3>Geography</h3>
<b><big>1. What color is the sky?</big></b>
<p>
<b><big>2. When walking along a road, which directions can you go? Choose from these options. (There are two possible correct answers.)
<ul>
<li>Forward
<li>Back
<li>Up
<li>Down
</ul>
</big></b>
<p>
<b><big>3. Pick a number between 1 and 10.</big></b>
<h3>Biology</h3>
<b><big>4. How many eyes does a human have?</big></b>
<p>
</td></tr></table></blockquote>
<p>
<P ALIGN="CENTER">
<b>
<a href="tail.php?count=20&refresh=1">Recent Scores</a><br><br>
<a href="admin.php">Administration console</a><br><br>
<a href="https://github.com/sambowne/lamectf">Get this scoring engine</a>
</b>
</p>
Updated 5-23-19<br>
</body>
</html>