Commit 4c7fc12e authored by Julien Schröter's avatar Julien Schröter

Apply 2 suggestion(s) to 1 file(s)

parent 36559a15
Pipeline #2233 passed with stage
in 4 minutes and 27 seconds
......@@ -283,7 +283,7 @@ const queryQuestionsForNewRound = "SELECT `pool_question`.`question` FROM `pool_
"AND `pool_question`.`question` NOT IN (SELECT `question` FROM `roundquestion` INNER JOIN `round` ON (`round`.`idround` = `roundquestion`.`round`) WHERE `duel`=?)" +
"AND `question`.`published`=1 " +
"GROUP BY `pool_question`.`question`" +
"ORDER BY POW(COUNT(IF(`user`=? AND RAND()<.9, 1, NULL)), 2) + POW(COUNT(IF(`user`!=? AND RAND()<.9, 1, NULL)), 2)" +
"ORDER BY POW(COUNT(IF(`useranswer`.`user`=? AND RAND()<.9, 1, NULL)), 2) + POW(COUNT(IF(`useranswer`.`user`=? AND RAND()<.9, 1, NULL)), 2)" +
"LIMIT ?"
// DuelQuery provides functions to create, get and update duels in datastores.
......@@ -869,7 +869,7 @@ func (m *MySQLDuelQuery) SetPool(duelID, poolID, userID uint32) (*schemas.DuelSc
}
// Select questions and create roundquestions
questions, errQuestions := tx.Query(queryQuestionsForNewRound, poolID, duelID, userID, userID, QuestionsPerRound)
questions, errQuestions := tx.Query(queryQuestionsForNewRound, poolID, duelID, user1, user2, QuestionsPerRound)
if errQuestions != nil {
return nil, errQuestions
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment