Fix sign of deltaTime for disconnections
authorBenjamin Auder <benjamin.auder@somewhere>
Thu, 8 Feb 2018 17:34:10 +0000 (18:34 +0100)
committerBenjamin Auder <benjamin.auder@somewhere>
Thu, 8 Feb 2018 17:34:10 +0000 (18:34 +0100)
models/assessment.js

index d5bd3a1..65d594b 100644 (file)
@@ -123,7 +123,7 @@ const AssessmentModel =
                //increment discoCount, reset discoTime to NULL, update totalDisco
                AssessmentEntity.getDiscoTime(aid, number, (err,discoTime) => {
                        if (!!discoTime)
-                               AssessmentEntity.addDisco(aid, number, discoTime - Date.now());
+                               AssessmentEntity.addDisco(aid, number, Date.now() - discoTime);
                });
        },