This repository has been archived by the owner on May 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
parsetest.html
79 lines (69 loc) · 3.16 KB
/
parsetest.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
74
75
76
77
78
79
<html>
<head>
<title>SPARKS Module 2: Measuring a Series Circuit</title>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type' />
<link href='lib/jquery/css/ui-lightness/jquery-ui-1.8.custom.css' rel='stylesheet' type='text/css' />
<link href='https://fonts.googleapis.com/css?family=Anonymous+Pro:700' rel='stylesheet' type='text/css'>
<link href='common/stylesheets/app.css' rel='stylesheet' type='text/css' />
<link href='common/stylesheets/sparks.css' rel='stylesheet' type='text/css' />
<style>
#HTMLLog{display:none;background:#000;color:#c00;height:100px;padding:10px;margin:10px;}
</style>
<script src="lib/raphael-min.js" type="text/javascript"></script>
<script src="client-breadboard-activity.js" type="text/javascript"></script>
<script type="text/javascript">
sparks.config.qucsate_server_url = "/sparks/qucsator/solve";
</script>
<script type="text/javascript">
$(document).ready(function () {
$("#parsetest").keyup(function(event){
if(event.keyCode == 13){
$("#result_val").hide();
$("#result_units").hide();
testValue();
}
});
});
testValue = function() {
val = $("#parsetest").val();
result = sparks.unit.parse(val);
if (isNaN(result.val)) result.val = "";
$("#result_val").text(result.val).fadeIn();
$("#result_units").text(result.units).fadeIn("slow");
$("#results_title").text("Results")
var row = $("<tr>").append("<td>"+val.replace(" ", " ")+"</td>").append("<td>"+result.val+" "+"<b>"+result.units+"</b></td>");
$('#table').append(row);
window.setTimeout(function() {$("#parsetest").val("")}, 1500);
};
</script>
</head>
<body>
<div class="wrapper" id="wrapper">
<div class="wrapper-title" style="height: 100px; padding-left: 25px; background-color: eeeeee; border-bottom: solid #999999">
<a href="https://learn.concord.org/sparks/">
<img class='no_border' src='common/icons/sparks-left-logo.png' style="float:left; height: 90px; margin: 5px"/>
</a>
<h1 style="padding: 25px; margin-left: 90px">
<span>Testing measurement parsing</span>
</h1>
</div>
<div id="primary">
<p style="padding-top: 25px;">
Enter a value the way you think a student might, and the hit Enter to see the parsed value.
</p>
<input id="parsetest" size="12" style="margin: 10px; margin-left: 80px; padding: 5px;">
<span id="result_val" style="margin-left: 30px;color: Green;font-size: 1.3em;"></span>
<span id="result_units" style="margin-left: 20px;color: Red;font-size: 1.3em;font-weight: bold;"></span>
<h2 id="results_title" style="margin: 40px"></h3>
<table id="table" style="margin: 30px; margin-top: -20px">
</table>
</div>
<div id="footer">
<span id="return_to_portal"><img src="common/icons/return.png">Return to the SPARKS Portal</span>
<div class="footer-inner">
<p id="footer_right"></p>
</div>
</div>
</div>
</body>
</html>