|
|
@@ -300,6 +300,7 @@ QuizzBot.prototype.sendNextHint = function(resetTimer) {
|
|
|
}
|
|
|
|
|
|
QuizzBot.prototype.nextQuestionWrapper = function() {
|
|
|
+ this.previousQuestion = this.currentQuestion ? this.currentQuestion.id : null;
|
|
|
this.currentQuestion.end();
|
|
|
this.currentQuestion = null;
|
|
|
setTimeout(this.nextQuestion.bind(this), this.config.NEXT_QUESTION_DELAY);
|
|
|
@@ -424,7 +425,7 @@ QuizzBot.prototype.buildOverpassedMessage = function(username, diff) {
|
|
|
exaequo = " est aux coude a coude avec " +diff.exaequo.map(i => i.name).join(", ");
|
|
|
if (!diff.users || !diff.users.length)
|
|
|
return exaequo ? (username +exaequo) : null;
|
|
|
- exaequo = " et" +exaequo;
|
|
|
+ exaequo = exaequo ? (" et" +exaequo) : null;
|
|
|
const rankStr = diff.newRank == 1 ? "1ere" : `${diff.newRank}eme`;
|
|
|
if (diff.users.length > 1) // Advanced too much rank at once ! Only display new position
|
|
|
return `${username} prend la ${rankStr} place ` +(exaequo || "!");
|
|
|
@@ -516,6 +517,22 @@ QuizzBot.prototype.onMessageInternal = function(username, user, msg) {
|
|
|
this.bot.sendMsg(this.room, "Must be channel operator");
|
|
|
}
|
|
|
}
|
|
|
+ else if (lmsg === "!report prev") {
|
|
|
+ if (!this.previousQuestion) {
|
|
|
+ this.bot.sendMsg(this.room, "Erreur: question non trouvée");
|
|
|
+ } else {
|
|
|
+ Cache.reportQuestion(this.previousQuestion, username);
|
|
|
+ this.bot.sendMsg(this.room, "Question #" +this.previousQuestion +" marquée comme défectueuse par " +username);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (lmsg === "!report current") {
|
|
|
+ if (!this.currentQuestion) {
|
|
|
+ this.bot.sendMsg(this.room, "Erreur: question non trouvée");
|
|
|
+ } else {
|
|
|
+ Cache.reportQuestion(this.currentQuestion.id, username);
|
|
|
+ this.bot.sendMsg(this.room, "Question #" +this.currentQuestion.id +" marquée comme défectueuse par " +username);
|
|
|
+ }
|
|
|
+ }
|
|
|
else if (lmsg.startsWith("!report ")) {
|
|
|
var questionId = msg.substr("!report ".length).trim();
|
|
|
if (questionId.startsWith('#'))
|