-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
171 lines (159 loc) · 7.52 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<!DOCTYPE html>
<html>
<head>
<!-- 1. Load platform.js for polyfill support. -->
<script src="bower_components/platform/platform.js"></script>
<!-- 2. Use an HTML Import to bring in the element. -->
<link rel="import"
href="qti2-webcomponents/qti2-itemBody.html">
<link rel="import"
href="qti2-webcomponents/qti2-extendedTextInteraction.html">
<link rel="import"
href="qti2-webcomponents/qti2-textEntryInteraction.html">
<link rel="import"
href="qti2-webcomponents/qti2-hottextInteraction.html">
<link rel="import"
href="qti2-webcomponents/qti2-inlineChoiceInteraction.html">
<link rel="import"
href="qti2-webcomponents/qti2-prompt.html">
<link rel="import"
href="qti2-webcomponents/qti2-feedbackInline.html">
<link rel="import"
href="qti2-webcomponents/qti2-feedbackBlock.html">
<link rel="import"
href="qti2-webcomponents/qti2-choiceInteraction.html">
<link rel="import"
href="qti2-webcomponents/qti2-controller.html">
<script>
var qtiVariables = {
response: {
"RESPONSE1": {
identifier: "RESPONSE1",
cardinality: "single",
baseType: "identifier",
defaultValue: ["B"]
},
"RESPONSE2": {
identifier: "RESPONSE2",
cardinality: "single",
baseType: "identifier",
defaultValue: ["Y"]
},
"RESPONSE3": {
identifier: "RESPONSE3",
cardinality: "single",
baseType: "identifier",
defaultValue: ["ChoiceB"]
},
"BIM": {
identifier: "BIM",
cardinality: "single",
baseType: "string",
value: ["2345"]
},
"EXTTEXT": {
identifier: "EXTTEXT",
cardinality: "multiple",
baseType: "string",
value: ["10 drummers drumming", "9 ladies dancing"]
},
"numAttempts": {
identifier: "numAttempts",
cardinality: "single",
baseType: "integer",
value: 3
},
"duration": {
identifier: "duration",
cardinality: "single",
baseType: "float",
value: 0
},
},
outcome: {
"TEST": {
identifier: "TEST",
cardinality: "single",
baseType: "identifier",
value: "bim"
},
"FEEDBACK": {
identifier: "FEEDBACK",
cardinality: "single",
baseType: "identifier",
value: "MGH001D"
}
}
};
document.addEventListener('polymer-ready', function() {
document.querySelector('#showVars').addEventListener('click', function(e) {
e.preventDefault();
console.log(qtiVariables);
});
document.querySelector('#fakeSubmission').addEventListener('click', function(e) {
e.preventDefault();
console.log(qtiVariables);
});
});
</script>
<style>
</style>
</head>
<body>
<qti2-controller sessionVariableName="qtiVariables"></qti2-controller>
<qti2-itemBody>
<qti2-extendedTextInteraction placeholderText="Something like this..."
expectedLength="20" format="plain" patternMask="^\d.*" expectedLines="14" maxStrings="3" responseIdentifier="EXTTEXT"></qti2-extendedTextInteraction>
<qti2-textEntryInteraction expectedLength="4" responseIdentifier="BIM" placeholderText="4 digit number" patternMask="^\d{4}$"></qti2-textEntryInteraction>
<qti2-hottextInteraction responseIdentifier="RESPONSE1" maxChoices="1">
<p>Sponsors of the Olympic Games <qti2-hottext identifier="A">who bought</qti2-hottext>
advertising time on United States television <qti2-hottext identifier="B">includes</qti2-hottext>
<qti2-hottext identifier="C">at least</qti2-hottext> a dozen international firms <qti2-hottext
identifier="D">whose</qti2-hottext> names are familiar to American consumers.
<qti2-hottext identifier="E">No error.</qti2-hottext>
</p>
</qti2-hottextInteraction>
<blockquote>
<p>Now is the winter of our discontent<br/> Made glorious summer by this sun of
<qti2-inlineChoiceInteraction responseIdentifier="RESPONSE2" shuffle="true">
<qti2-inlineChoice identifier="G">Gloucester</qti2-inlineChoice>
<qti2-inlineChoice identifier="L">Lancaster</qti2-inlineChoice>
<qti2-inlineChoice identifier="Y">York</qti2-inlineChoice>
</qti2-inlineChoiceInteraction>;<br/> And all the clouds that lour'd upon our house<br/>
In the deep bosom of the ocean buried.</p>
</blockquote>
<p>Look at the text in the picture.</p>
<p>
<img src="images/sign.png" alt="NEVER LEAVE LUGGAGE UNATTENDED"/>
</p>
<qti2-choiceInteraction responseIdentifier="RESPONSE3" shuffle="false" maxChoices="1">
<qti2-prompt>What does it say?</qti2-prompt>
<qti2-simpleChoice identifier="ChoiceA">You must stay with your luggage at all times.</qti2-simpleChoice>
<qti2-simpleChoice identifier="ChoiceB">Do not let someone else look after your luggage.</qti2-simpleChoice>
<qti2-simpleChoice identifier="ChoiceC">Remember your luggage when you leave.</qti2-simpleChoice>
</qti2-choiceInteraction>
<qti2-feedbackBlock outcomeIdentifier="TEST" showHide="show" identifier="bim">Hello from feedbackBlock</qti2-feedbackBlock>
<qti2-choiceInteraction responseIdentifier="RESPONSE" shuffle="false" maxChoices="1">
<qti2-prompt>Who is the President of Mexico?</qti2-prompt>
<qti2-simpleChoice identifier="MGH001A"> George W Bush <qti2-feedbackInline
outcomeIdentifier="FEEDBACK" identifier="MGH001A" showHide="show">No, he is the
President of the USA.</qti2-feedbackInline>
</qti2-simpleChoice>
<qti2-simpleChoice identifier="MGH001B"> Tony Blair <qti2-feedbackInline
outcomeIdentifier="FEEDBACK" identifier="MGH001B" showHide="show">No, he is the
Prime Minister of England.</qti2-feedbackInline>
</qti2-simpleChoice>
<qti2-simpleChoice identifier="MGH001C"> Vicente Fox <qti2-feedbackInline
outcomeIdentifier="FEEDBACK" identifier="MGH001C" showHide="show"
>Yes.</qti2-feedbackInline>
</qti2-simpleChoice>
<qti2-simpleChoice identifier="MGH001D"> Ariel Sharon <qti2-feedbackInline
outcomeIdentifier="FEEDBACK" identifier="MGH001D" showHide="show">No, he is the
Prime Minister of Israel.</qti2-feedbackInline>
</qti2-simpleChoice>
</qti2-choiceInteraction>
<qti2-itemBody>
<button id="fakeSubmission">Fake submission</button>
<button id="showVars">Show variables</button>
</body>
</html>