implement question explanation
This commit is contained in:
parent
888b1f3c08
commit
0b47409f51
|
@ -6,7 +6,9 @@
|
||||||
{ "text": "Monatlich auf FTP" },
|
{ "text": "Monatlich auf FTP" },
|
||||||
{ "text": "Nie",
|
{ "text": "Nie",
|
||||||
"right": true }
|
"right": true }
|
||||||
] },
|
],
|
||||||
|
"explanation": { "text": "Deshalb ist die Hälfte weg." }
|
||||||
|
},
|
||||||
{ "text": "Was meint dieses Logo?",
|
{ "text": "Was meint dieses Logo?",
|
||||||
"image": "http://www.c3d2.de/images/ck.png",
|
"image": "http://www.c3d2.de/images/ck.png",
|
||||||
"tier": 100,
|
"tier": 100,
|
||||||
|
|
33
quiz.js
33
quiz.js
|
@ -174,19 +174,7 @@ function takeJoker(activePlayer, joker) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Game screen is the one with the question in question
|
function setQuestionContents(q) {
|
||||||
function switchToGame() {
|
|
||||||
var i, q = questions[currentQuestion];
|
|
||||||
var activePlayer = null, choice = null; // can be null
|
|
||||||
|
|
||||||
var updateTier = function() {
|
|
||||||
var s = q.tier;
|
|
||||||
if (activePlayer !== null)
|
|
||||||
s += ' — ' + playerNames[activePlayer];
|
|
||||||
$('#tier').text(s);
|
|
||||||
};
|
|
||||||
updateTier();
|
|
||||||
|
|
||||||
$('#question').empty();
|
$('#question').empty();
|
||||||
if (q.text) {
|
if (q.text) {
|
||||||
$('#question').append('<p></p>');
|
$('#question').append('<p></p>');
|
||||||
|
@ -200,6 +188,22 @@ function switchToGame() {
|
||||||
$('#question').append('<video controls autoplay>');
|
$('#question').append('<video controls autoplay>');
|
||||||
$('#question video').attr('src', q.video);
|
$('#question video').attr('src', q.video);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Game screen is the one with the question in question
|
||||||
|
function switchToGame() {
|
||||||
|
var i, q = questions[currentQuestion];
|
||||||
|
var activePlayer = null, choice = null; // can be null
|
||||||
|
|
||||||
|
var updateTier = function() {
|
||||||
|
var s = q.tier;
|
||||||
|
if (activePlayer !== null)
|
||||||
|
s += ' — ' + playerNames[activePlayer];
|
||||||
|
$('#tier').text(s);
|
||||||
|
};
|
||||||
|
updateTier();
|
||||||
|
|
||||||
|
setQuestionContents(q);
|
||||||
|
|
||||||
for(i = 0; i < 4; i++) {
|
for(i = 0; i < 4; i++) {
|
||||||
var answer = q.answers[i];
|
var answer = q.answers[i];
|
||||||
|
@ -237,6 +241,9 @@ function switchToGame() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
updateScores();
|
updateScores();
|
||||||
|
timer.halt();
|
||||||
|
if (q.explanation)
|
||||||
|
setQuestionContents(q.explanation);
|
||||||
|
|
||||||
// Hilight all right choices
|
// Hilight all right choices
|
||||||
var i = 0;
|
var i = 0;
|
||||||
|
|
Loading…
Reference in New Issue