Easier start of final mode
This commit is contained in:
parent
646d5ef89e
commit
197d35718b
@ -108,12 +108,15 @@ $(document).ready(function() {
|
|||||||
var questionSelected = $("#finalFragenSelect").val();
|
var questionSelected = $("#finalFragenSelect").val();
|
||||||
questionSelected--;
|
questionSelected--;
|
||||||
if (questionSelected < 0) {
|
if (questionSelected < 0) {
|
||||||
$("#finalFragenSelect").val(4);
|
// $("#finalFragenSelect").val(0);
|
||||||
} else {
|
} else {
|
||||||
$("#finalFragenSelect").val(questionSelected)
|
$("#finalFragenSelect").val(questionSelected)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (index > 0) {
|
||||||
setFrageIndex(index);
|
setFrageIndex(index);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#downQicon").click(function() {
|
$("#downQicon").click(function() {
|
||||||
@ -123,12 +126,15 @@ $(document).ready(function() {
|
|||||||
var questionSelected = $("#finalFragenSelect").val();
|
var questionSelected = $("#finalFragenSelect").val();
|
||||||
questionSelected++;
|
questionSelected++;
|
||||||
if (questionSelected > 4) {
|
if (questionSelected > 4) {
|
||||||
$("#finalFragenSelect").val(0);
|
// $("#finalFragenSelect").val(0);
|
||||||
} else {
|
} else {
|
||||||
$("#finalFragenSelect").val(questionSelected)
|
$("#finalFragenSelect").val(questionSelected)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (index < 8) {
|
||||||
setFrageIndex(index);
|
setFrageIndex(index);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#questionsSelect").on("change", function() {
|
$("#questionsSelect").on("change", function() {
|
||||||
@ -198,7 +204,24 @@ function setFinalMode(status){
|
|||||||
var index = $("#questionsSelect>option:selected").index();
|
var index = $("#questionsSelect>option:selected").index();
|
||||||
index = index > 0 ? index : 0;
|
index = index > 0 ? index : 0;
|
||||||
$("#answers").empty();
|
$("#answers").empty();
|
||||||
|
|
||||||
|
// automatically select first of the final questions (index 3)
|
||||||
|
if (isFinalMode < 3) {
|
||||||
|
index = 3;
|
||||||
|
}
|
||||||
|
|
||||||
loadQuestionToGui(index);
|
loadQuestionToGui(index);
|
||||||
|
|
||||||
|
// manually select option once final mode starts
|
||||||
|
if (isFinalMode) {
|
||||||
|
if (index >= 0 && index < $("#questionsSelect").find("option").length) {
|
||||||
|
$("#questionsSelect").find("option").removeAttr("selected");
|
||||||
|
$($("#questionsSelect").find("option")[index]).prop("selected", "true");
|
||||||
|
}
|
||||||
|
if ($("#questionsSelect>option:selected").index() == -1 && $("#questionsSelect").find("option")[0]) {
|
||||||
|
$($("#questionsSelect").find("option")[0]).prop("selected", "true");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setPlayer2(value){
|
function setPlayer2(value){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user