This repository has been archived by the owner on Nov 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
math.html
56 lines (54 loc) · 1.96 KB
/
math.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=9" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Addition</title>
<link rel="stylesheet" href="css/math.css">
<script type="text/javascript" src="js/math20180226c.js">
</script>
</head>
<body onload="problem();">
<div id="landscape">
<div id="original">
<span id="timer"></span>
<div id="timerForm">
Seconds: <input type="number" id="seconds" value="90" style="width: 50px;">
<input type="button" value="Start Timer" id="startButton" onclick="startTimer()">
</div>
<div id="scoreboard">Score: <span id="score">0</span></div>
<div id ="prompt" style="height: 100px;"></div>
<!-- <input id="answer" type="text" />
<input type="button" value="Solve!" onclick="answer1()" /> -->
<div><p id ="status" style="height: 50px;">Click the correct answer to Solve the problem</p></div>
<div id ="options">
<a class='answerButton' id='answerOption1'></a>
<a class='answerButton' id='answerOption2'></a>
<a class='answerButton' id='answerOption3'></a>
<a class='answerButton' id='answerOption4'></a>
</div>
</div>
<div id="expired" style="display: none;">
<p id="expPrompt">Time has expired.</p>
<p id="results"></p>
<a id="closeButton" onclick="location.reload();">X</a>
</div>
</div>
<div id="portrait">
<p>Please turn your device</p>
</div>
</body>
</html>
<script>
// from https://stackoverflow.com/questions/155188/trigger-a-button-click-with-javascript-on-the-enter-key-in-a-text-box
document.getElementById("seconds")
.addEventListener("keyup", function(event) {
event.preventDefault();
if (event.keyCode === 13) {
document.getElementById("startButton").click();
}
});
</script>