diff options
| author | Waref Haque <warefhaque@inside-239-60.wireless.utoronto.ca> | 2016-07-21 02:10:32 +0000 |
|---|---|---|
| committer | Waref Haque <warefhaque@inside-239-60.wireless.utoronto.ca> | 2016-07-21 02:10:32 +0000 |
| commit | d694c1a73f77def42c17b58027f046bf9e1af809 (patch) | |
| tree | 69493f47d2a0c495fc66dff7d1c26c47f65c6735 | |
| parent | d46b37fcb7c97ab59fd929cfc0a8d766ca8a0b8a (diff) | |
questions for each exam page
| -rw-r--r-- | .idea/modules.xml | 8 | ||||
| -rw-r--r-- | .idea/solutions_repo.iml | 9 | ||||
| -rw-r--r-- | routes/index.js | 21 |
3 files changed, 38 insertions, 0 deletions
diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..3d57a3a --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectModuleManager"> + <modules> + <module fileurl="file://$PROJECT_DIR$/.idea/solutions_repo.iml" filepath="$PROJECT_DIR$/.idea/solutions_repo.iml" /> + </modules> + </component> +</project>
\ No newline at end of file diff --git a/.idea/solutions_repo.iml b/.idea/solutions_repo.iml new file mode 100644 index 0000000..004ef7c --- /dev/null +++ b/.idea/solutions_repo.iml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="WEB_MODULE" version="4"> + <component name="NewModuleRootManager"> + <content url="file://$MODULE_DIR$" /> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="library" name="solutions_repo node_modules" level="project" /> + </component> +</module>
\ No newline at end of file diff --git a/routes/index.js b/routes/index.js index 84087e7..16f5778 100644 --- a/routes/index.js +++ b/routes/index.js @@ -83,6 +83,27 @@ router.get('/search', function(req, res, next) { res.redirect('/exams/' + courseName); }); + +/* REDIRECT - exam -> questions page*/ +router.get('/exam_click',function (req,res) { + //TODO:get needs to have exam_id attached + var examId = req.query.exam_id; + res.redirect('/questions/'+examId); +}); + +/*EXAMPLE DATA GIVEN BELOW: + * questions = [{id,count,comments},{id,count,comments}] --> array of "question" objects + * + * id = questions number + * count= number of solutions + * comments = number of comments*/ +router.get('/questions/:exam_id', function (req,res) { + dbFile.get_exam_info_by_ID(req.params.exam_id, function (questions) { + + res.render('questions', {query: questions}); + }); +}); + router.get('/signup', function(req, res, next) { res.render('signup', {csrfToken: req.csrfToken()}); }); |
