From 38594fd274a4bebee75ae71dbed457b39d253cae Mon Sep 17 00:00:00 2001 From: HumairAK Date: Tue, 26 Jul 2016 20:18:22 -0400 Subject: fixed false exam path search for solutions, minor change to db function --- node_simple.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'node_simple.js') diff --git a/node_simple.js b/node_simple.js index 008cf81..50d8469 100644 --- a/node_simple.js +++ b/node_simple.js @@ -782,7 +782,7 @@ exports.get_all_solutions = function (exam_id, q_num, callback) { if (!success && failure) { // some error occurred while searching callback(false, true, "Error: Some error occurred while searching for exam", null); } else if (!success && !failure) { - callback(false, true, "Error: this exam doesn't exist", null); + callback(false, true, "Error: this exam does not exist", null); } else if (success && !failure) { // this exam exists proceed with task mongoFactory.getConnection(uri).then(function (db) { @@ -1230,7 +1230,7 @@ exports.get_exam_byID = function (id, callback) { exams.find( {_id: ObjectId(id)} ).toArray(function (err, docs) { if (err) { callback(false, true, null); - } else if (!docs) { + } else if (docs.length == 0) { callback(false, false, null); } else { -- cgit v1.2.3