From cba5d85480f2bb563009285cd881701c8696cdc3 Mon Sep 17 00:00:00 2001 From: davbrican <72500941+davbrican@users.noreply.github.com> Date: Tue, 29 Jun 2021 19:14:43 +0200 Subject: [PATCH 1/2] Update session to finish task 11 --- models/Session.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/Session.js b/models/Session.js index 1f12f0a..3857abe 100644 --- a/models/Session.js +++ b/models/Session.js @@ -10,10 +10,10 @@ const SessionSchema = new Schema({ testCounter: { type: Number, default: 0 }, exerciseCounter: { type: Number, default: -1 }, running: { type: Boolean, default: false }, - pairingMode: { type: String, default: "AUTO" }, + pairingMode: { type: String, default: "MANUAL" }, registrationText: { type: String }, finishMessage: { type: String }, - blindParticipant: { type: Boolean, default: false }, + blindParticipant: { type: Boolean, default: true }, }); SessionSchema.index( From e3840eb4d65357e00e775240fa64ffca8e11272d Mon Sep 17 00:00:00 2001 From: davbrican <72500941+davbrican@users.noreply.github.com> Date: Thu, 1 Jul 2021 16:00:07 +0200 Subject: [PATCH 2/2] Changes in progress --- consumer.js | 29 +++++++++++++++++++++++++---- routes/auth.js | 17 +++++++++++++++++ 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/consumer.js b/consumer.js index 07fdcc4..6fe9b22 100644 --- a/consumer.js +++ b/consumer.js @@ -390,14 +390,35 @@ async function notifyParticipants(sessionName, io) { Logger.dbg("notifyParticipants - Re-assigning rooms to avoid race conditions!"); + var femaleList = [] + var maleList = [] + for (const participant in participants) { + console.log(participant.firstName + " PARTICIPANTE"); + if (participant.gender == "Male") { + maleList.push(participant); + } + else if (participant.gender == "Female") { + femaleList.push(participant); + } + } + + participantNumber = 0; + for(i=0;i:\n"+ " -"+ peer1.code+", "+peer1.firstName+", "+peer1.firstName+", "+peer1.gender+", "+peer1.blind+"\n"+ " -"+ peer2.code+", "+peer2.firstName+", "+peer2.firstName+", "+peer2.gender+", "+peer2.blind); diff --git a/routes/auth.js b/routes/auth.js index 730c225..26da57b 100644 --- a/routes/auth.js +++ b/routes/auth.js @@ -30,6 +30,23 @@ router.post("/login", (req, res) => { router.post("/signup", async (req, res) => { const code = Math.floor(Math.random() * 1000000 + 1); + /* + //code = 350526; Example of an already created user code + try { + const userFound = await User.findOne({ + code: code, + environment: process.env.NODE_ENV, + }).then(async(response) => { + console.log(response); + }); + + while (userFound!=null) { + code = Math.floor(Math.random() * 1000000 + 1); + } + } catch (error) { + ; + } + */ const newUser = new User(req.body); newUser.code = code;