X-Git-Url: https://git.auder.net/?p=qomet.git;a=blobdiff_plain;f=sockets.js;h=dafe6d961773e523c98620c460eb26982b02999b;hp=30beb32373834bf152ae4863746a0f83e425b937;hb=HEAD;hpb=43828378be054cf3604b753e8d9ab24af911188f diff --git a/sockets.js b/sockets.js index 30beb32..dafe6d9 100644 --- a/sockets.js +++ b/sockets.js @@ -1,6 +1,6 @@ const message = require("./public/javascripts/utils/socketMessages"); const params = require("./config/parameters"); -const AssessmentModel = require("./models/assessment"); +const EvaluationModel = require("./models/evaluation"); const ObjectId = require("bson-objectid"); module.exports = function(io) @@ -20,10 +20,10 @@ module.exports = function(io) { const number = socket.handshake.query.number; const password = socket.handshake.query.password; - AssessmentModel.checkPassword(ObjectId(aid), number, password, (err,ret) => { + EvaluationModel.checkPassword(ObjectId(aid), number, password, (err,ret) => { if (!!err || !ret) return; //wrong password, or some unexpected error... - AssessmentModel.newConnection(ObjectId(aid), number); + EvaluationModel.newConnection(ObjectId(aid), number); socket.broadcast.to(aid + "_teacher").emit(message.studentConnect, {number: number}); socket.join(aid + "_student"); socket.on(message.newAnswer, m => { //got answer from student client @@ -42,7 +42,7 @@ module.exports = function(io) socket.broadcast.to(aid + "_teacher").emit(message.studentFullscreen, m); }); socket.on("disconnect", () => { //notify monitor + server - AssessmentModel.setDiscoTime(ObjectId(aid), number); + EvaluationModel.setDiscoTime(ObjectId(aid), number); socket.broadcast.to(aid + "_teacher").emit(message.studentDisconnect, {number: number}); }); });