Cache -> Cash
This commit is contained in:
parent
655971a000
commit
270025a1b4
@ -81,7 +81,7 @@ public class QuizzManagerImpl implements QuizzManager {
|
|||||||
if(qindex != data.get("index").intValue())
|
if(qindex != data.get("index").intValue())
|
||||||
return errorNode("You are not answering the right question (you answer question "+data.get("index").intValue()
|
return errorNode("You are not answering the right question (you answer question "+data.get("index").intValue()
|
||||||
+" where you should answer question "+qindex+")");
|
+" where you should answer question "+qindex+")");
|
||||||
if(qindex >= quizz.getPublicQuestionCount())
|
if(qindex >= Optional.ofNullable(quizz.getPublicQuestionCount()).orElse(Integer.MAX_VALUE))
|
||||||
return errorNode("La question suivante est encore bloquée");
|
return errorNode("La question suivante est encore bloquée");
|
||||||
Question q = questionRepository.findByQuizzAndIndex(quizz,qindex);
|
Question q = questionRepository.findByQuizzAndIndex(quizz,qindex);
|
||||||
if(q == null)
|
if(q == null)
|
||||||
@ -143,7 +143,7 @@ public class QuizzManagerImpl implements QuizzManager {
|
|||||||
if(qf.isDone())
|
if(qf.isDone())
|
||||||
return errorNode("No more questions");
|
return errorNode("No more questions");
|
||||||
int qindex = qf.getCurrentQuestion();
|
int qindex = qf.getCurrentQuestion();
|
||||||
if(qindex >= quizz.getPublicQuestionCount())
|
if(qindex >= Optional.ofNullable(quizz.getPublicQuestionCount()).orElse(Integer.MAX_VALUE))
|
||||||
return errorNode("La question suivante est encore bloquée");
|
return errorNode("La question suivante est encore bloquée");
|
||||||
Question q = questionRepository.findByQuizzAndIndex(quizz,qindex);
|
Question q = questionRepository.findByQuizzAndIndex(quizz,qindex);
|
||||||
if(q == null)
|
if(q == null)
|
||||||
|
|||||||
@ -15,11 +15,11 @@
|
|||||||
<div class="buttonbox" id="answer-select">
|
<div class="buttonbox" id="answer-select">
|
||||||
<button class="squared-button bcol1" id="answer-select-duo">Duo</button>
|
<button class="squared-button bcol1" id="answer-select-duo">Duo</button>
|
||||||
<button class="squared-button bcol2" id="answer-select-carre">Carré</button>
|
<button class="squared-button bcol2" id="answer-select-carre">Carré</button>
|
||||||
<button class="squared-button bcol3" id="answer-select-cache">Cache</button>
|
<button class="squared-button bcol3" id="answer-select-cash">Cash</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="buttonbox" id="answer-cache">
|
<div class="buttonbox" id="answer-cash">
|
||||||
<textarea class="squared-input" id="answer-cache-input" type="text"></textarea>
|
<textarea class="squared-input" id="answer-cash-input" type="text"></textarea>
|
||||||
<button class="squared-button bcol4" id="answer-cache-button">Envoyer la réponse</button>
|
<button class="squared-button bcol4" id="answer-cash-button">Envoyer la réponse</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="buttonbox" id="answer-duo">
|
<div class="buttonbox" id="answer-duo">
|
||||||
<button class="squared-button bcol1" id="answer-duo-button-1"></button>
|
<button class="squared-button bcol1" id="answer-duo-button-1"></button>
|
||||||
@ -71,17 +71,17 @@
|
|||||||
$("#answer-select").show()
|
$("#answer-select").show()
|
||||||
$("#answer-duo").hide()
|
$("#answer-duo").hide()
|
||||||
$("#answer-carre").hide()
|
$("#answer-carre").hide()
|
||||||
$("#answer-cache").hide()
|
$("#answer-cash").hide()
|
||||||
}else if(qstep==1){
|
}else if(qstep==1){
|
||||||
awrs = res["data"]["answers"]
|
awrs = res["data"]["answers"]
|
||||||
|
|
||||||
$("#answer-select").hide()
|
$("#answer-select").hide()
|
||||||
$("#answer-duo").hide()
|
$("#answer-duo").hide()
|
||||||
$("#answer-carre").hide()
|
$("#answer-carre").hide()
|
||||||
$("#answer-cache").hide()
|
$("#answer-cash").hide()
|
||||||
if(typeof awrs === 'undefined'){
|
if(typeof awrs === 'undefined'){
|
||||||
$("#answer-cache").show()
|
$("#answer-cash").show()
|
||||||
$("#answer-cache-input").val("")
|
$("#answer-cash-input").val("")
|
||||||
} else if (awrs.length == 2) {
|
} else if (awrs.length == 2) {
|
||||||
$("#answer-duo").show()
|
$("#answer-duo").show()
|
||||||
$("#answer-duo-button-1").text(res.data.answers[0])
|
$("#answer-duo-button-1").text(res.data.answers[0])
|
||||||
@ -139,7 +139,7 @@
|
|||||||
$("#answer-select").hide()
|
$("#answer-select").hide()
|
||||||
$("#answer-duo").hide()
|
$("#answer-duo").hide()
|
||||||
$("#answer-carre").hide()
|
$("#answer-carre").hide()
|
||||||
$("#answer-cache").hide()
|
$("#answer-cash").hide()
|
||||||
if(qindex+1 >= qlength) {
|
if(qindex+1 >= qlength) {
|
||||||
$("#question-text").text("Plus de questions !")
|
$("#question-text").text("Plus de questions !")
|
||||||
} else {
|
} else {
|
||||||
@ -157,11 +157,11 @@
|
|||||||
$("#answer-select").hide()
|
$("#answer-select").hide()
|
||||||
$("#answer-duo").hide()
|
$("#answer-duo").hide()
|
||||||
$("#answer-carre").hide()
|
$("#answer-carre").hide()
|
||||||
$("#answer-cache").hide()
|
$("#answer-cash").hide()
|
||||||
$("#answer-select-duo").on('click',() => answer1(2))
|
$("#answer-select-duo").on('click',() => answer1(2))
|
||||||
$("#answer-select-carre").on('click',() => answer1(4))
|
$("#answer-select-carre").on('click',() => answer1(4))
|
||||||
$("#answer-select-cache").on('click',() => answer1(0))
|
$("#answer-select-cash").on('click',() => answer1(0))
|
||||||
$("#answer-cache-button").on('click',() => answer2($("#answer-cache-input").val()))
|
$("#answer-cash-button").on('click',() => answer2($("#answer-cash-input").val()))
|
||||||
$("#answer-duo-button-1").on('click',() => answer2(awrs[0]))
|
$("#answer-duo-button-1").on('click',() => answer2(awrs[0]))
|
||||||
$("#answer-duo-button-2").on('click',() => answer2(awrs[1]))
|
$("#answer-duo-button-2").on('click',() => answer2(awrs[1]))
|
||||||
$("#answer-carre-button-1").on('click',() => answer2(awrs[0]))
|
$("#answer-carre-button-1").on('click',() => answer2(awrs[0]))
|
||||||
|
|||||||
@ -64,7 +64,7 @@
|
|||||||
dcc = "duo"
|
dcc = "duo"
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
dcc = "cache"
|
dcc = "cash"
|
||||||
}
|
}
|
||||||
html = `
|
html = `
|
||||||
<li class="dcc-box" id="q-${id}">
|
<li class="dcc-box" id="q-${id}">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user