From 0ccf1dc1b80fe2dff8f98538ffac673c6b326a57 Mon Sep 17 00:00:00 2001 From: HumairAK Date: Sat, 23 Jul 2016 00:12:11 -0400 Subject: Added admin cpanel functionality, added serverCallback in parameters for some database queries. --- routes/index.js | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'routes/index.js') diff --git a/routes/index.js b/routes/index.js index 30189da..ac8e9a8 100644 --- a/routes/index.js +++ b/routes/index.js @@ -19,11 +19,11 @@ router.get('/user_solutions', function(req, res, next) { res.render('user_solutions'); }); -/* Render/GET questions page */ +/* Render/GET questions page router.get('/questions', function(req, res, next) { res.render('questions'); }); - +*/ //EXAMPLE EXPECTED DATA GIVEN BELOW: /*[ {courseCode: 'CSC240', @@ -86,8 +86,9 @@ router.get('/search', function(req, res, next) { router.get('/questions/:exam_id', function (req,res) { console.log(req.params.exam_id); dbFile.get_exam_info_by_ID(req.params.exam_id, function (questions) { - res.render('questions', {query: questions}); console.log(questions); + res.render('questions', {query: questions}); + }); }); @@ -144,18 +145,4 @@ function toProperCase(string) { return string.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}); } -/* Takes an input string delimited by commas, will split by comma and trim white - * spaces. Consider callback. - */ -function parseStringArray(input){ - var list = input.split(','); - var parsedList = []; - list.forEach(function(word){ - if (word != ""){ - parsedList.push(word.trim()); - } - }); - return parsedList; -} - module.exports = router; \ No newline at end of file -- cgit v1.2.3