-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevaluationForm.html
236 lines (235 loc) · 12.8 KB
/
evaluationForm.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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>SQL Parser Evaluation Form</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="//fonts.googleapis.com/css?family=Raleway:400,300,600" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/skeleton.css">
</head>
<body>
<div class="container">
<div class="grid-container" align="center" style="display: grid; grid-template-columns: auto auto; padding: 10px; grid-gap: 4px;">
<div class="grid-item"><a class="button" href="/SQL Parser/index.html">SQL Parser</a></div>
<div class="grid-item"><a class="button" href="/SQL Parser/evaluationForm.html">Evaluation Form</a></div>
</div>
<br />
<h3>Evaluation Form</h3>
<h5>For each query below please choose the feedback that more clearly identifies the error.</h5>
<form id="submitSurvey">
<hr>
<h4>Query 1</h4>
<div class="row">
<div class="four columns"><b>Invalid Query</b><br>select * from</div>
<div class="eight columns"><b>Problem</b><br>No table name after “from”</div>
</div>
<br>
<div class="row">
<div class="four columns"><b>Parser A feedback</b><br>“Unexpected end of input” at character 9.</div>
<div class="eight columns"><b>Parser B feedback</b><br>The "from" clause at character 9 is missing one of the following: databaseObjectName. This may be a table name, column name, data type etc.</div>
</div>
<br>
<div class="row">
<b>Which provides more useful feedback?</b>
A <input type="radio" name="Q1" value="A" required> B <input type="radio" name="Q1" value="B">
<br>
<textarea cols="80" name="comment1" id="comment1" placeholder="Why? (optional)"></textarea>
</div>
<hr>
<h4>Query 2</h4>
<div class="row">
<div class="four columns"><b>Invalid Query</b><br>Select column from example</div>
<div class="eight columns"><b>Problem</b><br>Column is a reserved keyword</div>
</div>
<br>
<div class="row">
<div class="four columns"><b>Parser A feedback</b><br>“unexpected ‘column’ (column)” at character 7.</div>
<div class="eight columns"><b>Parser B feedback</b><br>"select" at character 0 cannot have the reserved clause "column" at character 7.</div>
</div>
<br>
<div class="row">
<b>Which provides more useful feedback?</b>
A <input type="radio" name="Q2" value="A" required> B <input type="radio" name="Q2" value="B">
<br>
<textarea cols="80" name="comment2" id="comment2" placeholder="Why? (optional)"></textarea>
</div>
<hr>
<h4>Query 3</h4>
<div class="row">
<div class="four columns"><b>Invalid Query</b><br>select * from ()</div>
<div class="eight columns"><b>Problem</b><br>No sub-query between brackets</div>
</div>
<br>
<div class="row">
<div class="four columns"><b>Parser A feedback</b><br>“unexpected ‘)’ (closing parenthesis)” at character 16.</div>
<div class="eight columns"><b>Parser B feedback</b><br>There is no text between "from" at character 9 and ")" at character 16 but one or more of the following are required: databaseObjectName</div>
</div>
<br>
<div class="row">
<b>Which provides more useful feedback?</b>
A <input type="radio" name="Q3" value="A" required> B <input type="radio" name="Q3" value="B">
<br>
<textarea cols="80" name="comment3" id="comment3" placeholder="Why? (optional)"></textarea>
</div>
<hr>
<h4>Query 4</h4>
<div class="row">
<div class="four columns"><b>Invalid Query</b><br>select "blah from example</div>
<div class="eight columns"><b>Problem</b><br>Unclosed double quote before “blah”</div>
</div>
<br>
<div class="row">
<div class="four columns"><b>Parser A feedback</b><br>“unexpected end of input” at character 0.<br>
“unfinished double quote string" at character 7 and after.</div>
<div class="eight columns"><b>Parser B feedback</b><br>There is an unclosed ", if it is not in a text string and escaped (\") it may cause an error.</div>
</div>
<br>
<div class="row">
<b>Which provides more useful feedback?</b>
A <input type="radio" name="Q4" value="A" required> B <input type="radio" name="Q4" value="B">
<br>
<textarea cols="80" name="comment4" id="comment4" placeholder="Why? (optional)"></textarea>
</div>
<hr>
<h4>Query 5</h4>
<div class="row">
<div class="four columns"><b>Invalid Query</b><br>select * from example where column1 = 1)</div>
<div class="eight columns"><b>Problem</b><br>Unclosed bracket after the “1</div>
</div>
<br>
<div class="row">
<div class="four columns"><b>Parser A feedback</b><br>“extraneous input found - expected end of input” for “)” at character 39</div>
<div class="eight columns"><b>Parser B feedback</b><br>The ) at character 39 is unbalanced and may cause an error.</div>
</div>
<br>
<div class="row">
<b>Which provides more useful feedback?</b>
A <input type="radio" name="Q5" value="A" required> B <input type="radio" name="Q5" value="B">
<br>
<textarea cols="80" name="comment5" id="comment5" placeholder="Why? (optional)"></textarea>
</div>
<hr>
<h4>Query 6</h4>
<div class="row">
<div class="four columns"><b>Invalid Query</b><br>select "blah' from example</div>
<div class="eight columns"><b>Problem</b><br>Two different quotes where there should be one type</div>
</div>
<br>
<div class="row">
<div class="four columns"><b>Parser A feedback</b><br>“unexpected end of input” at character 0.<br>
“unfinished double quote string” at character 7.</div>
<div class="eight columns"><b>Parser B feedback</b><br>There is an unclosed ', if it is not in a text string and escaped (') it may cause an error.<br>
There is an unclosed ", if it is not in a text string and escaped (\") it may cause an error.<br>
Single and double quotes are used, if possible use one type for consistency.</div>
</div>
<br>
<div class="row">
<b>Which provides more useful feedback?</b>
A <input type="radio" name="Q6" value="A" required> B <input type="radio" name="Q6" value="B">
<br>
<textarea cols="80" name="comment6" id="comment6" placeholder="Why? (optional)"></textarea>
</div>
<hr>
<h4>Query 7</h4>
<div class="row">
<div class="four columns"><b>Invalid Query</b><br>select * from order by</div>
<div class="eight columns"><b>Problem</b><br>No table name and no column names after the order by clause</div>
</div>
<br>
<div class="row">
<div class="four columns"><b>Parser A feedback</b><br>“unexpected ‘order’ (order)” at character 14.<br>
“unexpected end of input” at character 20.</div>
<div class="eight columns"><b>Parser B feedback</b><br>There is no text between "from" at character 9 and "order" at character 14 but one or more of the following are required: databaseObjectName<br>
The "by" clause at character 20 is missing one of the following: databaseObjectName. This may be a table name, column name, data type etc.</div>
</div>
<br>
<div class="row">
<b>Which provides more useful feedback?</b>
A <input type="radio" name="Q7" value="A" required> B <input type="radio" name="Q7" value="B">
<br>
<textarea cols="80" name="comment7" id="comment7" placeholder="Why? (optional)"></textarea>
</div>
<hr>
<h4>Query 8</h4>
<div class="row">
<div class="four columns"><b>Invalid Query</b><br>Select * from example order by column1 blah</div>
<div class="eight columns"><b>Problem</b><br>No comma between columns column1 and blah after the “by” clause</div>
</div>
<br>
<div class="row">
<div class="four columns"><b>Parser A feedback</b><br>“extraneous input found - expected end of input” at character 37.</div>
<div class="eight columns"><b>Parser B feedback</b><br>Object names after clause "by" at character 28 should have one of the following separators between its values: ,</div>
</div>
<br>
<div class="row">
<b>Which provides more useful feedback?</b>
A <input type="radio" name="Q8" value="A" required> B <input type="radio" name="Q8" value="B">
<br>
<textarea cols="80" name="comment8" id="comment8" placeholder="Why? (optional)"></textarea>
</div>
<hr>
<h4>Query 9</h4>
<div class="row">
<div class="four columns"><b>Invalid Query</b><br>select * update from example</div>
<div class="eight columns"><b>Problem</b><br>“update” is not valid in the select query</div>
</div>
<br>
<div class="row">
<div class="four columns"><b>Parser A feedback</b><br>“unexpected ‘update’ (update) at character 9</div>
<div class="eight columns"><b>Parser B feedback</b><br>"select" at character 0 cannot have the reserved clause "update" at character 9<br>
"update" at character 9 cannot have the reserved clause "from" at character 16<br>
The "update" clause at character 9 is missing one of the following clauses after it: set</div>
</div>
<br>
<div class="row">
<b>Which provides more useful feedback?</b>
A <input type="radio" name="Q9" value="A" required> B <input type="radio" name="Q9" value="B">
<br>
<textarea cols="80" name="comment9" id="comment9" placeholder="Why? (optional)"></textarea>
</div>
<hr>
<h4>Query 10</h4>
<div class="row">
<div class="four columns"><b>Invalid Query</b><br>select * from example group by avg(blah)</div>
<div class="eight columns"><b>Problem</b><br>Cannot use the aggregate function “avg” with “group by”</div>
</div>
<br>
<div class="row">
<div class="four columns"><b>Parser A feedback</b><br>Error Code: 1111. Invalid use of group function</div>
<div class="eight columns"><b>Parser B feedback</b><br>"by" at character 28 cannot have the reserved clause "avg" at character 31<br>
Error 1111 one of the group by clauses are not used correctly, character/s: 22.<br>
Group by should be followed by column names with , separating them.<br>
The following aggregate functions appear to be with the group clause but should be used with a Having clause: avg at 31.</div>
</div>
<br>
<div class="row">
<b>Which provides more useful feedback?</b>
A <input type="radio" name="Q10" value="A" required> B <input type="radio" name="Q10" value="B">
<br>
<textarea cols="80" name="comment10" id="comment10" placeholder="Why? (optional)"></textarea>
</div>
<br>
<button type="submit" id="submitSurveybtn" style="font-size: 18px;">Submit Survey</button>
</form>
</div>
</body>
<script src="https://code.jquery.com/jquery-3.3.1.js" type="text/javascript"></script>
<script>
$("#submitSurvey").submit(function(event) { // Form submit, ajax used instead of regular post so no refresh on failing to submit.
let request;
event.preventDefault();
if (request) {request.abort();}
request = $.ajax({url: "surveySubmit.php", type: "post", data: $('#submitSurvey').serialize()});
request.done(function (response) { // success handler
if (response.includes("Results added to table")) {
window.alert("Your feedback has been submitted, thank you for your time.");
window.location.href = "../SQL Parser/index.html";
} else {
window.alert("Error, please notify [email protected] of this error: " + response);
}
});
request.fail(function (textStatus, errorThrown){Window.alert("Error, please notify [email protected] of this error: " + textStatus + " " + errorThrown);}); // Failure handler
});
</script>
</html>