-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_leaderboard.html
73 lines (60 loc) · 2.43 KB
/
test_leaderboard.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Testing framework</title>
<!-- Linking the external stylesheet file -->
<link rel="stylesheet" href="css/test_css.css"/>
</head>
<body>
<!-- Main heading for the Testing Leaderboard page -->
<h1>Testing Leaderboard page</h1>
<!-- Subheading and explanation of how the leaderboard works -->
<h2>How it works:</h2>
<ul>
<!-- List of instructions for the users -->
<li>Enter a number to determine the size of the leaderboard.</li>
<li>If no input from the user is provided, then the test leaderboard will produce 42 players.</li>
<li>Check a box to view the testing leaderboard either sorted or not.</li>
<li>If both boxes are checked, then by default the Sorting will be set to true</li>
<li>Run Test button to show results.</li>
<li>Clear button to clear results</li>
</ul>
<!-- Section for the Unit Tests and the link to the testing API -->
<h2>Unit Tests</h2>
<p>The Unit Tests make use of the corresponding Testing API available at <a href="https://codecyprus.org/th/testing" target="_blank">https://codecyprus.org/th/testing</a>.</p>
<!-- Loader for the AJAX request, hidden by default -->
<div id="loader" class="loader" hidden></div>
<!-- Section for testing the /leaderboard endpoint -->
<h3>Testing <code>/leaderboard</code></h3>
<form>
<label for="leaderboard-input">Enter a number:</label>
<!-- Number input for the leaderboard size -->
<input type="number" id="leaderboard-input">
</form>
<!-- Radio buttons for sorting the leaderboard -->
<input type="radio" id="true" name="myOption" value="true" checked>
<label for="true">True</label>
<br>
<input type="radio" id="false" name="myOption" value="false">
<label for="false">False</label>
<br>
<!-- Buttons for running the test and clearing the results -->
<button id="buttonTestQuestion" class="button" onclick="handleTestLeaderboard()">Run Test</button>
<button id="buttonClearQuestion" class="button" onclick="clearTestLeaderboard()">Clear</button>
<!-- Divider line -->
<hr>
<!-- Placeholder for the leaderboard -->
<div id="leaderboard">
Leaderboard to show up here...
</div>
<!-- Table for displaying the leaderboard data -->
<table id="leaderboard-data"></table>
<!-- Divider line -->
<hr>
<!-- Load the external JavaScript files -->
<!--<script src="th-api.js"></script>-->
<script src="js/th-test-api.js"></script>
</body>
</html>