Skip to content

Commit

Permalink
fix accidental flipping of setByDifficulty
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffrey-wu committed Aug 11, 2022
1 parent 8b1f4cb commit 13a5f56
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions rooms.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,21 @@ var sockets = {};
async function goToNextQuestion(roomName) {
var nextQuestion;
if (rooms[roomName].selectByDifficulty) {
nextQuestion = await database.getNextQuestion(rooms[roomName].setName, rooms[roomName].packetNumbers, rooms[roomName].questionNumber, rooms[roomName].validCategories, rooms[roomName].validSubcategories);
} else {
nextQuestion = await database.getRandomQuestion('tossup', rooms[roomName].difficulties, rooms[roomName].validCategories, rooms[roomName].validSubcategories);
nextQuestion = await database.getRandomQuestion(
'tossup',
rooms[roomName].difficulties,
rooms[roomName].validCategories,
rooms[roomName].validSubcategories
);
rooms[roomName].setName = nextQuestion.setName;
} else {
nextQuestion = await database.getNextQuestion(
rooms[roomName].setName,
rooms[roomName].packetNumbers,
rooms[roomName].questionNumber,
rooms[roomName].validCategories,
rooms[roomName].validSubcategories
);
}

rooms[roomName].endOfSet = Object.keys(nextQuestion).length === 0;
Expand Down Expand Up @@ -212,7 +223,7 @@ function createRoom(roomName) {
questionProgress: 0, // 0 = not started, 1 = reading, 2 = answer revealed
public: true,
allowMultipleBuzzes: true,
selectByDifficulty: false,
selectByDifficulty: true,
paused: false,
buzzTimeout: null,
buzzedIn: false
Expand Down

0 comments on commit 13a5f56

Please sign in to comment.