BIG refactor
This commit is contained in:
29
index.js
29
index.js
@@ -6,21 +6,32 @@ function nameSubmit() {
|
|||||||
id: sId,
|
id: sId,
|
||||||
startTime: Date.now(),
|
startTime: Date.now(),
|
||||||
};
|
};
|
||||||
const sampleQuestion = {
|
localStorage.setItem("studData", JSON.stringify(studData));
|
||||||
title: "5x5?",
|
|
||||||
answers:
|
|
||||||
}
|
|
||||||
const sampleAnswer {
|
|
||||||
text: "answer 1",
|
|
||||||
correct: true,
|
|
||||||
},
|
|
||||||
localStorage.setItem(studData, JSON.stringify(studData));
|
|
||||||
var privacyViolation = document.getElementById("privacyViolation");
|
var privacyViolation = document.getElementById("privacyViolation");
|
||||||
privacyViolation.style.display = "none";
|
privacyViolation.style.display = "none";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//////////////////////////////
|
||||||
|
// const sampleQuestion = { //
|
||||||
|
// title: "5x5?", //
|
||||||
|
// //answers: //
|
||||||
|
// }; //
|
||||||
|
// const sampleAnswer = { //
|
||||||
|
// text: "answer 1", //
|
||||||
|
// correct: true, //
|
||||||
|
// }; //
|
||||||
|
//////////////////////////////
|
||||||
function initScore() {
|
function initScore() {
|
||||||
const user = JSON.parse(localStorage.getItem("studData"));
|
const user = JSON.parse(localStorage.getItem("studData"));
|
||||||
|
var sInfoName = document.getElementById("sInfoName");
|
||||||
|
var sInfoId = document.getElementById("sInfoId");
|
||||||
|
sInfoName.innerText = "Student name: " + user.name;
|
||||||
|
sInfoId.innerText = "Student ID: " + user.id;
|
||||||
|
var scoreScreen = document.getElementById("scoreScreen");
|
||||||
|
// console.log(user.name);
|
||||||
|
// console.log(sInfoId.innerText);
|
||||||
|
scoreScreen.style.display = "block";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function nextQ() {
|
function nextQ() {
|
||||||
|
|||||||
Reference in New Issue
Block a user