-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathuser.js
More file actions
37 lines (31 loc) · 1.06 KB
/
user.js
File metadata and controls
37 lines (31 loc) · 1.06 KB
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
// Array with stuff
const questions = ["match", "cones", "cubes"]
// Annoying button logic
function addition(element) {
// alert(element.id);
document.getElementById(element.id + "input").value = parseInt(document.getElementById(element.id + "input").value) + 1;
}
function subtraction(element) {
document.getElementById(element.id + "input").value = parseInt(document.getElementById(element.id + "input").value) - 1;
}
// html is mid
function getInputValue(element) {
var inputVal = document.getElementById(element + "input").value;
// alert(inputVal);
return inputVal;
}
function getQRCodeString() {
let qrCodeString = "";
for (i = 0; i < questions.length; i++) {
qrCodeString += getInputValue(questions[i]) + "|";
}
}
function generateQRCode() {
let qrCodeString = "";
for (i = 0; i < questions.length; i++) {
qrCodeString += getInputValue(questions[i]) + "|";
}
// alert(qrCodeString);
document.getElementById("qrcode").innerHTML = "";
new QRCode(document.getElementById("qrcode"), qrCodeString);
}