From c3e0034d4ebcc65f9d31010141abb92ea4689096 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 9 Dec 2018 01:17:50 +0100 Subject: [PATCH] Fixes and added score --- docs/index.html | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/docs/index.html b/docs/index.html index 5f10e27..fd00205 100644 --- a/docs/index.html +++ b/docs/index.html @@ -43,6 +43,7 @@ function checkResp() { var val=document.getElementById("response").value; if(val<0) return; + document.getElementById("sendbtn").disabled=true; console.log(data[val]); document.getElementById("respyt").src="https://www.youtube.com/embed/"+data[val][2]; if(val==good) { @@ -50,18 +51,27 @@ res.innerText="Correct!"; res.style="color: #00AA00"; res=document.getElementById("resultP"); - res.innerText="Your answer is correct!"; + res.innerHTML="Your answer is correct!
You can watch the video below:"; res.style="color: #00AA00"; + + document.getElementById("score").innerText++; + document.getElementById("score").innerText++; + document.getElementById("score").innerText++; + document.getElementById("score").innerText++; //Heh - fixes casting problems } else { var res=document.getElementById("resultH"); res.innerText="Wrong!"; res.style="color: #AA0000"; res=document.getElementById("resultP"); - res.innerText="The correct answer is: \""+data[good][1]+"\""; + res.innerHTML="The correct answer is: \""+data[good][1]+"\"
" + + "You can watch both of the videos below:"; res.style="color: #AA0000"; document.getElementById("goodyt").src="https://www.youtube.com/embed/"+data[good][2]; document.getElementById("goodBlock").style="display: block"; + + document.getElementById("score").innerText--; + document.getElementById("score").innerText--; } document.getElementById("respBlock").style="display: block"; } @@ -70,6 +80,7 @@ document.getElementById("response").innerHTML=''; document.getElementById("goodBlock").style="display: none"; document.getElementById("respBlock").style="display: none"; + document.getElementById("sendbtn").disabled=false; getPhrase(); } @@ -89,13 +100,14 @@

Guess the video!

So you know those "info sections" in most of Tiffany's videos? Here you can see a word, phrase or sometimes a - sentence to comment on one of the videos. Can you guess which one it belongs to?

+ sentence to comment on one of the videos. Can you guess which video it belongs to?

+

Score: 20

Please enable JavaScript :P


- +