-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
43 lines (40 loc) · 1.33 KB
/
test.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>QTI WASM Proof of Concept</title>
</head>
<body>
<script type="module">
import init, {render_qti_as_html} from "./pkg/qti.js";
function renderQTI() {
let qtiInput = document.getElementById("editArea").value;
console.log(qtiInput);
let htmlOutput = render_qti_as_html(qtiInput);
console.log(htmlOutput);
document.getElementById("output").innerHTML = htmlOutput;
}
window.renderQTI = renderQTI;
init()
.then(() => {
renderQTI();
});
</script>
<div style="display: flex; width: 100%;">
<div style="width: 50%;">
<form id="editForm">
<textarea id="editArea" style="width: 90%; height: 300px;" onkeyup="renderQTI();" onchange="renderQTI();">
<qti-choice-interaction max-choices="1" min-choices="1" response-identifier="RESPONSE">
<qti-simple-choice identifier="A">Epinephrine</qti-simple-choice>
<qti-simple-choice identifier="B">Glucagon</qti-simple-choice>
<qti-simple-choice identifier="C">Insulin</qti-simple-choice>
<qti-simple-choice identifier="D">Oxytocin</qti-simple-choice>
</qti-choice-interaction>
</textarea>
</form>
</div>
<div id="output" style="width: 40%;">
<div>
</div>
</body>
</html>