From 0653dcc395a54c8c95ed4f997ff9bbf02ea60b5e Mon Sep 17 00:00:00 2001 From: HumairAK Date: Thu, 21 Jul 2016 22:46:17 -0400 Subject: Minor bug fixes --- node_simple.js | 13 ------------- routes/index.js | 1 + 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/node_simple.js b/node_simple.js index 033beb7..4945c9d 100644 --- a/node_simple.js +++ b/node_simple.js @@ -81,8 +81,6 @@ var uri = 'mongodb://general:assignment4@ds057862.mlab.com:57862/solutions_repo' //****************************FUNCTIONS************************************************| - - /* * This function creates and adds a user to users table. * IFF both the email and the user_name are not in the database already. @@ -212,7 +210,6 @@ exports.find_user = function (email, callback) { }) }; - // this function returns an array where is element contains info for a particular question // such as the question number (_id), number of solutions (count), and number of comments // (comments). [ {_id,count,comments}, {} ...] @@ -259,7 +256,6 @@ exports.get_exam_info_by_ID = function (exam_id, callback) { }; - /* * This function will add a comment to the solutions table * Params: sol_id - id of the solution to which to add the comment @@ -291,8 +287,6 @@ exports.add_comment = function (sol_id, fields) { }) }; - - // get all solutions given an exam_id and the question number exports.get_all_solutions = function (exam_id, q_num, callback) { mongoFactory.getConnection(uri) @@ -362,8 +356,6 @@ exports.add_solution = function (fields) { }; - - /* * This function will retrieve all exams in the database given the course code ... * ... ordered by the year of the exam. @@ -492,7 +484,6 @@ exports.add_exam = function (fields, questions_array, serverCallback) { }); }; - /* * This function will return TRUE if the provided exam info already exists in the database * OR FALSE if it does not exist in the database. @@ -546,7 +537,6 @@ exports.find_exam = function (fields, serverCallback, callback) { }); }; - /* * This function will add a course to the database UNLESS the course already exists. * If the course table is empty, this will create one and then add the data. @@ -590,7 +580,6 @@ exports.add_course = function (course_code, title) { }); }; - /* * This function will return TRUE if the provided course info already exists in the database * OR FALSE if it does not exist in the database. @@ -631,7 +620,6 @@ exports.find_course = function (course_code, callback) { }); }; - /* * This function will remove the exam from the database given the combination of (course_code+ year + term + type) * Params: fields - an array of format ["course_code", year, "term", "type"] @@ -676,7 +664,6 @@ exports.remove_exam = function (fields) { }); }; - //get_exam_byID("578a44ff71ed097fc3079d6e"); exports.get_exam_byID = function (id) { diff --git a/routes/index.js b/routes/index.js index da9ec8d..1962652 100644 --- a/routes/index.js +++ b/routes/index.js @@ -77,6 +77,7 @@ router.post('/admin/update/exam', function(req,res){ router.post('/admin/update/course', function(req,res){ var course_code = req.body.course_code, title = req.body.title; + dbFile.add_course(course_code, title, function(courseAdded, statusMessage){ if(courseAdded){ console.log("Success!"); -- cgit v1.2.3