aboutsummaryrefslogtreecommitdiff
path: root/routes/index.js
diff options
context:
space:
mode:
authorHumairAK <humair88@hotmail.com>2016-07-23 04:12:11 +0000
committerHumairAK <humair88@hotmail.com>2016-07-23 04:12:11 +0000
commit0ccf1dc1b80fe2dff8f98538ffac673c6b326a57 (patch)
tree82a55e2b940dbe56b2f1308fbee86a07abe82294 /routes/index.js
parent297b50e415b9db833128fa9b9574a35b7ca453d6 (diff)
Added admin cpanel functionality, added serverCallback in parameters for some database queries.
Diffstat (limited to 'routes/index.js')
-rw-r--r--routes/index.js21
1 files changed, 4 insertions, 17 deletions
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