+ newAnswer: function(aid, number, password, input, cb)
+ {
+ console.log(JSON.stringify(input));
+ // Check that student hasn't already answered
+ AssessmentEntity.hasInput(aid, number, password, input.index, (err,ret) => {
+ if (!!err)
+ return cb(err,null);
+ if (!!ret)
+ return cb({errmsg:"Question already answered"},null);
+ AssessmentEntity.setInput(aid, number, password, input, (err2,ret2) => {
+ console.log(JSON.stringify(ret2));
+ if (!!err2 || !ret2)
+ return cb(err2,ret2);
+ return cb(null,ret2);
+ });
+ });
+ },
+