Skip to content

Commit

Permalink
Set up module references (for database function calls in controller).
Browse files Browse the repository at this point in the history
  • Loading branch information
glutSolidSphere committed Apr 12, 2017
1 parent 72a3eb6 commit 2a6e620
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions source/model/lobby.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var app = require ('../../app');
var io = require ('socket.io')();
var Tutorial = require ('./Tutorial');
var TutorialModule = require ('./Tutorial');
var LobbyModule = require ('./Lobby');
var lobbyio = io.of ('/lobby');

var listen = function (server) {
Expand Down Expand Up @@ -341,7 +342,7 @@ lobbyio.on ('connection', function (socket) {
var socketsInGroup = lobby.getUsersInRoom (groupName);
socketsInGroup.forEach (function (socketClient, i) {
if (socketClient.userType == 'student') {
Tutorial.changeExp (socketClient.userId, socketClient.tutorialId, lobby.questions[data.uuid].groupAnswers[groupName].experience);
TutorialModule.changeExp (socketClient.userId, socketClient.tutorialId, lobby.questions[data.uuid].groupAnswers[groupName].experience);
}
});
});
Expand Down Expand Up @@ -446,7 +447,7 @@ lobbyio.on ('connection', function (socket) {
var socketsInGroup = lobby.getUsersInRoom (groupName);
socketsInGroup.forEach (function (socketClient, i) {
if (socketClient.userType == 'student') {
Tutorial.changeExp (socketClient.userId, socketClient.tutorialId, lobby.payoutExperience);
TutorialModule.changeExp (socketClient.userId, socketClient.tutorialId, lobby.payoutExperience);
}
});
});
Expand Down

0 comments on commit 2a6e620

Please sign in to comment.