-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.html
153 lines (146 loc) · 6.98 KB
/
index.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
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
<head>
<title> Truth Table Creator </title>
<script type="text/javascript" src="js/libs/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="js/libs/handlebars-1.0.0.js"></script>
<script type="text/javascript" src="js/libs/ember.js"></script>
<script type="text/javascript" src="js/libs/boolean_evaluate.js"></script>
<script type="text/javascript" src="js/libs/boolean_print.js"></script>
<script type="text/javascript" src="js/libs/boolean_split.js"></script>
<script type="text/javascript" src="js/libs/boolean_split_2.js"></script>
<script type="text/javascript" src="js/libs/boolean_split_3.js"></script>
<script type="text/javascript" src="js/libs/underscore-min.js"></script>
<script type="text/javascript" src="js/app.js"></script>
<link rel="stylesheet" type="text/css" href="stylesheets/bootstrap.css">
<link rel="stylesheet" type="text/css" href="stylesheets/application.css">
</head>
<body>
<script type="text/x-handlebars" data-template-name="components/truth-row">
{{#each variable in variables}}
{{truth-variable selectedExpression=selectedExpression variable=variable index=row variables=variables tagName="td" classNames="large-font variable"}}
{{/each}}
{{#each node in ast}}
{{truth-node selectedExpression=selectedExpression mistakes=mistakes node=node variable=variables answered=answered row=row feedback=feedback evaluation=evaluation tagName="td" classNames="guess"}}
{{/each}}
</script>
<script type="text/x-handlebars" id="components/truth-node">
{{view App.TruthChecker size=1 maxlength=1 disabledBinding=evaluation valueBinding=guess cols=2 rows=1 colorBinding=colorCheck focus-in="updateSelectedExpression" focus-out="clearSelectedExpression" answerBinding=truthAssignment}}
</script>
<script type="text/x-handlebars" id="components/truth-variable">
<p>{{truthValue}}</p>
</script>
<script type="text/x-handlebars" data-template-name="application">
<div id="wrap">
<div id="main" class="container clear-top">
{{outlet}}
</div>
</div>
<footer class="footer"><p>LICENSE</p><p> You may use, redistribute, sell, modify this code as long as you credit Bastion Fennell, Eysa Lee, and Thomas Kim.</p><p>If modified, you must state that the code has been modified from its original form</p></footer>
</script>
<script type="text/x-handlebars" data-template-name="explain">
<div class="row title">
<h2> Truth Table Creator </h2>
</div>
<div class="row">
<p> Welcome to the interactive truth table app. This app is used for creating empty truth tables for you to fill out. Just enter a boolean expression below and it will break it apart into smaller subexpressions for you to solve in the truth table. </p>
<p> The app has two modes, immediate feedback and 'test' mode. Immediate feedback will immediately tell you when you get an answer wrong, while test mode won't tell you how many you got wrong until you submit the table. You can use the immediate feedback mode to practice, then use the test mode to make sure you understand everything. </p>
<p> To use the app, enter a boolean logic expression below. There is a legend to show you computer friendly ways to type each of the symbols that are normally used for boolean logic. Once you're done, pick which mode you want to use and create the table. Fill the tables with f's and t's and try to get all of the answers right. Good luck! </p>
<p>The source code for this project can be found here: <a href="https://github.com/Thomas-Kim/truth-tables">https://github.com/Thomas-Kim/truth-tables</a></p>
</div>
<div class="row">
<div class="col-md-4">
<div class="table">
<h3> Do not insert spaces</h3>
<table>
<thead>
<td>Operator</td>
<td>What to Type</td>
</thead>
<tbody>
<tr>
<td>∨</td>
<td>|</td>
</tr>
<tr>
<td>∧</td>
<td>&</td>
</tr>
<tr>
<td>→</td>
<td>-]</td>
</tr>
<tr>
<td>←</td>
<td>[-</td>
</tr>
<tr>
<td>¬</td>
<td>!</td>
</tr>
<tr>
<td>≡</td>
<td>=</td>
</tr>
<tr>
<td>XOR</td>
<td>X</td>
</tr>
<tr>
<td>NAND</td>
<td>D</td>
</tr>
<tr>
<td>NOR</td>
<td>R</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="col-md-8 expression-entry">
Expression: {{view App.ExpressionChecker valueBinding="expression" rows=1 invalidExpressionBinding="invalidExpression"}}
Want immediate feedback? {{input type="checkbox" checkedBinding="feedback"}}
{{#link-to 'truth' feedback expression}}<button {{bind-attr disabled="invalidExpression"}} class="enter-expression">Create Table</button>{{/link-to}}
</div>
</div>
</script>
<script type="text/x-handlebars" data-template-name="feedback">
{{outlet}}
</script>
<script type="text/x-handlebars" data-template-name="truth">
<div class="title row">
<h3> Truth Table for <strong>{{{formatted_expression}}}</strong></h3>
</div>
<div class="row">
<div class="table">
<table>
<thead>
{{#each variable in variables}}
<td class="large-font"> {{variable}} </td>
{{/each}}
{{#each node in ast_clean}}
<td class="large-font"> {{{node}}} </td>
{{/each}}
</thead>
<tbody>
{{#each given_number in number_list}}
{{truth-row ast=ast variables=variables row=given_number feedback=feedback tagName="tr" mistakes=mistakes answered=answered evaluation=evaluation}}
{{/each}}
</tbody>
</table>
<div class="row evaluation">
{{#if evaluation}}
<p>You answered {{answered}} out of {{total}}</p>
<p>You answered {{correct}} correctly</p>
<p>Your total score: {{percentageResult}}</p>
{{else}}
{{#if feedback_bool}}
<p> {{mistakes}} mistake{{#if pluralizeMistakes}}s{{/if}} made so far. </p>
{{else}}
<button {{action 'evaluate'}}>Evaluate </button>
{{/if}}
{{/if}}
</div>
</div>
</div>
</script>
</body>