-
Notifications
You must be signed in to change notification settings - Fork 0
/
old.html
220 lines (173 loc) · 7.12 KB
/
old.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
<!DOCTYPE html>
<html>
<body>
<h2> Seville </h2>
<form action="https://docs.google.com/forms/d/e/1FAIpQLSeBzokJL941yd1cK6EpZZAfNr_4UjUTi-irPZdsHYHK0ksAug/formResponse" method="post" target="_blank">
Student's Full name (Exactly as written): <input type="text" id=formName /> <br>
<input type="hidden" id=processedLastName name="entry.1492703236" value="lastName" />
<input type="hidden" id=processedFirstName name="entry.691428241" value="firstName" />
<!-- Location -->
<input type="hidden" name="entry.2016812996" value="Sevilla" />
<!-- Friday date -->
<!-- still needs processing, is just giving you today's date -->
<input type="hidden" id=formMonth name="entry.610744709_month" value="month" />
<input type="hidden" id=formDay name="entry.610744709_day" value="day" />
<input type="hidden" id=formYear name="entry.610744709_year" value="year" />
<!-- Pass or Fail -->
<input type="hidden" name="entry.1586687761" value="Pass" />
<!-- ISO Week Number -->
<input type="hidden" id=processedISOWeekNumber name="entry.2070190421" value="ISOWeekNumber" />
Group: <input type="text" name="entry.7297452" /> <br>
Teacher's Name(s): <input type="text" name="entry.1453395066" /> <br> <br>
<!-- Level at Beginning -->
<input type="hidden" id=levelAtBeginning name="entry.1977718501" value="levelAtBeginning" />
<!-- Level at End -->
<input type="hidden" id=levelAtEnd name="entry.1619190485" value="levelAtEnd" />
Beginning Level: <input type="number" step=0.1 id=beginningLevel /> <br> <!-- we need beginning level to process changed level -->
End Level: <input type="number" step=0.1 id=endLevel name="entry.1815583882" /> <br> <br> <!-- note: also send this off as "final score" -->
<!-- Changed Level -->
<input type="hidden" id=changedLevel name="entry.502099535" value="changedLevel" />
Fluency: <input type="number" id="fluency" name="entry.1839803024" min="1" max="5" value="3"> <br>
Pronunciation: <input type="number" id="pronunciation" name="entry.498561152" min="1" max="5" value="3"> <br>
Grammar: <input type="number" id="grammar" name="entry.1379348697" min="1" max="5" value="3"> <br>
Vocabulary: <input type="number" id="vocabulary" name="entry.835827768" min="1" max="5" value="3"> <br>
Comprehension: <input type="number" id="comprehension" name="entry.1952347568" min="1" max="5" value="3"> <br> <br>
Homework: <input type="number" id="formHomework" name="entry.2054164790" min="1" max="5" value="5"> <br>
Participation: <input type="number" id="formParticipation" name="entry.230056582" min="1" max="5" value="5"> <br> <br>
Comment: <textarea cols="40" rows="5" name="entry.1141405581"></textarea> <br>
<br>
<input type="submit" onclick="appendRedundancy()" value="Submit">
</form>
<script>
function appendRedundancy()
{
// Separate Name
var nameValue = document.getElementById("formName").value;
var splitName = nameValue.split(", ");
document.getElementById("processedLastName").value = splitName[0];
document.getElementById("processedFirstName").value = splitName[1];
// Process date
var today = new Date();
var tomorrow = new Date(today.getTime() + (24 * 60 * 60 * 1000));
//document.getElementById("formDate").value = d.toDateString();
document.getElementById("formMonth").value = tomorrow.getMonth()+1;
document.getElementById("formDay").value = tomorrow.getDate();
document.getElementById("formYear").value = tomorrow.getFullYear();
function getWeekNumber(d)
{
// Copy date so don't modify original
d = new Date(Date.UTC(d.getFullYear(), d.getMonth(), d.getDate()));
// Set to nearest Thursday: current date + 4 - current day number
// Make Sunday's day number 7
d.setUTCDate(d.getUTCDate() + 4 - (d.getUTCDay()||7));
// Get first day of year
var yearStart = new Date(Date.UTC(d.getUTCFullYear(),0,1));
// Calculate full weeks to nearest Thursday
var weekNo = Math.ceil(( ( (d - yearStart) / 86400000) + 1)/7);
// Return array of year and week number
return weekNo;
}
// Process ISO week number
document.getElementById("processedISOWeekNumber").value = getWeekNumber(today);
// START Process Levels + Changed
var begLvl = parseFloat(document.getElementById("beginningLevel").value);
var endLvl = parseFloat(document.getElementById("endLevel").value);
var begCEFRLvl = ""; // A1, A2, B1, B2, C1, C2
var endCEFRLvl = ""; // A1, A2, B1, B2, C1, C2
var levelChanged = false;
function berlitz2CEFR(berlitz)
{
if (berlitz < 1.6) { return "A1" }
else if (berlitz < 3.6) { return "A2" }
else if (berlitz < 5.6) { return "B1" }
else if (berlitz < 7.6) { return "B2" }
else if (berlitz < 9.1) { return "C1" }
else if (berlitz >= 9.1) {return "C2" }
else return "ERROR";
}
// get CEFR Levels
begCEFRLvl = berlitz2CEFR(begLvl);
endCEFRLvl = berlitz2CEFR(endLvl);
document.getElementById("levelAtBeginning").value = begCEFRLvl;
document.getElementById("levelAtEnd").value = endCEFRLvl;
if (begCEFRLvl == endCEFRLvl)
{
document.getElementById("changedLevel").value = "NO";
levelChanged = false;
}
else
{
document.getElementById("changedLevel").value = "YES";
levelChanged = true;
}
// REMOVED IN FAVOUR OF SIMPLER 'DEFAULT 3' SYSTEM
/*
function adjustToScore(endLvl, nudge)
{
var distanceLow = 0.0;
var distanceHigh = 0.0;
if (levelChanged) {return "5";};
if (endCEFRLvl == "A1")
{
distanceLow = 0.0;
distanceHigh = 1.5;
}
if (endCEFRLvl == "A2")
{
distanceLow = 1.6;
distanceHigh = 3.5;
}
if (endCEFRLvl == "B1")
{
distanceLow = 3.6;
distanceHigh = 5.5;
}
if (endCEFRLvl == "B2")
{
distanceLow = 5.6;
distanceHigh = 7.5;
}
if (endCEFRLvl == "C1")
{
distanceLow = 7.6;
distanceHigh = 9.0;
}
if (endCEFRLvl == "C2")
{
distanceLow = 9.6;
distanceHigh = 12.0;
}
var range = distanceHigh - distanceLow;
var stepSize = range / 5.0;
var score = endLvl - distanceLow;
var result = Math.floor(score / stepSize) + 1;
result += parseFloat(nudge);
// don't let the result go below 3
if (result < 3) result = 3;
if (result > 5) result = 5;
return result;
}
var nudgeA = document.getElementById("nudgeFluency").value;
var nudgeB = document.getElementById("nudgePronunciation").value;
var nudgeC = document.getElementById("nudgeGrammar").value;
var nudgeD = document.getElementById("nudgeVocabulary").value;
var nudgeE = document.getElementById("nudgeComprehension").value;
document.getElementById("fluency").value = adjustToScore(endLvl, nudgeA);
document.getElementById("pronunciation").value = adjustToScore(endLvl, nudgeB);
document.getElementById("grammar").value = adjustToScore(endLvl, nudgeC);
document.getElementById("vocabulary").value = adjustToScore(endLvl, nudgeD);
document.getElementById("comprehension").value = adjustToScore(endLvl, nudgeE);
*/
// If the level has changed, make sure all the skills are set at 5!
if (levelChanged)
{
document.getElementById("fluency").value = 5;
document.getElementById("pronunciation").value = 5;
document.getElementById("grammar").value = 5;
document.getElementById("vocabulary").value = 5;
document.getElementById("comprehension").value = 5;
}
}
</script>
</body>
</html>