├── data ├── mongod.lock ├── WiredTiger.lock ├── WiredTiger ├── storage.bson ├── WiredTiger.wt ├── _mdb_catalog.wt ├── sizeStorer.wt ├── WiredTigerLAS.wt ├── index-1--8932423520697425361.wt ├── index-3--8932423520697425361.wt ├── collection-0--8932423520697425361.wt ├── collection-2--8932423520697425361.wt ├── diagnostic.data │ └── metrics.2016-03-23T17-37-22Z-00000 └── WiredTiger.turtle ├── helpers └── date.js ├── middlewares ├── auth.js └── users.js ├── tests ├── helpers │ └── date.js ├── ui │ └── homepage.js ├── integration │ └── loading.js ├── middlewares │ ├── auth.js │ └── users.js ├── controllers │ └── comments.js └── models │ └── comment.js ├── views ├── index.jade ├── error.jade ├── layout.jade ├── exams │ ├── exam_submit.jade │ ├── performance.jade │ ├── question_list.jade │ ├── take_exam_code_entry.jade │ ├── view_performance_code_entry.jade │ ├── new.jade │ ├── new_question.jade │ └── take_exam.jade ├── faculties │ ├── home.jade │ ├── get_username_edit.jade │ ├── get_username_delete.jade │ ├── assign.jade │ ├── unassign.jade │ ├── edit.jade │ └── new.jade ├── welcome.jade ├── students │ ├── home.jade │ ├── get_username_edit.jade │ ├── get_username_delete.jade │ ├── register.jade │ ├── deregister.jade │ ├── new.jade │ └── edit.jade ├── courses │ ├── get_courseid_edit.jade │ ├── get_courseid_delete.jade │ ├── new.jade │ └── edit.jade ├── login.jade └── admin │ └── home.jade ├── Test Report.docx ├── SRS_Version_1.2.pdf ├── public ├── stylesheets │ ├── assets │ │ ├── ico │ │ │ ├── favicon.png │ │ │ ├── apple-touch-icon-57-precomposed.png │ │ │ ├── apple-touch-icon-72-precomposed.png │ │ │ ├── apple-touch-icon-114-precomposed.png │ │ │ └── apple-touch-icon-144-precomposed.png │ │ ├── img │ │ │ └── backgrounds │ │ │ │ ├── 1.jpg │ │ │ │ ├── 2.jpg │ │ │ │ ├── 3.jpg │ │ │ │ ├── 1@2x.jpg │ │ │ │ ├── 2@2x.jpg │ │ │ │ └── 3@2x.jpg │ │ ├── js │ │ │ ├── placeholder.js │ │ │ ├── scripts.js │ │ │ ├── jquery.backstretch.min.js │ │ │ └── jquery.backstretch.js │ │ ├── font-awesome │ │ │ ├── fonts │ │ │ │ ├── FontAwesome.otf │ │ │ │ ├── fontawesome-webfont.eot │ │ │ │ ├── fontawesome-webfont.ttf │ │ │ │ ├── fontawesome-webfont.woff │ │ │ │ └── fontawesome-webfont.woff2 │ │ │ ├── less │ │ │ │ ├── fixed-width.less │ │ │ │ ├── bordered-pulled.less │ │ │ │ ├── larger.less │ │ │ │ ├── list.less │ │ │ │ ├── font-awesome.less │ │ │ │ ├── core.less │ │ │ │ ├── stacked.less │ │ │ │ ├── rotated-flipped.less │ │ │ │ ├── path.less │ │ │ │ ├── animated.less │ │ │ │ └── mixins.less │ │ │ └── scss │ │ │ │ ├── _fixed-width.scss │ │ │ │ ├── _bordered-pulled.scss │ │ │ │ ├── _larger.scss │ │ │ │ ├── _list.scss │ │ │ │ ├── font-awesome.scss │ │ │ │ ├── _core.scss │ │ │ │ ├── _stacked.scss │ │ │ │ ├── _rotated-flipped.scss │ │ │ │ ├── _path.scss │ │ │ │ ├── _animated.scss │ │ │ │ └── _mixins.scss │ │ ├── bootstrap │ │ │ ├── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ ├── js │ │ │ │ └── npm.js │ │ │ └── css │ │ │ │ ├── font.css │ │ │ │ └── bootstrap-theme.min.css │ │ └── css │ │ │ ├── form-elements.css │ │ │ └── style.css │ └── style.css └── javascripts │ ├── display.js │ └── question_list.js ├── controllers ├── index.js ├── admin.js ├── login_controller.js ├── courses.js ├── make_exam_controller.js ├── take_exam_controller.js ├── faculties.js └── students.js ├── models ├── admin.js ├── course.js ├── exam.js ├── faculty.js └── student.js ├── package.json ├── bin └── www ├── README.md ├── config └── passport.js └── app.js /data/mongod.lock: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /helpers/date.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /middlewares/auth.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /middlewares/users.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/helpers/date.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/ui/homepage.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/loading.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/middlewares/auth.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/middlewares/users.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/controllers/comments.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/WiredTiger.lock: -------------------------------------------------------------------------------- 1 | WiredTiger lock file 2 | -------------------------------------------------------------------------------- /data/WiredTiger: -------------------------------------------------------------------------------- 1 | WiredTiger 2 | WiredTiger 2.7.1: (December 8, 2015) 3 | -------------------------------------------------------------------------------- /views/index.jade: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h1= "This is the index page" 5 | -------------------------------------------------------------------------------- /Test Report.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/Test Report.docx -------------------------------------------------------------------------------- /data/storage.bson: -------------------------------------------------------------------------------- 1 | _storageQengine wiredTigeroptions,directoryPerDBdirectoryForIndexes -------------------------------------------------------------------------------- /SRS_Version_1.2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/SRS_Version_1.2.pdf -------------------------------------------------------------------------------- /data/WiredTiger.wt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/data/WiredTiger.wt -------------------------------------------------------------------------------- /data/_mdb_catalog.wt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/data/_mdb_catalog.wt -------------------------------------------------------------------------------- /data/sizeStorer.wt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/data/sizeStorer.wt -------------------------------------------------------------------------------- /data/WiredTigerLAS.wt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/data/WiredTigerLAS.wt -------------------------------------------------------------------------------- /views/error.jade: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h1= message 5 | h2= error.status 6 | pre #{error.stack} 7 | -------------------------------------------------------------------------------- /data/index-1--8932423520697425361.wt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/data/index-1--8932423520697425361.wt -------------------------------------------------------------------------------- /data/index-3--8932423520697425361.wt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/data/index-3--8932423520697425361.wt -------------------------------------------------------------------------------- /data/collection-0--8932423520697425361.wt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/data/collection-0--8932423520697425361.wt -------------------------------------------------------------------------------- /data/collection-2--8932423520697425361.wt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/data/collection-2--8932423520697425361.wt -------------------------------------------------------------------------------- /public/stylesheets/assets/ico/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/public/stylesheets/assets/ico/favicon.png -------------------------------------------------------------------------------- /public/stylesheets/assets/img/backgrounds/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/public/stylesheets/assets/img/backgrounds/1.jpg -------------------------------------------------------------------------------- /public/stylesheets/assets/img/backgrounds/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/public/stylesheets/assets/img/backgrounds/2.jpg -------------------------------------------------------------------------------- /public/stylesheets/assets/img/backgrounds/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/public/stylesheets/assets/img/backgrounds/3.jpg -------------------------------------------------------------------------------- /public/stylesheets/assets/img/backgrounds/1@2x.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/public/stylesheets/assets/img/backgrounds/1@2x.jpg -------------------------------------------------------------------------------- /public/stylesheets/assets/img/backgrounds/2@2x.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/public/stylesheets/assets/img/backgrounds/2@2x.jpg -------------------------------------------------------------------------------- /public/stylesheets/assets/img/backgrounds/3@2x.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/public/stylesheets/assets/img/backgrounds/3@2x.jpg -------------------------------------------------------------------------------- /data/diagnostic.data/metrics.2016-03-23T17-37-22Z-00000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/data/diagnostic.data/metrics.2016-03-23T17-37-22Z-00000 -------------------------------------------------------------------------------- /public/stylesheets/assets/js/placeholder.js: -------------------------------------------------------------------------------- 1 | 2 | $(document).ready(function(){ 3 | 4 | $(".form-username").val("Username..."); 5 | $(".form-password").val("Password..."); 6 | 7 | }); -------------------------------------------------------------------------------- /public/stylesheets/assets/font-awesome/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/public/stylesheets/assets/font-awesome/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /controllers/index.js: -------------------------------------------------------------------------------- 1 | var express = require('express') 2 | , router = express.Router() 3 | 4 | router.get('/', function(req, res) { 5 | res.render('welcome'); 6 | }) 7 | 8 | module.exports = router -------------------------------------------------------------------------------- /public/stylesheets/assets/font-awesome/less/fixed-width.less: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .@{fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /public/stylesheets/assets/font-awesome/scss/_fixed-width.scss: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .#{$fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /public/stylesheets/assets/ico/apple-touch-icon-57-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/public/stylesheets/assets/ico/apple-touch-icon-57-precomposed.png -------------------------------------------------------------------------------- /public/stylesheets/assets/ico/apple-touch-icon-72-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/public/stylesheets/assets/ico/apple-touch-icon-72-precomposed.png -------------------------------------------------------------------------------- /public/stylesheets/assets/ico/apple-touch-icon-114-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/public/stylesheets/assets/ico/apple-touch-icon-114-precomposed.png -------------------------------------------------------------------------------- /public/stylesheets/assets/ico/apple-touch-icon-144-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/public/stylesheets/assets/ico/apple-touch-icon-144-precomposed.png -------------------------------------------------------------------------------- /public/stylesheets/assets/font-awesome/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/public/stylesheets/assets/font-awesome/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /public/stylesheets/assets/font-awesome/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/public/stylesheets/assets/font-awesome/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /public/stylesheets/assets/font-awesome/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/public/stylesheets/assets/font-awesome/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /public/stylesheets/assets/font-awesome/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/public/stylesheets/assets/font-awesome/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /public/stylesheets/assets/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/public/stylesheets/assets/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /public/stylesheets/assets/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/public/stylesheets/assets/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /public/stylesheets/assets/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/public/stylesheets/assets/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /public/stylesheets/assets/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/annuay/online-objective-examination-system/HEAD/public/stylesheets/assets/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /views/layout.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | title= title 5 | link(rel='stylesheet', href='/stylesheets/style.css') 6 | body 7 | block content 8 | script(src='http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js') 9 | 10 | -------------------------------------------------------------------------------- /tests/models/comment.js: -------------------------------------------------------------------------------- 1 | should = require('should') 2 | 3 | Comment = require('../../models/comment') 4 | 5 | describe('Model Comment', function() { 6 | 7 | it('get', function(done) { 8 | var id = '5678' 9 | 10 | Comment.get(id, function(err, comment) { 11 | comment.id.should.eql(id) 12 | done() 13 | }) 14 | }) 15 | 16 | }) -------------------------------------------------------------------------------- /models/admin.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | 4 | var monk = require('monk'); 5 | var db = monk('localhost:27017/examdb'); 6 | var admin_collection = db.get('admin'); 7 | 8 | module.exports = { 9 | 10 | findByUserName: function(username, cb) { 11 | admin_collection.findOne({username: username}, cb); 12 | }, 13 | 14 | }; 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /public/stylesheets/assets/font-awesome/less/bordered-pulled.less: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em @fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .pull-right { float: right; } 11 | .pull-left { float: left; } 12 | 13 | .@{fa-css-prefix} { 14 | &.pull-left { margin-right: .3em; } 15 | &.pull-right { margin-left: .3em; } 16 | } 17 | -------------------------------------------------------------------------------- /public/stylesheets/assets/font-awesome/scss/_bordered-pulled.scss: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em $fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .pull-right { float: right; } 11 | .pull-left { float: left; } 12 | 13 | .#{$fa-css-prefix} { 14 | &.pull-left { margin-right: .3em; } 15 | &.pull-right { margin-left: .3em; } 16 | } 17 | -------------------------------------------------------------------------------- /public/stylesheets/assets/font-awesome/less/larger.less: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .@{fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .@{fa-css-prefix}-2x { font-size: 2em; } 11 | .@{fa-css-prefix}-3x { font-size: 3em; } 12 | .@{fa-css-prefix}-4x { font-size: 4em; } 13 | .@{fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /public/stylesheets/assets/font-awesome/scss/_larger.scss: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .#{$fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .#{$fa-css-prefix}-2x { font-size: 2em; } 11 | .#{$fa-css-prefix}-3x { font-size: 3em; } 12 | .#{$fa-css-prefix}-4x { font-size: 4em; } 13 | .#{$fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /public/stylesheets/assets/font-awesome/less/list.less: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: @fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .@{fa-css-prefix}-li { 11 | position: absolute; 12 | left: -@fa-li-width; 13 | width: @fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.@{fa-css-prefix}-lg { 17 | left: (-@fa-li-width + (4em / 14)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /public/stylesheets/assets/font-awesome/scss/_list.scss: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: $fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .#{$fa-css-prefix}-li { 11 | position: absolute; 12 | left: -$fa-li-width; 13 | width: $fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.#{$fa-css-prefix}-lg { 17 | left: -$fa-li-width + (4em / 14); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /public/stylesheets/assets/font-awesome/scss/font-awesome.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.3.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables"; 7 | @import "mixins"; 8 | @import "path"; 9 | @import "core"; 10 | @import "larger"; 11 | @import "fixed-width"; 12 | @import "list"; 13 | @import "bordered-pulled"; 14 | @import "animated"; 15 | @import "rotated-flipped"; 16 | @import "stacked"; 17 | @import "icons"; 18 | -------------------------------------------------------------------------------- /public/stylesheets/assets/bootstrap/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /public/stylesheets/assets/font-awesome/less/font-awesome.less: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.3.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables.less"; 7 | @import "mixins.less"; 8 | @import "path.less"; 9 | @import "core.less"; 10 | @import "larger.less"; 11 | @import "fixed-width.less"; 12 | @import "list.less"; 13 | @import "bordered-pulled.less"; 14 | @import "animated.less"; 15 | @import "rotated-flipped.less"; 16 | @import "stacked.less"; 17 | @import "icons.less"; 18 | -------------------------------------------------------------------------------- /public/stylesheets/assets/font-awesome/less/core.less: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal @fa-font-size-base/1 FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | transform: translate(0, 0); // ensures no half-pixel rendering in firefox 12 | 13 | } 14 | -------------------------------------------------------------------------------- /public/stylesheets/assets/font-awesome/less/stacked.less: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .@{fa-css-prefix}-stack-1x, .@{fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .@{fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .@{fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .@{fa-css-prefix}-inverse { color: @fa-inverse; } 21 | -------------------------------------------------------------------------------- /public/stylesheets/assets/font-awesome/scss/_core.scss: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal #{$fa-font-size-base}/1 FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | transform: translate(0, 0); // ensures no half-pixel rendering in firefox 12 | 13 | } 14 | -------------------------------------------------------------------------------- /public/stylesheets/assets/font-awesome/scss/_stacked.scss: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .#{$fa-css-prefix}-stack-1x, .#{$fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .#{$fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .#{$fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .#{$fa-css-prefix}-inverse { color: $fa-inverse; } 21 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "online_exam", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "start": "node ./bin/www" 7 | }, 8 | "dependencies": { 9 | "bcrypt-nodejs": "latest", 10 | "body-parser": "~1.13.2", 11 | "connect-flash": "~0.1.1", 12 | "cookie-parser": "~1.3.5", 13 | "debug": "~2.2.0", 14 | "express": "~4.13.1", 15 | "express-session": "~1.0.0", 16 | "jade": "~1.11.0", 17 | "method-override": "~1.0.0", 18 | "mongodb": "^1.4.40", 19 | "monk": "~1.0.1", 20 | "morgan": "~1.6.1", 21 | "passport": "~0.1.17", 22 | "passport-local": "~0.1.6", 23 | "serve-favicon": "~2.3.0" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /controllers/admin.js: -------------------------------------------------------------------------------- 1 | var express = require('express') 2 | , router = express.Router() 3 | , Admin = require('../models/admin'); 4 | 5 | router.get('/home', isLoggedIn, function(req, res) { 6 | res.render('admin/home', { title: 'Options'}); 7 | }); 8 | 9 | router.get('/logout', function(req, res) { 10 | req.logout(); 11 | res.redirect('/'); 12 | }); 13 | 14 | module.exports = router; 15 | 16 | function isLoggedIn(req, res, next) { 17 | 18 | // if user is authenticated in the session, carry on 19 | if (req.isAuthenticated()&&req.user.usertype=='admin') 20 | {return next();} 21 | 22 | // if they aren't redirect them to the home page 23 | res.redirect('/'); 24 | } -------------------------------------------------------------------------------- /public/stylesheets/assets/font-awesome/less/rotated-flipped.less: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); } 5 | .@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); } 6 | .@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); } 7 | 8 | .@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); } 9 | .@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .@{fa-css-prefix}-rotate-90, 15 | :root .@{fa-css-prefix}-rotate-180, 16 | :root .@{fa-css-prefix}-rotate-270, 17 | :root .@{fa-css-prefix}-flip-horizontal, 18 | :root .@{fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /public/stylesheets/assets/font-awesome/scss/_rotated-flipped.scss: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-rotate-90 { @include fa-icon-rotate(90deg, 1); } 5 | .#{$fa-css-prefix}-rotate-180 { @include fa-icon-rotate(180deg, 2); } 6 | .#{$fa-css-prefix}-rotate-270 { @include fa-icon-rotate(270deg, 3); } 7 | 8 | .#{$fa-css-prefix}-flip-horizontal { @include fa-icon-flip(-1, 1, 0); } 9 | .#{$fa-css-prefix}-flip-vertical { @include fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .#{$fa-css-prefix}-rotate-90, 15 | :root .#{$fa-css-prefix}-rotate-180, 16 | :root .#{$fa-css-prefix}-rotate-270, 17 | :root .#{$fa-css-prefix}-flip-horizontal, 18 | :root .#{$fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /public/stylesheets/assets/font-awesome/less/path.less: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}'); 7 | src: url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype'), 8 | url('@{fa-font-path}/fontawesome-webfont.woff2?v=@{fa-version}') format('woff2'), 9 | url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff'), 10 | url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype'), 11 | url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg'); 12 | // src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /public/stylesheets/assets/font-awesome/scss/_path.scss: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?v=#{$fa-version}'); 7 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'), 8 | url('#{$fa-font-path}/fontawesome-webfont.woff2?v=#{$fa-version}') format('woff2'), 9 | url('#{$fa-font-path}/fontawesome-webfont.woff?v=#{$fa-version}') format('woff'), 10 | url('#{$fa-font-path}/fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'), 11 | url('#{$fa-font-path}/fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg'); 12 | // src: url('#{$fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /public/stylesheets/assets/font-awesome/less/animated.less: -------------------------------------------------------------------------------- 1 | // Animated Icons 2 | // -------------------------- 3 | 4 | .@{fa-css-prefix}-spin { 5 | -webkit-animation: fa-spin 2s infinite linear; 6 | animation: fa-spin 2s infinite linear; 7 | } 8 | 9 | .@{fa-css-prefix}-pulse { 10 | -webkit-animation: fa-spin 1s infinite steps(8); 11 | animation: fa-spin 1s infinite steps(8); 12 | } 13 | 14 | @-webkit-keyframes fa-spin { 15 | 0% { 16 | -webkit-transform: rotate(0deg); 17 | transform: rotate(0deg); 18 | } 19 | 100% { 20 | -webkit-transform: rotate(359deg); 21 | transform: rotate(359deg); 22 | } 23 | } 24 | 25 | @keyframes fa-spin { 26 | 0% { 27 | -webkit-transform: rotate(0deg); 28 | transform: rotate(0deg); 29 | } 30 | 100% { 31 | -webkit-transform: rotate(359deg); 32 | transform: rotate(359deg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /public/stylesheets/assets/font-awesome/scss/_animated.scss: -------------------------------------------------------------------------------- 1 | // Spinning Icons 2 | // -------------------------- 3 | 4 | .#{$fa-css-prefix}-spin { 5 | -webkit-animation: fa-spin 2s infinite linear; 6 | animation: fa-spin 2s infinite linear; 7 | } 8 | 9 | .#{$fa-css-prefix}-pulse { 10 | -webkit-animation: fa-spin 1s infinite steps(8); 11 | animation: fa-spin 1s infinite steps(8); 12 | } 13 | 14 | @-webkit-keyframes fa-spin { 15 | 0% { 16 | -webkit-transform: rotate(0deg); 17 | transform: rotate(0deg); 18 | } 19 | 100% { 20 | -webkit-transform: rotate(359deg); 21 | transform: rotate(359deg); 22 | } 23 | } 24 | 25 | @keyframes fa-spin { 26 | 0% { 27 | -webkit-transform: rotate(0deg); 28 | transform: rotate(0deg); 29 | } 30 | 100% { 31 | -webkit-transform: rotate(359deg); 32 | transform: rotate(359deg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /data/WiredTiger.turtle: -------------------------------------------------------------------------------- 1 | WiredTiger version string 2 | WiredTiger 2.7.1: (December 8, 2015) 3 | WiredTiger version 4 | major=2,minor=7,patch=1 5 | file:WiredTiger.wt 6 | allocation_size=4KB,app_metadata=,block_allocation=best,block_compressor=,cache_resident=0,checkpoint=(WiredTigerCheckpoint.1=(addr="018281e484aa50188381e40c5855ca808080808080e22fc0e20fc0",order=1,time=1458754679,size=12288,write_gen=2)),checkpoint_lsn=(1,10112),checksum=uncompressed,collator=,columns=,dictionary=0,encryption=(keyid=,name=),format=btree,huffman_key=,huffman_value=,id=0,internal_item_max=0,internal_key_max=0,internal_key_truncate=,internal_page_max=4KB,key_format=S,key_gap=10,leaf_item_max=0,leaf_key_max=0,leaf_page_max=32KB,leaf_value_max=0,log=(enabled=),memory_page_max=5MB,os_cache_dirty_max=0,os_cache_max=0,prefix_compression=0,prefix_compression_min=4,split_deepen_min_child=0,split_deepen_per_child=0,split_pct=75,value_format=S,version=(major=1,minor=1) 7 | -------------------------------------------------------------------------------- /models/course.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | 4 | var monk = require('monk'); 5 | var db = monk('localhost:27017/examdb'); 6 | var course_collection = db.get('courses'); 7 | 8 | module.exports = { 9 | // MAKE VALIDATION FUNCTIONS HERE 10 | // Create new course in the database 11 | create: function(course, cb) { 12 | course_collection.insert(course, cb); 13 | }, 14 | 15 | // Retrieve course using courseid 16 | getBycourseid: function(courseid, cb) { 17 | course_collection.findOne({courseid: courseid}, {}, cb); 18 | }, 19 | 20 | // Update an existing course by courseid 21 | update: function(prevcourseid, course, cb) { 22 | course_collection.update({courseid: prevcourseid}, 23 | { $set: {courseid: course.courseid, coursename: course.coursename} }, 24 | cb); 25 | }, 26 | 27 | // Remove an existing course by courseid 28 | remove: function(courseid, cb) { 29 | console.log(courseid); 30 | course_collection.remove({courseid: courseid}, cb); 31 | } 32 | 33 | }; 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /public/stylesheets/assets/js/scripts.js: -------------------------------------------------------------------------------- 1 | 2 | jQuery(document).ready(function() { 3 | 4 | /* 5 | Fullscreen background 6 | */ 7 | $.backstretch([ 8 | "/stylesheets/assets/img/backgrounds/2.jpg" 9 | , "/stylesheets/assets/img/backgrounds/3.jpg" 10 | , "/stylesheets/assets/img/backgrounds/1.jpg" 11 | ], {duration: 3000, fade: 750}); 12 | 13 | /* 14 | Form validation 15 | */ 16 | $('.login-form input[type="text"], .login-form input[type="password"], .login-form textarea').on('focus', function() { 17 | $(this).removeClass('input-error'); 18 | }); 19 | 20 | $('.login-form').on('submit', function(e) { 21 | 22 | $(this).find('input[type="text"], input[type="password"], textarea').each(function(){ 23 | if( $(this).val() == "" ) { 24 | e.preventDefault(); 25 | $(this).addClass('input-error'); 26 | } 27 | else { 28 | $(this).removeClass('input-error'); 29 | } 30 | }); 31 | 32 | }); 33 | 34 | 35 | }); 36 | -------------------------------------------------------------------------------- /public/stylesheets/assets/font-awesome/less/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------- 3 | 4 | .fa-icon() { 5 | display: inline-block; 6 | font: normal normal normal @fa-font-size-base/1 FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | transform: translate(0, 0); // ensures no half-pixel rendering in firefox 12 | 13 | } 14 | 15 | .fa-icon-rotate(@degrees, @rotation) { 16 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation); 17 | -webkit-transform: rotate(@degrees); 18 | -ms-transform: rotate(@degrees); 19 | transform: rotate(@degrees); 20 | } 21 | 22 | .fa-icon-flip(@horiz, @vert, @rotation) { 23 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation, mirror=1); 24 | -webkit-transform: scale(@horiz, @vert); 25 | -ms-transform: scale(@horiz, @vert); 26 | transform: scale(@horiz, @vert); 27 | } 28 | -------------------------------------------------------------------------------- /public/stylesheets/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding: 30px; 3 | font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; 4 | } 5 | 6 | h2 { 7 | margin:0 0 .5em 0; 8 | } 9 | 10 | a { 11 | color: #00B7FF; 12 | } 13 | 14 | #wrapper { 15 | padding-left:312px; 16 | position:relative; 17 | } 18 | 19 | #questionList { 20 | margin:0 0 30px 0; 21 | } 22 | #questionList table { 23 | border-collapse:separate; 24 | border-spacing:1px; 25 | background:#CCC; 26 | } 27 | #questionList table th { 28 | background:#EEE; 29 | font-weight:600; 30 | padding:10px 20px; 31 | text-align:center; 32 | } 33 | #questionList table tbody { 34 | padding:0; margin:0; 35 | border-collapse:collapse; 36 | border-spacing:0px; 37 | } 38 | #questionList table td { 39 | background:#FFF; 40 | padding:5px 10px; 41 | text-align:center; 42 | } 43 | 44 | #questionBox { 45 | width:250px; 46 | position:absolute; 47 | top:0; left:0; 48 | } 49 | #questionBox p { 50 | padding:15px; 51 | border:1px solid #CCC; 52 | background:rgba(80,120,255,0.05); 53 | } 54 | 55 | fieldset { 56 | border:0; 57 | padding:0; margin:0; 58 | } -------------------------------------------------------------------------------- /public/stylesheets/assets/font-awesome/scss/_mixins.scss: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------- 3 | 4 | @mixin fa-icon() { 5 | display: inline-block; 6 | font: normal normal normal #{$fa-font-size-base}/1 FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | transform: translate(0, 0); // ensures no half-pixel rendering in firefox 12 | 13 | } 14 | 15 | @mixin fa-icon-rotate($degrees, $rotation) { 16 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation}); 17 | -webkit-transform: rotate($degrees); 18 | -ms-transform: rotate($degrees); 19 | transform: rotate($degrees); 20 | } 21 | 22 | @mixin fa-icon-flip($horiz, $vert, $rotation) { 23 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation}); 24 | -webkit-transform: scale($horiz, $vert); 25 | -ms-transform: scale($horiz, $vert); 26 | transform: scale($horiz, $vert); 27 | } 28 | -------------------------------------------------------------------------------- /controllers/login_controller.js: -------------------------------------------------------------------------------- 1 | var express = require('express') 2 | , passport = require('passport') 3 | , router = express.Router(); 4 | 5 | router.get('/', function(req, res) { 6 | var usertype = req.query.usertype; 7 | if(usertype == 'admin') 8 | res.render('login', {title: "Admin Login", method: "authenticate_admin"}); 9 | if(usertype == 'student') 10 | res.render('login', {title: "Student Login", method: "authenticate_student"}); 11 | if(usertype == 'faculty') 12 | res.render('login', {title: "Faculty Login", method: "authenticate_faculty"}); 13 | }); 14 | 15 | router.post('/authenticate_admin', passport.authenticate('local-login-admin', { 16 | successRedirect : '../admin/home', 17 | failureRedirect : '/', 18 | failureFlash : true 19 | })); 20 | 21 | router.post('/authenticate_student', passport.authenticate('local-login-student', { 22 | successRedirect : '../students/home', 23 | failureRedirect : '/', 24 | failureFlash : true 25 | })); 26 | 27 | router.post('/authenticate_faculty', passport.authenticate('local-login-faculty', { 28 | successRedirect : '../faculties/home', 29 | failureRedirect : '/', 30 | failureFlash : true 31 | })); 32 | 33 | 34 | module.exports = router; -------------------------------------------------------------------------------- /public/javascripts/display.js: -------------------------------------------------------------------------------- 1 | var questionData = []; 2 | 3 | // DOM Ready ============================================================= 4 | $(document).ready(function() { 5 | 6 | // Display Questions 7 | fillQuestions(); 8 | 9 | }); 10 | 11 | // Functions ============================================================= 12 | 13 | // Fill Question List 14 | function fillQuestions() { 15 | 16 | // Empty content string 17 | var questionContent = ''; 18 | 19 | // jQuery AJAX call for JSON 20 | $.getJSON( '/make_exam/list', {exam_code: exam_code}, function( data ) { 21 | 22 | // Question Content 23 | questionData = data.question_list; 24 | 25 | $i=1; 26 | // For each item in our JSON, add a question line 27 | $.each(data.question_list, function(){ 28 | //questionContent += this.question; 29 | questionContent += 'Question'+$i+' :'; 30 | questionContent += this.question + '
'; 31 | questionContent += ' A.' + this.optionA + ' B.' + this.optionB + ' C.' + this.optionC + ' D.' + this.optionD + ' Key' + this.key + '
'; 32 | 33 | $i++; 34 | }); 35 | 36 | // Inject the whole content string into our existing HTML table 37 | document.getElementById("temp").innerHTML = questionContent ; 38 | }); 39 | }; 40 | -------------------------------------------------------------------------------- /views/exams/exam_submit.jade: -------------------------------------------------------------------------------- 1 | 2 | doctype html 3 | html(lang='en') 4 | head 5 | meta(charset='utf-8') 6 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 7 | meta(name='viewport', content='width=device-width, initial-scale=1') 8 | title Return 9 | // CSS 10 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/font.css') 11 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/bootstrap.min.css') 12 | link(rel='stylesheet', href='/stylesheets/assets/font-awesome/css/font-awesome.min.css') 13 | link(rel='stylesheet', href='/stylesheets/assets/css/form-elements.css') 14 | link(rel='stylesheet', href='/stylesheets/assets/css/style.css') 15 | body 16 | // Top content 17 | .top-content 18 | .inner-bg 19 | .container 20 | .row 21 | .col-sm-8.col-sm-offset-2.text 22 | h1 23 | strong Go Back to HomePage 24 | .row 25 | .col-sm-3 26 | a.btn.btn-info(href='../students/home', role='button') Go Back! 27 | .col-sm-6.form-box 28 | // Javascript 29 | script(src='/stylesheets/assets/js/jquery-1.11.1.min.js') 30 | script(src='/stylesheets/assets/bootstrap/js/bootstrap.min.js') 31 | script(src='/stylesheets/assets/js/jquery.backstretch.min.js') 32 | script(src='/stylesheets/assets/js/scripts.js') 33 | //if lt IE 10 34 | script(src='assets/js/placeholder.js') 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /models/exam.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | 4 | var monk = require('monk'); 5 | var db = monk('localhost:27017/examdb'); 6 | var exam_collection = db.get('exams'); 7 | var student_collection = db.get('students'); 8 | var response_collection = db.get('responses'); 9 | 10 | 11 | module.exports = { 12 | // MAKE VALIDATION FUNCTIONS HERE 13 | // Create new student in the database 14 | create: function(exam, cb) { 15 | exam_collection.insert(exam, cb); 16 | }, 17 | 18 | getByExamCode: function(exam_code, cb) { 19 | exam_collection.findOne({exam_code: exam_code}, cb); 20 | }, 21 | 22 | getResponseByExamCode: function(exam_code, username, cb) { 23 | response_collection.findOne({exam_code: exam_code, username: username}, cb); 24 | }, 25 | 26 | addQuestion: function(exam_code, question_full, cb) { 27 | exam_collection.update( 28 | { exam_code: exam_code }, 29 | { $push: { question_list: { $each: [ 30 | {question: question_full.question, 31 | optionA: question_full.optionA, 32 | optionB: question_full.optionB, 33 | optionC: question_full.optionC, 34 | optionD: question_full.optionD, 35 | key: question_full.key 36 | } ] } } }, cb); 37 | }, 38 | 39 | // Submit Responses 40 | addResponses: function(username, exam_code, response, cb) { 41 | 42 | var temp_response = 43 | { 44 | username: username, 45 | exam_code: exam_code, 46 | response: response 47 | }; 48 | response_collection.insert(temp_response, cb); 49 | }, 50 | 51 | checkResponse: function(username, exam_code, cb) { 52 | response_collection.findOne({username:username, exam_code: exam_code}, cb); 53 | } 54 | 55 | }; -------------------------------------------------------------------------------- /models/faculty.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | 4 | var monk = require('monk'); 5 | var db = monk('localhost:27017/examdb'); 6 | var faculty_collection = db.get('faculties'); 7 | 8 | module.exports = { 9 | // MAKE VALIDATION FUNCTIONS HERE 10 | // Create new student in the database 11 | create: function(faculty, cb) { 12 | faculty_collection.insert(faculty, cb); 13 | }, 14 | 15 | // Retrieve faculty using username 16 | getByUserName: function(username, cb) { 17 | faculty_collection.findOne({username: username}, {}, cb); 18 | }, 19 | 20 | findByUserName: function(username, cb) { 21 | faculty_collection.findOne({username: username}, {}, cb); 22 | }, 23 | 24 | // Update an existing faculty by username 25 | update: function(prevusername, faculty, cb) { 26 | faculty_collection.update({username: prevusername}, 27 | { $set: {username: faculty.username, password: faculty.password, 28 | name: faculty.name} }, 29 | cb); 30 | }, 31 | 32 | // Remove an existing faculty by username 33 | remove: function(username, cb) { 34 | faculty_collection.remove({username: username}, cb); 35 | }, 36 | 37 | // Assign faculty to a course by username and course ID 38 | assign: function(username, course_code, cb) { 39 | faculty_collection.update( 40 | { username: username }, 41 | { $addToSet: { course_list: { $each: [ course_code] } } }, cb); 42 | }, 43 | 44 | unassign: function(username, course_code, cb) 45 | { 46 | faculty_collection.update( 47 | {username: username}, 48 | { $pull: { course_list: course_code } },cb); 49 | }, 50 | 51 | getBycourseid: function(username,course_code, cb) { 52 | faculty_collection.findOne({username: username, course_list :course_code}, {}, cb); 53 | } 54 | 55 | }; 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /models/student.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | 4 | var monk = require('monk'); 5 | var db = monk('localhost:27017/examdb'); 6 | var student_collection = db.get('students'); 7 | 8 | module.exports = { 9 | // MAKE VALIDATION FUNCTIONS HERE 10 | // Create new student in the database 11 | create: function(student, cb) { 12 | student_collection.insert(student, cb); 13 | }, 14 | 15 | findByUserName: function(username, cb) { 16 | student_collection.findOne({username: username}, {}, cb); 17 | }, 18 | 19 | // Retrieve student using username 20 | getByUserName: function(username, cb) { 21 | student_collection.findOne({username: username}, {}, cb); 22 | }, 23 | 24 | // Update an existing student by username 25 | update: function(prevusername, student, cb) { 26 | student_collection.update({username: prevusername}, 27 | { $set: {username: student.username, password: student.password, 28 | name: student.name, rollno: student.rollno} }, 29 | cb); 30 | }, 31 | 32 | // Remove an existing student by username 33 | remove: function(username, cb) { 34 | student_collection.remove({username: username}, cb); 35 | }, 36 | 37 | // Register student to a course by username and course ID 38 | register: function(username, course_code, cb) { 39 | student_collection.update( 40 | { username: username }, 41 | { $addToSet: { course_list: { $each: [ course_code] } } }, cb); 42 | }, 43 | 44 | deregister: function(username, course_code, cb) 45 | { 46 | student_collection.update( 47 | {username: username}, 48 | { $pull: { course_list: course_code } },cb); 49 | }, 50 | 51 | getBycourseid: function(username,course_code, cb) { 52 | student_collection.findOne({username: username, course_list :course_code}, {}, cb); 53 | } 54 | 55 | }; 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /views/faculties/home.jade: -------------------------------------------------------------------------------- 1 | 2 | doctype html 3 | html(lang='en') 4 | head 5 | meta(charset='utf-8') 6 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 7 | meta(name='viewport', content='width=device-width, initial-scale=1') 8 | title Faculty Home 9 | // CSS 10 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/font.css') 11 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/bootstrap.min.css') 12 | link(rel='stylesheet', href='/stylesheets/assets/font-awesome/css/font-awesome.min.css') 13 | link(rel='stylesheet', href='/stylesheets/assets/css/form-elements.css') 14 | link(rel='stylesheet', href='/stylesheets/assets/css/style.css') 15 | body 16 | // Top content 17 | .top-content 18 | .inner-bg 19 | .container 20 | .row 21 | .col-sm-8.col-sm-offset-2.text 22 | h1 23 | strong Hello Faculty 24 | .row 25 | .col-sm-3 26 | 27 | .col-sm-6.form-box 28 | .form-top 29 | .form-top-left 30 | p What do you want to do? 31 | .form-bottom 32 | .form-group 33 | center 34 | a.btn.btn-info(href='/make_exam/new', role='button') Make Exam 35 | .form-group 36 | .col-sm-3 37 | a.btn.btn-info(href='/faculties/logout', role='button') Logout! 38 | // Javascript 39 | script(src='/stylesheets/assets/js/jquery-1.11.1.min.js') 40 | script(src='/stylesheets/assets/bootstrap/js/bootstrap.min.js') 41 | script(src='/stylesheets/assets/js/jquery.backstretch.min.js') 42 | script(src='/stylesheets/assets/js/scripts.js') 43 | //if lt IE 10 44 | script(src='assets/js/placeholder.js') 45 | -------------------------------------------------------------------------------- /views/exams/performance.jade: -------------------------------------------------------------------------------- 1 | 2 | doctype html 3 | html(lang='en') 4 | head 5 | meta(charset='utf-8') 6 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 7 | meta(name='viewport', content='width=device-width, initial-scale=1') 8 | title Performance Report 9 | // CSS 10 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/font.css') 11 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/bootstrap.min.css') 12 | link(rel='stylesheet', href='/stylesheets/assets/font-awesome/css/font-awesome.min.css') 13 | link(rel='stylesheet', href='/stylesheets/assets/css/form-elements.css') 14 | link(rel='stylesheet', href='/stylesheets/assets/css/style.css') 15 | body 16 | // Top content 17 | .top-content 18 | .inner-bg 19 | .container 20 | .row 21 | .col-sm-8.col-sm-offset-2.text 22 | h1 23 | strong Performance Report 24 | .row 25 | .col-sm-3 26 | a.btn.btn-info(href='../students/home', role='button') Go Back! 27 | .col-sm-7.form-box 28 | .form-top 29 | .form-top-left 30 | h2 31 | strong Total Questions:   32 | "#{total_questions}" 33 | h2 34 | strong Attempted Questions:   35 | "#{attempted}" 36 | h2 37 | strong Correct Questions:   38 | "#{correct}" 39 | // Javascript 40 | script(src='/stylesheets/assets/js/jquery-1.11.1.min.js') 41 | script(src='/stylesheets/assets/bootstrap/js/bootstrap.min.js') 42 | script(src='/stylesheets/assets/js/jquery.backstretch.min.js') 43 | script(src='/stylesheets/assets/js/scripts.js') 44 | //if lt IE 10 45 | script(src='assets/js/placeholder.js') 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /views/welcome.jade: -------------------------------------------------------------------------------- 1 | 2 | doctype html 3 | html(lang='en') 4 | head 5 | meta(charset='utf-8') 6 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 7 | meta(name='viewport', content='width=device-width, initial-scale=1') 8 | title Welcome 9 | // CSS 10 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/font.css') 11 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/bootstrap.min.css') 12 | link(rel='stylesheet', href='/stylesheets/assets/font-awesome/css/font-awesome.min.css') 13 | link(rel='stylesheet', href='/stylesheets/assets/css/form-elements.css') 14 | link(rel='stylesheet', href='/stylesheets/assets/css/style.css') 15 | body 16 | // Top content 17 | .top-content 18 | .inner-bg 19 | .container 20 | .row 21 | .col-sm-8.col-sm-offset-2.text 22 | h1 23 | strong Welcome 24 | .row 25 | .col-sm-3 26 | .col-sm-6.form-box 27 | .form-top 28 | .form-top-left 29 | h2 30 | center             Login As: 31 | .form-bottom 32 | center 33 | a.btn.btn-info(href='/login?usertype=admin', role='button') Admin 34 | br 35 | br 36 | a.btn.btn-info(href='/login?usertype=student', role='button') Student 37 | br 38 | br 39 | a.btn.btn-info(href='/login?usertype=faculty', role='button') Faculty 40 | // Javascript 41 | script(src='/stylesheets/assets/js/jquery-1.11.1.min.js') 42 | script(src='/stylesheets/assets/bootstrap/js/bootstrap.min.js') 43 | script(src='/stylesheets/assets/js/jquery.backstretch.min.js') 44 | script(src='/stylesheets/assets/js/scripts.js') 45 | //if lt IE 10 46 | script(src='assets/js/placeholder.js') 47 | 48 | 49 | -------------------------------------------------------------------------------- /bin/www: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /** 4 | * Module dependencies. 5 | */ 6 | 7 | var app = require('../app'); 8 | var debug = require('debug')('online_exam:server'); 9 | var http = require('http'); 10 | 11 | /** 12 | * Get port from environment and store in Express. 13 | */ 14 | 15 | var port = normalizePort(process.env.PORT || '3000'); 16 | app.set('port', port); 17 | 18 | /** 19 | * Create HTTP server. 20 | */ 21 | 22 | var server = http.createServer(app); 23 | 24 | /** 25 | * Listen on provided port, on all network interfaces. 26 | */ 27 | 28 | server.listen(port); 29 | server.on('error', onError); 30 | server.on('listening', onListening); 31 | 32 | /** 33 | * Normalize a port into a number, string, or false. 34 | */ 35 | 36 | function normalizePort(val) { 37 | var port = parseInt(val, 10); 38 | 39 | if (isNaN(port)) { 40 | // named pipe 41 | return val; 42 | } 43 | 44 | if (port >= 0) { 45 | // port number 46 | return port; 47 | } 48 | 49 | return false; 50 | } 51 | 52 | /** 53 | * Event listener for HTTP server "error" event. 54 | */ 55 | 56 | function onError(error) { 57 | if (error.syscall !== 'listen') { 58 | throw error; 59 | } 60 | 61 | var bind = typeof port === 'string' 62 | ? 'Pipe ' + port 63 | : 'Port ' + port; 64 | 65 | // handle specific listen errors with friendly messages 66 | switch (error.code) { 67 | case 'EACCES': 68 | console.error(bind + ' requires elevated privileges'); 69 | process.exit(1); 70 | break; 71 | case 'EADDRINUSE': 72 | console.error(bind + ' is already in use'); 73 | process.exit(1); 74 | break; 75 | default: 76 | throw error; 77 | } 78 | } 79 | 80 | /** 81 | * Event listener for HTTP server "listening" event. 82 | */ 83 | 84 | function onListening() { 85 | var addr = server.address(); 86 | var bind = typeof addr === 'string' 87 | ? 'pipe ' + addr 88 | : 'port ' + addr.port; 89 | debug('Listening on ' + bind); 90 | } 91 | -------------------------------------------------------------------------------- /views/faculties/get_username_edit.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang='en') 3 | head 4 | meta(charset='utf-8') 5 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 6 | meta(name='viewport', content='width=device-width, initial-scale=1') 7 | title Edit Faculty 8 | // CSS 9 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/font.css') 10 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/bootstrap.min.css') 11 | link(rel='stylesheet', href='/stylesheets/assets/font-awesome/css/font-awesome.min.css') 12 | link(rel='stylesheet', href='/stylesheets/assets/css/form-elements.css') 13 | link(rel='stylesheet', href='/stylesheets/assets/css/style.css') 14 | body 15 | // Top content 16 | .top-content 17 | .inner-bg 18 | .container 19 | .row 20 | .col-sm-8.col-sm-offset-2.text 21 | h1 22 | strong Edit Faculty 23 | .row 24 | .col-sm-3 25 | a.btn.btn-info(href='/admin/home', role='button') Go Back! 26 | .col-sm-6.form-box 27 | .form-top 28 | .form-top-left 29 | h3 Edit Faculty 30 | p Fill the username: 31 | .form-bottom 32 | form.login-form(role='form', action='edit', method='get') 33 | .form-group 34 | label.sr-only(for='form-username') Username 35 | input#form-username.form-username.form-control(type='text', name='username', placeholder='Username...') 36 | button.btn(type='submit') Details 37 | .col-sm-3 38 | a.btn.btn-info(href='../admin/logout', role='button') Logout! 39 | // Javascript 40 | script(src='/stylesheets/assets/js/jquery-1.11.1.min.js') 41 | script(src='/stylesheets/assets/bootstrap/js/bootstrap.min.js') 42 | script(src='/stylesheets/assets/js/jquery.backstretch.min.js') 43 | script(src='/stylesheets/assets/js/scripts.js') 44 | //if lt IE 10 45 | script(src='assets/js/placeholder.js') -------------------------------------------------------------------------------- /views/faculties/get_username_delete.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang='en') 3 | head 4 | meta(charset='utf-8') 5 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 6 | meta(name='viewport', content='width=device-width, initial-scale=1') 7 | title Delete Faculty 8 | // CSS 9 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/font.css') 10 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/bootstrap.min.css') 11 | link(rel='stylesheet', href='/stylesheets/assets/font-awesome/css/font-awesome.min.css') 12 | link(rel='stylesheet', href='/stylesheets/assets/css/form-elements.css') 13 | link(rel='stylesheet', href='/stylesheets/assets/css/style.css') 14 | body 15 | // Top content 16 | .top-content 17 | .inner-bg 18 | .container 19 | .row 20 | .col-sm-8.col-sm-offset-2.text 21 | h1 22 | strong Delete Faculty 23 | .row 24 | .col-sm-3 25 | a.btn.btn-info(href='/admin/home', role='button') Go Back! 26 | .col-sm-6.form-box 27 | .form-top 28 | .form-top-left 29 | h3 Edit Faculty 30 | p Fill the username: 31 | .form-bottom 32 | form.login-form(role='form', action='delete', method='post') 33 | .form-group 34 | label.sr-only(for='form-username') Username 35 | input#form-username.form-username.form-control(type='text', name='username', placeholder='Username...') 36 | button.btn(type='submit') Delete 37 | .col-sm-3 38 | a.btn.btn-info(href='../admin/logout', role='button') Logout! 39 | // Javascript 40 | script(src='/stylesheets/assets/js/jquery-1.11.1.min.js') 41 | script(src='/stylesheets/assets/bootstrap/js/bootstrap.min.js') 42 | script(src='/stylesheets/assets/js/jquery.backstretch.min.js') 43 | script(src='/stylesheets/assets/js/scripts.js') 44 | //if lt IE 10 45 | script(src='assets/js/placeholder.js') -------------------------------------------------------------------------------- /views/students/home.jade: -------------------------------------------------------------------------------- 1 | 2 | doctype html 3 | html(lang='en') 4 | head 5 | meta(charset='utf-8') 6 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 7 | meta(name='viewport', content='width=device-width, initial-scale=1') 8 | title Student Home 9 | // CSS 10 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/font.css') 11 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/bootstrap.min.css') 12 | link(rel='stylesheet', href='/stylesheets/assets/font-awesome/css/font-awesome.min.css') 13 | link(rel='stylesheet', href='/stylesheets/assets/css/form-elements.css') 14 | link(rel='stylesheet', href='/stylesheets/assets/css/style.css') 15 | body 16 | // Top content 17 | .top-content 18 | .inner-bg 19 | .container 20 | .row 21 | .col-sm-8.col-sm-offset-2.text 22 | h1 23 | strong Hello Student 24 | .row 25 | .col-sm-3 26 | 27 | .col-sm-6.form-box 28 | .form-top 29 | .form-top-left 30 | p What do you want to do? 31 | .form-bottom 32 | .form-group 33 |               34 | a.btn.btn-info(href='/take_exam/performance', role='button') View Performance 35 |                                            36 | a.btn.btn-info(href='/take_exam', role='button') Take Exam 37 | .form-group 38 | .col-sm-3 39 | a.btn.btn-info(href='/students/logout', role='button') Logout! 40 | // Javascript 41 | script(src='/stylesheets/assets/js/jquery-1.11.1.min.js') 42 | script(src='/stylesheets/assets/bootstrap/js/bootstrap.min.js') 43 | script(src='/stylesheets/assets/js/jquery.backstretch.min.js') 44 | script(src='/stylesheets/assets/js/scripts.js') 45 | //if lt IE 10 46 | script(src='assets/js/placeholder.js') 47 | -------------------------------------------------------------------------------- /views/students/get_username_edit.jade: -------------------------------------------------------------------------------- 1 | 2 | doctype html 3 | html(lang='en') 4 | head 5 | meta(charset='utf-8') 6 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 7 | meta(name='viewport', content='width=device-width, initial-scale=1') 8 | title Get UserName to Edit Student 9 | // CSS 10 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/font.css') 11 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/bootstrap.min.css') 12 | link(rel='stylesheet', href='/stylesheets/assets/font-awesome/css/font-awesome.min.css') 13 | link(rel='stylesheet', href='/stylesheets/assets/css/form-elements.css') 14 | link(rel='stylesheet', href='/stylesheets/assets/css/style.css') 15 | body 16 | // Top content 17 | .top-content 18 | .inner-bg 19 | .container 20 | .row 21 | .col-sm-8.col-sm-offset-2.text 22 | h1 23 | strong Edit Student 24 | .row 25 | .col-sm-3 26 | a.btn.btn-info(href='/admin/home', role='button') Go Back! 27 | .col-sm-6.form-box 28 | .form-top 29 | .form-top-left 30 | h3 Edit Student 31 | p Fill the username: 32 | .form-bottom 33 | form.login-form(role='form', action='edit', method='get') 34 | .form-group 35 | label.sr-only(for='form-username') Username 36 | input#form-username.form-username.form-control(type='text', name='username', placeholder='Username...') 37 | button.btn(type='submit') Details 38 | .col-sm-3 39 | a.btn.btn-info(href='../admin/logout', role='button') Logout! 40 | // Javascript 41 | script(src='/stylesheets/assets/js/jquery-1.11.1.min.js') 42 | script(src='/stylesheets/assets/bootstrap/js/bootstrap.min.js') 43 | script(src='/stylesheets/assets/js/jquery.backstretch.min.js') 44 | script(src='/stylesheets/assets/js/scripts.js') 45 | //if lt IE 10 46 | script(src='assets/js/placeholder.js') 47 | 48 | 49 | -------------------------------------------------------------------------------- /views/courses/get_courseid_edit.jade: -------------------------------------------------------------------------------- 1 | 2 | doctype html 3 | html(lang='en') 4 | head 5 | meta(charset='utf-8') 6 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 7 | meta(name='viewport', content='width=device-width, initial-scale=1') 8 | title Get CourseID to Edit Course 9 | // CSS 10 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/font.css') 11 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/bootstrap.min.css') 12 | link(rel='stylesheet', href='/stylesheets/assets/font-awesome/css/font-awesome.min.css') 13 | link(rel='stylesheet', href='/stylesheets/assets/css/form-elements.css') 14 | link(rel='stylesheet', href='/stylesheets/assets/css/style.css') 15 | body 16 | // Top content 17 | .top-content 18 | .inner-bg 19 | .container 20 | .row 21 | .col-sm-8.col-sm-offset-2.text 22 | h1 23 | strong Edit Course 24 | .row 25 | .col-sm-3 26 | a.btn.btn-info(href='/admin/home', role='button') Go Back! 27 | .col-sm-6.form-box 28 | .form-top 29 | .form-top-left 30 | h3 Edit Course 31 | p Fill the courseid: 32 | .form-bottom 33 | form.login-form(role='form', action='edit', method='get') 34 | .form-group 35 | label.sr-only(for='form-courseid') courseid 36 | input#form-courseid.form-courseid.form-control(type='text', name='courseid', placeholder='courseid...') 37 | button.btn(type='submit') Details 38 | .col-sm-3 39 | a.btn.btn-info(href='../admin/logout', role='button') Logout! 40 | // Javascript 41 | script(src='/stylesheets/assets/js/jquery-1.11.1.min.js') 42 | script(src='/stylesheets/assets/bootstrap/js/bootstrap.min.js') 43 | script(src='/stylesheets/assets/js/jquery.backstretch.min.js') 44 | script(src='/stylesheets/assets/js/scripts.js') 45 | //if lt IE 10 46 | script(src='assets/js/placeholder.js') 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /views/students/get_username_delete.jade: -------------------------------------------------------------------------------- 1 | 2 | doctype html 3 | html(lang='en') 4 | head 5 | meta(charset='utf-8') 6 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 7 | meta(name='viewport', content='width=device-width, initial-scale=1') 8 | title Get UserName to Delete Student 9 | // CSS 10 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/font.css') 11 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/bootstrap.min.css') 12 | link(rel='stylesheet', href='/stylesheets/assets/font-awesome/css/font-awesome.min.css') 13 | link(rel='stylesheet', href='/stylesheets/assets/css/form-elements.css') 14 | link(rel='stylesheet', href='/stylesheets/assets/css/style.css') 15 | body 16 | // Top content 17 | .top-content 18 | .inner-bg 19 | .container 20 | .row 21 | .col-sm-8.col-sm-offset-2.text 22 | h1 23 | strong Delete Student 24 | .row 25 | .col-sm-3 26 | a.btn.btn-info(href='/admin/home', role='button') Go Back! 27 | .col-sm-6.form-box 28 | .form-top 29 | .form-top-left 30 | h3 Delete Student 31 | p Fill the form to delete a student: 32 | .form-bottom 33 | form.login-form(role='form', action='delete', method='post') 34 | .form-group 35 | label.sr-only(for='form-username') Username 36 | input#form-username.form-username.form-control(type='text', name='username', placeholder='Username...') 37 | button.btn(type='submit') Details 38 | .col-sm-3 39 | a.btn.btn-info(href='../admin/logout', role='button') Logout! 40 | // Javascript 41 | script(src='/stylesheets/assets/js/jquery-1.11.1.min.js') 42 | script(src='/stylesheets/assets/bootstrap/js/bootstrap.min.js') 43 | script(src='/stylesheets/assets/js/jquery.backstretch.min.js') 44 | script(src='/stylesheets/assets/js/scripts.js') 45 | //if lt IE 10 46 | script(src='assets/js/placeholder.js') 47 | 48 | 49 | -------------------------------------------------------------------------------- /views/courses/get_courseid_delete.jade: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | doctype html 5 | html(lang='en') 6 | head 7 | meta(charset='utf-8') 8 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 9 | meta(name='viewport', content='width=device-width, initial-scale=1') 10 | title Get CourseID to Delete Course 11 | // CSS 12 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/font.css') 13 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/bootstrap.min.css') 14 | link(rel='stylesheet', href='/stylesheets/assets/font-awesome/css/font-awesome.min.css') 15 | link(rel='stylesheet', href='/stylesheets/assets/css/form-elements.css') 16 | link(rel='stylesheet', href='/stylesheets/assets/css/style.css') 17 | body 18 | // Top content 19 | .top-content 20 | .inner-bg 21 | .container 22 | .row 23 | .col-sm-8.col-sm-offset-2.text 24 | h1 25 | strong Delete Course 26 | .row 27 | .col-sm-3 28 | a.btn.btn-info(href='/admin/home', role='button') Go Back! 29 | .col-sm-6.form-box 30 | .form-top 31 | .form-top-left 32 | h3 Delete Course 33 | p Fill the courseid: 34 | .form-bottom 35 | form.login-form(role='form', action='delete', method='post') 36 | .form-group 37 | label.sr-only(for='form-courseid') courseid 38 | input#form-courseid.form-courseid.form-control(type='text', name='courseid', placeholder='courseid...') 39 | button.btn(type='submit') Delete 40 | .col-sm-3 41 | a.btn.btn-info(href='../admin/logout', role='button') Logout! 42 | // Javascript 43 | script(src='/stylesheets/assets/js/jquery-1.11.1.min.js') 44 | script(src='/stylesheets/assets/bootstrap/js/bootstrap.min.js') 45 | script(src='/stylesheets/assets/js/jquery.backstretch.min.js') 46 | script(src='/stylesheets/assets/js/scripts.js') 47 | //if lt IE 10 48 | script(src='assets/js/placeholder.js') 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /views/login.jade: -------------------------------------------------------------------------------- 1 | 2 | 3 | doctype html 4 | html(lang='en') 5 | head 6 | meta(charset='utf-8') 7 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 8 | meta(name='viewport', content='width=device-width, initial-scale=1') 9 | title Login 10 | // CSS 11 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/font.css') 12 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/bootstrap.min.css') 13 | link(rel='stylesheet', href='/stylesheets/assets/font-awesome/css/font-awesome.min.css') 14 | link(rel='stylesheet', href='/stylesheets/assets/css/form-elements.css') 15 | link(rel='stylesheet', href='/stylesheets/assets/css/style.css') 16 | body 17 | // Top content 18 | .top-content 19 | .inner-bg 20 | .container 21 | .row 22 | .col-sm-8.col-sm-offset-2.text 23 | h1 24 | strong Login 25 | .row 26 | .col-sm-3 27 | a.btn.btn-info(href='/', role='button') Go Back! 28 | .col-sm-6.form-box 29 | .form-top 30 | .form-top-left 31 | h3 Fill the form to sign in: 32 | .form-bottom 33 | form.login-form(role='formlogin', action='login/#{method}', method='post') 34 | .form-group 35 | label.sr-only(for='form-username') Username 36 | input#form-username.form-username.form-control(type='text', name='username', placeholder="username") 37 | .form-group 38 | label.sr-only(for='form-password') Password 39 | input#form-password.form-password.form-control(type='password', name='password', placeholder="password") 40 | button.btn(type='submit') Login 41 | .col-sm-3 42 | 43 | // Javascript 44 | script(src='/stylesheets/assets/js/jquery-1.11.1.min.js') 45 | script(src='/stylesheets/assets/bootstrap/js/bootstrap.min.js') 46 | script(src='/stylesheets/assets/js/jquery.backstretch.min.js') 47 | script(src='/stylesheets/assets/js/scripts.js') 48 | //if lt IE 10 49 | script(src='assets/js/placeholder.js') 50 | 51 | 52 | -------------------------------------------------------------------------------- /views/exams/question_list.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang='en') 3 | script(src='http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js') 4 | script(type='text/javascript')| var exam_code =!{JSON.stringify(exam.exam_code)}; 5 | script(src='/javascripts/display.js') 6 | head 7 | meta(charset='utf-8') 8 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 9 | meta(name='viewport', content='width=device-width, initial-scale=1') 10 | title Questions 11 | // CSS 12 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/font.css') 13 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/bootstrap.min.css') 14 | link(rel='stylesheet', href='/stylesheets/assets/font-awesome/css/font-awesome.min.css') 15 | link(rel='stylesheet', href='/stylesheets/assets/css/form-elements.css') 16 | link(rel='stylesheet', href='/stylesheets/assets/css/style.css') 17 | body 18 | // Top content 19 | .top-content 20 | .inner-bg 21 | .container 22 | .row 23 | .col-sm-8.col-sm-offset-2.text 24 | h1 25 | a.btn.btn-info(href='/faculties/home', role='button') Submit 26 |           27 | strong EXAM CODE: #{exam.exam_code} 28 |           29 | form.login-form(role='form', action='add_question', method='post') 30 | .form-group 31 | label.sr-only(for='form-exam_code') Exam Code 32 | input#form-exam_code.form-exam_code.form-control(type='hidden', name='exam_code', value=exam.exam_code) 33 | button.btn(type='submit') Add Question 34 | .row 35 | 36 | .col-sm-12.form-box 37 | .form-top 38 | .form-top-left 39 | h4#temp 40 | .form-bottom 41 | 42 | // Javascript 43 | script(src='/stylesheets/assets/js/jquery-1.11.1.min.js') 44 | script(src='/stylesheets/assets/bootstrap/js/bootstrap.min.js') 45 | script(src='/stylesheets/assets/js/jquery.backstretch.min.js') 46 | script(src='/stylesheets/assets/js/scripts.js') 47 | //if lt IE 10 48 | script(src='assets/js/placeholder.js') -------------------------------------------------------------------------------- /views/courses/new.jade: -------------------------------------------------------------------------------- 1 | 2 | doctype html 3 | html(lang='en') 4 | head 5 | meta(charset='utf-8') 6 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 7 | meta(name='viewport', content='width=device-width, initial-scale=1') 8 | title Add Course 9 | // CSS 10 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/font.css') 11 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/bootstrap.min.css') 12 | link(rel='stylesheet', href='/stylesheets/assets/font-awesome/css/font-awesome.min.css') 13 | link(rel='stylesheet', href='/stylesheets/assets/css/form-elements.css') 14 | link(rel='stylesheet', href='/stylesheets/assets/css/style.css') 15 | body 16 | // Top content 17 | .top-content 18 | .inner-bg 19 | .container 20 | .row 21 | .col-sm-8.col-sm-offset-2.text 22 | h1 23 | strong Add New Course 24 | .row 25 | .col-sm-3 26 | a.btn.btn-info(href='/admin/home', role='button') Go Back! 27 | .col-sm-6.form-box 28 | .form-top 29 | .form-top-left 30 | h3 Add New Course 31 | p Fill the form to add a new Course: 32 | .form-bottom 33 | form.login-form(role='form', action='create', method='post') 34 | .form-group 35 | label.sr-only(for='form-name') CourseName 36 | input#form-name.form-name.form-control(type='text', name='coursename', placeholder=course.coursename) 37 | .form-group 38 | label.sr-only(for='form-username') CourseID 39 | input#form-username.form-username.form-control(type='text', name='courseid', placeholder=course.courseid) 40 | button.btn(type='submit') Add 41 | .col-sm-3 42 | a.btn.btn-info(href='../admin/logout', role='button') Logout! 43 | // Javascript 44 | script(src='/stylesheets/assets/js/jquery-1.11.1.min.js') 45 | script(src='/stylesheets/assets/bootstrap/js/bootstrap.min.js') 46 | script(src='/stylesheets/assets/js/jquery.backstretch.min.js') 47 | script(src='/stylesheets/assets/js/scripts.js') 48 | //if lt IE 10 49 | script(src='assets/js/placeholder.js') 50 | 51 | -------------------------------------------------------------------------------- /views/faculties/assign.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang='en') 3 | head 4 | meta(charset='utf-8') 5 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 6 | meta(name='viewport', content='width=device-width, initial-scale=1') 7 | title Assign Course to a Faculty 8 | // CSS 9 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/font.css') 10 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/bootstrap.min.css') 11 | link(rel='stylesheet', href='/stylesheets/assets/font-awesome/css/font-awesome.min.css') 12 | link(rel='stylesheet', href='/stylesheets/assets/css/form-elements.css') 13 | link(rel='stylesheet', href='/stylesheets/assets/css/style.css') 14 | body 15 | // Top content 16 | .top-content 17 | .inner-bg 18 | .container 19 | .row 20 | .col-sm-8.col-sm-offset-2.text 21 | h1 22 | strong Assign Course 23 | .row 24 | .col-sm-3 25 | a.btn.btn-info(href='/admin/home', role='button') Go Back! 26 | .col-sm-6.form-box 27 | .form-top 28 | .form-top-left 29 | h3 Assign Course 30 | p Fill the form to assign a course to the faculty: 31 | .form-bottom 32 | form.login-form(role='form', action='assign', method='post') 33 | .form-group 34 | label.sr-only(for='form-username') Username 35 | input#form-username.form-username.form-control(type='text', name='username', placeholder='Username...') 36 | .form-group 37 | label.sr-only(for='form-courseid') CourseID 38 | input#form-courseid.form-courseid.form-control(type='text', name='courseid', placeholder='CourseID') 39 | button.btn(type='submit') Assign 40 | .col-sm-3 41 | a.btn.btn-info(href='../admin/logout', role='button') Logout! 42 | // Javascript 43 | script(src='/stylesheets/assets/js/jquery-1.11.1.min.js') 44 | script(src='/stylesheets/assets/bootstrap/js/bootstrap.min.js') 45 | script(src='/stylesheets/assets/js/jquery.backstretch.min.js') 46 | script(src='/stylesheets/assets/js/scripts.js') 47 | //if lt IE 10 48 | script(src='assets/js/placeholder.js') -------------------------------------------------------------------------------- /views/faculties/unassign.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang='en') 3 | head 4 | meta(charset='utf-8') 5 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 6 | meta(name='viewport', content='width=device-width, initial-scale=1') 7 | title Add Faculty 8 | // CSS 9 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/font.css') 10 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/bootstrap.min.css') 11 | link(rel='stylesheet', href='/stylesheets/assets/font-awesome/css/font-awesome.min.css') 12 | link(rel='stylesheet', href='/stylesheets/assets/css/form-elements.css') 13 | link(rel='stylesheet', href='/stylesheets/assets/css/style.css') 14 | body 15 | // Top content 16 | .top-content 17 | .inner-bg 18 | .container 19 | .row 20 | .col-sm-8.col-sm-offset-2.text 21 | h1 22 | strong Unassign course 23 | .row 24 | .col-sm-3 25 | a.btn.btn-info(href='/admin/home', role='button') Go Back! 26 | .col-sm-6.form-box 27 | .form-top 28 | .form-top-left 29 | h3 Unassign a course 30 | p Fill the form to unassign a course from the faculty: 31 | .form-bottom 32 | form.login-form(role='form', action='unassign', method='post') 33 | .form-group 34 | label.sr-only(for='form-username') Username 35 | input#form-username.form-username.form-control(type='text', name='username', placeholder='Username...') 36 | .form-group 37 | label.sr-only(for='form-courseid') Password 38 | input#form-courseid.form-courseid.form-control(type='text', name='courseid', placeholder='CourseID...') 39 | button.btn(type='submit') Unassign 40 | .col-sm-3 41 | a.btn.btn-info(href='../admin/logout', role='button') Logout! 42 | // Javascript 43 | script(src='/stylesheets/assets/js/jquery-1.11.1.min.js') 44 | script(src='/stylesheets/assets/bootstrap/js/bootstrap.min.js') 45 | script(src='/stylesheets/assets/js/jquery.backstretch.min.js') 46 | script(src='/stylesheets/assets/js/scripts.js') 47 | //if lt IE 10 48 | script(src='assets/js/placeholder.js') -------------------------------------------------------------------------------- /views/exams/take_exam_code_entry.jade: -------------------------------------------------------------------------------- 1 | 2 | doctype html 3 | html(lang='en') 4 | head 5 | meta(charset='utf-8') 6 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 7 | meta(name='viewport', content='width=device-width, initial-scale=1') 8 | title Get exam_code for taking test 9 | // CSS 10 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/font.css') 11 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/bootstrap.min.css') 12 | link(rel='stylesheet', href='/stylesheets/assets/font-awesome/css/font-awesome.min.css') 13 | link(rel='stylesheet', href='/stylesheets/assets/css/form-elements.css') 14 | link(rel='stylesheet', href='/stylesheets/assets/css/style.css') 15 | body 16 | // Top content 17 | .top-content 18 | .inner-bg 19 | .container 20 | .row 21 | .col-sm-8.col-sm-offset-2.text 22 | h1 23 | strong Take Exam 24 | .row 25 | .col-sm-3 26 | a.btn.btn-info(href='../students/home', role='button') Go Back! 27 | .col-sm-6.form-box 28 | .form-top 29 | .form-top-left 30 | p Fill the exam_code: 31 | .form-bottom 32 | form.login-form(role='form', action='/take_exam/exam', method='post' , name='takeexam') 33 | .form-group 34 | label.sr-only(for='form-exam_code') exam_code 35 | input#form-exam_code.form-exam_code.form-control(type='text', name='exam_code', value=exam_code) 36 | .form-group 37 | label.sr-only(for='form-exam_code') exam_code 38 | input#form-exam_code.form-exam_code.form-control(type='hidden', name='username', value=username) 39 | button.btn(type='submit') Submit 40 | .col-sm-3 41 | a.btn.btn-info(href='../students/logout', role='button') Logout! 42 | // Javascript 43 | script(src='/stylesheets/assets/js/jquery-1.11.1.min.js') 44 | script(src='/stylesheets/assets/bootstrap/js/bootstrap.min.js') 45 | script(src='/stylesheets/assets/js/jquery.backstretch.min.js') 46 | script(src='/stylesheets/assets/js/scripts.js') 47 | //if lt IE 10 48 | script(src='assets/js/placeholder.js') 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /views/students/register.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang='en') 3 | head 4 | meta(charset='utf-8') 5 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 6 | meta(name='viewport', content='width=device-width, initial-scale=1') 7 | title Register Student to a Course 8 | // CSS 9 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/font.css') 10 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/bootstrap.min.css') 11 | link(rel='stylesheet', href='/stylesheets/assets/font-awesome/css/font-awesome.min.css') 12 | link(rel='stylesheet', href='/stylesheets/assets/css/form-elements.css') 13 | link(rel='stylesheet', href='/stylesheets/assets/css/style.css') 14 | body 15 | // Top content 16 | .top-content 17 | .inner-bg 18 | .container 19 | .row 20 | .col-sm-8.col-sm-offset-2.text 21 | h1 22 | strong Register Student 23 | .row 24 | .col-sm-3 25 | a.btn.btn-info(href='/admin/home', role='button') Go Back! 26 | .col-sm-6.form-box 27 | .form-top 28 | .form-top-left 29 | h3 Register Student 30 | p Fill the form to register student to a course: 31 | .form-bottom 32 | form.login-form(role='form', action='register', method='post') 33 | .form-group 34 | label.sr-only(for='form-username') Username 35 | input#form-username.form-username.form-control(type='text', name='username', placeholder='Username...') 36 | .form-group 37 | label.sr-only(for='form-courseid') CourseID 38 | input#form-courseid.form-courseid.form-control(type='text', name='courseid', placeholder='CourseID') 39 | button.btn(type='submit') Register 40 | .col-sm-3 41 | a.btn.btn-info(href='../admin/logout', role='button') Logout! 42 | // Javascript 43 | script(src='/stylesheets/assets/js/jquery-1.11.1.min.js') 44 | script(src='/stylesheets/assets/bootstrap/js/bootstrap.min.js') 45 | script(src='/stylesheets/assets/js/jquery.backstretch.min.js') 46 | script(src='/stylesheets/assets/js/scripts.js') 47 | //if lt IE 10 48 | script(src='assets/js/placeholder.js') -------------------------------------------------------------------------------- /views/students/deregister.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang='en') 3 | head 4 | meta(charset='utf-8') 5 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 6 | meta(name='viewport', content='width=device-width, initial-scale=1') 7 | title Deregister Student to a Course 8 | // CSS 9 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/font.css') 10 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/bootstrap.min.css') 11 | link(rel='stylesheet', href='/stylesheets/assets/font-awesome/css/font-awesome.min.css') 12 | link(rel='stylesheet', href='/stylesheets/assets/css/form-elements.css') 13 | link(rel='stylesheet', href='/stylesheets/assets/css/style.css') 14 | body 15 | // Top content 16 | .top-content 17 | .inner-bg 18 | .container 19 | .row 20 | .col-sm-8.col-sm-offset-2.text 21 | h1 22 | strong Deregister Student 23 | .row 24 | .col-sm-3 25 | a.btn.btn-info(href='/admin/home', role='button') Go Back! 26 | .col-sm-6.form-box 27 | .form-top 28 | .form-top-left 29 | h3 Deregister Student 30 | p Fill the form to register student to a course: 31 | .form-bottom 32 | form.login-form(role='form', action='deregister', method='post') 33 | .form-group 34 | label.sr-only(for='form-username') Username 35 | input#form-username.form-username.form-control(type='text', name='username', placeholder='Username...') 36 | .form-group 37 | label.sr-only(for='form-courseid') CourseID 38 | input#form-courseid.form-courseid.form-control(type='text', name='courseid', placeholder='CourseID') 39 | button.btn(type='submit') Deregister 40 | .col-sm-3 41 | a.btn.btn-info(href='../admin/logout', role='button') Logout! 42 | // Javascript 43 | script(src='/stylesheets/assets/js/jquery-1.11.1.min.js') 44 | script(src='/stylesheets/assets/bootstrap/js/bootstrap.min.js') 45 | script(src='/stylesheets/assets/js/jquery.backstretch.min.js') 46 | script(src='/stylesheets/assets/js/scripts.js') 47 | //if lt IE 10 48 | script(src='assets/js/placeholder.js') -------------------------------------------------------------------------------- /views/exams/view_performance_code_entry.jade: -------------------------------------------------------------------------------- 1 | 2 | doctype html 3 | html(lang='en') 4 | head 5 | meta(charset='utf-8') 6 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 7 | meta(name='viewport', content='width=device-width, initial-scale=1') 8 | title Get exam_code to view performance 9 | // CSS 10 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/font.css') 11 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/bootstrap.min.css') 12 | link(rel='stylesheet', href='/stylesheets/assets/font-awesome/css/font-awesome.min.css') 13 | link(rel='stylesheet', href='/stylesheets/assets/css/form-elements.css') 14 | link(rel='stylesheet', href='/stylesheets/assets/css/style.css') 15 | body 16 | // Top content 17 | .top-content 18 | .inner-bg 19 | .container 20 | .row 21 | .col-sm-8.col-sm-offset-2.text 22 | h1 23 | strong View Performance 24 | .row 25 | .col-sm-3 26 | a.btn.btn-info(href='../students/home', role='button') Go Back! 27 | .col-sm-6.form-box 28 | .form-top 29 | .form-top-left 30 | p Fill the exam_code: 31 | .form-bottom 32 | form.login-form(role='form', action='performance_view', method='post' , name='takeexam') 33 | .form-group 34 | label.sr-only(for='form-exam_code') exam_code 35 | input#form-exam_code.form-exam_code.form-control(type='text', name='exam_code', value=exam_code) 36 | .form-group 37 | label.sr-only(for='form-username') username 38 | input#form-username.form-username.form-control(type='hidden', name='username', value=username) 39 | button.btn(type='submit') Submit 40 | .col-sm-3 41 | a.btn.btn-info(href='../students/logout', role='button') Logout! 42 | // Javascript 43 | script(src='/stylesheets/assets/js/jquery-1.11.1.min.js') 44 | script(src='/stylesheets/assets/bootstrap/js/bootstrap.min.js') 45 | script(src='/stylesheets/assets/js/jquery.backstretch.min.js') 46 | script(src='/stylesheets/assets/js/scripts.js') 47 | //if lt IE 10 48 | script(src='assets/js/placeholder.js') 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Welcome to Online Objective Examination System 2 | 3 | Online Objective Examination System(OOES) is a web application developed using Node.js platform and a lightweight Node.js framework Express.js. The templating engine used is Jade and the database used is MongoDB. 4 | 5 | OOES can be operated by three different types of users- Admin, Student and Faculty. They can login valid credentials(College ID and Password). Once logged in, their data is stored in a session using Passport.js and they can logout from it anytime they wish. 6 | 7 | The Admin is allowed to add, edit and delete Student and Faculty users. They can also add, edit and delete Courses. In addition to this, they can register a Student to a particular course and deregister him from the same. The Admin can also assign a course to a Faculty and deassign him from the same. Admin users are directly managed using the database and cannot be created or deleted through the software. 8 | 9 | Faculty users are allowed to create exams for the courses they teach. They can set the name and code of the exam, its duration and the number of questions. 10 | 11 | Student users can take the exams of the courses they are registered in. Once an exam is successfully submitted by the student, he cannot attempt it again. The Students have an option to view their performance in the past exams. 12 | 13 | ## Getting Started 14 | 15 | 1. Extract the zip file of the GitHub repository to an empty folder. Let this folder be called OOES. 16 | 17 | 2. Install Node.js version '4.4.0' using the command line or from the setup at Node.js website. This installs Node.js and NPM(Node Package Manager) as well. 18 | 19 | 3. Install the Node package Express(this is for the Node.js framework Express.js) globally using NPM install. 20 | 21 | 4. Install MongoDB from MongoDB website. Start Mongo Daemon and set the dbpath to OOES/data. 22 | 23 | 5. Start the application using the command npm start after navigating to OOES folder. 24 | 25 | 6. Using a browser, go to http://localhost:3000 and you'll see the application running! 26 | 27 | ## Setting Up Default Admin User 28 | 29 | Create an admin user in database to log in. Set up MongoDB on port 27017. Create a new DB called examdb. Create a new collection called admin. Add the following entry (directly to DB): 30 | {username: DESIRED_ADMIN_USERNAME, password: DESIRED_ADMIN_PASSWORD}. 31 | 32 | ## Contributing 33 | 34 | We encourage you to contribute to OOES project. Suggest new features and fix bugs to contribute! 35 | 36 | -------------------------------------------------------------------------------- /views/faculties/edit.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang='en') 3 | head 4 | meta(charset='utf-8') 5 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 6 | meta(name='viewport', content='width=device-width, initial-scale=1') 7 | title Edit Faculty 8 | // CSS 9 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/font.css') 10 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/bootstrap.min.css') 11 | link(rel='stylesheet', href='/stylesheets/assets/font-awesome/css/font-awesome.min.css') 12 | link(rel='stylesheet', href='/stylesheets/assets/css/form-elements.css') 13 | link(rel='stylesheet', href='/stylesheets/assets/css/style.css') 14 | body 15 | // Top content 16 | .top-content 17 | .inner-bg 18 | .container 19 | .row 20 | .col-sm-8.col-sm-offset-2.text 21 | h1 22 | strong Edit Faculty 23 | .row 24 | .col-sm-3 25 | a.btn.btn-info(href='/admin/home', role='button') Go Back! 26 | .col-sm-6.form-box 27 | .form-top 28 | .form-top-left 29 | h3 Edit Faculty 30 | p Fill the form to edit the faculty details: 31 | .form-bottom 32 | form.login-form(role='form', action='update', method='post') 33 | .form-group 34 | label.sr-only(for='form-password') Name 35 | input#form-password.form-password.form-control(type='text', name='', value=student.name) 36 | .form-group 37 | label.sr-only(for='form-password') Username 38 | input#form-password.form-password.form-control(type='text', name='', value=student.username) 39 | .form-group 40 | label.sr-only(for='form-password') Password 41 | input#form-password.form-password.form-control(type='password', name='password', placeholder='Password...') 42 | button.btn(type='submit') Edit 43 | .col-sm-3 44 | a.btn.btn-info(href='../admin/logout', role='button') Logout! 45 | // Javascript 46 | script(src='/stylesheets/assets/js/jquery-1.11.1.min.js') 47 | script(src='/stylesheets/assets/bootstrap/js/bootstrap.min.js') 48 | script(src='/stylesheets/assets/js/jquery.backstretch.min.js') 49 | script(src='/stylesheets/assets/js/scripts.js') 50 | //if lt IE 10 51 | script(src='assets/js/placeholder.js') -------------------------------------------------------------------------------- /views/faculties/new.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang='en') 3 | head 4 | meta(charset='utf-8') 5 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 6 | meta(name='viewport', content='width=device-width, initial-scale=1') 7 | title Add Faculty 8 | // CSS 9 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/font.css') 10 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/bootstrap.min.css') 11 | link(rel='stylesheet', href='/stylesheets/assets/font-awesome/css/font-awesome.min.css') 12 | link(rel='stylesheet', href='/stylesheets/assets/css/form-elements.css') 13 | link(rel='stylesheet', href='/stylesheets/assets/css/style.css') 14 | body 15 | // Top content 16 | .top-content 17 | .inner-bg 18 | .container 19 | .row 20 | .col-sm-8.col-sm-offset-2.text 21 | h1 22 | strong Add New Faculty 23 | .row 24 | .col-sm-3 25 | a.btn.btn-info(href='/admin/home', role='button') Go Back! 26 | .col-sm-6.form-box 27 | .form-top 28 | .form-top-left 29 | h3 Add New Faculty 30 | p Fill the form to add a new faculty: 31 | .form-bottom 32 | form.login-form(role='form', action='create', method='post') 33 | .form-group 34 | label.sr-only(for='form-name') Name 35 | input#form-name.form-name.form-control(type='text', name='name', placeholder='Name...') 36 | .form-group 37 | label.sr-only(for='form-username') Username 38 | input#form-username.form-username.form-control(type='text', name='username', placeholder='Username...') 39 | .form-group 40 | label.sr-only(for='form-password') Password 41 | input#form-password.form-password.form-control(type='password', name='password', placeholder='Password...') 42 | button.btn(type='submit') Add 43 | .col-sm-3 44 | a.btn.btn-info(href='../admin/logout', role='button') Logout! 45 | // Javascript 46 | script(src='/stylesheets/assets/js/jquery-1.11.1.min.js') 47 | script(src='/stylesheets/assets/bootstrap/js/bootstrap.min.js') 48 | script(src='/stylesheets/assets/js/jquery.backstretch.min.js') 49 | script(src='/stylesheets/assets/js/scripts.js') 50 | //if lt IE 10 51 | script(src='assets/js/placeholder.js') -------------------------------------------------------------------------------- /views/courses/edit.jade: -------------------------------------------------------------------------------- 1 | 2 | 3 | doctype html 4 | html(lang='en') 5 | head 6 | meta(charset='utf-8') 7 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 8 | meta(name='viewport', content='width=device-width, initial-scale=1') 9 | title Edit Course 10 | // CSS 11 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/font.css') 12 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/bootstrap.min.css') 13 | link(rel='stylesheet', href='/stylesheets/assets/font-awesome/css/font-awesome.min.css') 14 | link(rel='stylesheet', href='/stylesheets/assets/css/form-elements.css') 15 | link(rel='stylesheet', href='/stylesheets/assets/css/style.css') 16 | body 17 | // Top content 18 | .top-content 19 | .inner-bg 20 | .container 21 | .row 22 | .col-sm-8.col-sm-offset-2.text 23 | h1 24 | strong Edit Course 25 | .row 26 | .col-sm-3 27 | a.btn.btn-info(href='/admin/home', role='button') Go Back! 28 | .col-sm-6.form-box 29 | .form-top 30 | .form-top-left 31 | h3 Edit Course 32 | p Fill the form to add a new Course: 33 | .form-bottom 34 | form.login-form(role='form', action='update', method='post') 35 | .form-group 36 | label.sr-only(for='form-name') CourseName 37 | input#form-name.form-name.form-control(type='text', name='coursename', value=course.coursename) 38 | 39 | .form-group 40 | label.sr-only(for='form-courseid') courseid 41 | input#form-courseid.form-courseid.form-control(type='text', name='courseid', value=course.courseid) 42 | 43 | .form-group 44 | label.sr-only(for='form-password') Previous 45 | input#form-password.form-password.form-control(type='hidden', name='', value=course.courseid) 46 | 47 | button.btn(type='submit') Edit 48 | .col-sm-3 49 | a.btn.btn-info(href='../admin/logout', role='button') Logout! 50 | // Javascript 51 | script(src='/stylesheets/assets/js/jquery-1.11.1.min.js') 52 | script(src='/stylesheets/assets/bootstrap/js/bootstrap.min.js') 53 | script(src='/stylesheets/assets/js/jquery.backstretch.min.js') 54 | script(src='/stylesheets/assets/js/scripts.js') 55 | //if lt IE 10 56 | script(src='assets/js/placeholder.js') 57 | -------------------------------------------------------------------------------- /config/passport.js: -------------------------------------------------------------------------------- 1 | var LocalStrategy = require('passport-local').Strategy; 2 | 3 | var AdminUser = require('../models/admin.js'); 4 | var StudentUser = require('../models/student.js'); 5 | var FacultyUser = require('../models/faculty.js'); 6 | 7 | module.exports = function(passport) { 8 | 9 | passport.serializeUser(function (user, done) { 10 | done(null, JSON.stringify(user)); 11 | }); 12 | 13 | passport.deserializeUser(function (user, done) { 14 | done(null, JSON.parse(user)); 15 | }); 16 | 17 | passport.use('local-login-admin', new LocalStrategy({ 18 | passReqToCallback : true 19 | }, 20 | function(req, username, password, done) { 21 | AdminUser.findByUserName(username, function(err, user) { 22 | if (err) 23 | return done(err); 24 | if (!user) 25 | return done(null, false, req.flash('loginMessage', 'No user found.')); 26 | if (user.password!=password) 27 | return done(null, false, req.flash('loginMessage', 'Oops! Wrong password.')); 28 | user.usertype='admin'; 29 | return done(null, user); 30 | }); 31 | 32 | })); 33 | 34 | passport.use('local-login-student', new LocalStrategy({ 35 | passReqToCallback : true 36 | }, 37 | function(req, username, password, done) { 38 | StudentUser.findByUserName(username, function(err, user) { 39 | if (err) 40 | return done(err); 41 | if (!user) 42 | return done(null, false, req.flash('loginMessage', 'No user found.')); 43 | if (user.password!=password) 44 | return done(null, false, req.flash('loginMessage', 'Oops! Wrong password.')); 45 | user.usertype='student'; 46 | return done(null, user); 47 | }); 48 | 49 | })); 50 | 51 | passport.use('local-login-faculty', new LocalStrategy({ 52 | passReqToCallback : true 53 | }, 54 | function(req, username, password, done) { 55 | FacultyUser.findByUserName(username, function(err, user) { 56 | if (err) 57 | return done(err); 58 | if (!user) 59 | return done(null, false, req.flash('loginMessage', 'No user found.')); 60 | if (user.password!=password) 61 | return done(null, false, req.flash('loginMessage', 'Oops! Wrong password.')); 62 | user.usertype='faculty'; 63 | return done(null, user); 64 | }); 65 | 66 | })); 67 | 68 | }; 69 | -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var path = require('path'); 3 | var favicon = require('serve-favicon'); 4 | var passport = require('passport'); 5 | var flash = require('connect-flash'); 6 | var logger = require('morgan'); 7 | var cookieParser = require('cookie-parser'); 8 | var bodyParser = require('body-parser'); 9 | var session = require('express-session'); 10 | 11 | var app = express(); 12 | 13 | require('./config/passport')(passport); 14 | 15 | // uncomment after placing your favicon in /public 16 | //app.use(favicon(path.join(__dirname, 'public', 'favicon.ico'))); 17 | app.use(logger('dev')); 18 | app.use(cookieParser()); 19 | app.use(bodyParser.json()); 20 | app.use(bodyParser.urlencoded({ extended: false })); 21 | app.use(express.static(path.join(__dirname, 'public'))); 22 | 23 | // view engine setup 24 | app.set('views', path.join(__dirname, 'views')); 25 | app.set('view engine', 'jade'); 26 | 27 | app.use(session({secret: 'my_app_secret'})); 28 | app.use(passport.initialize()); 29 | app.use(passport.session()); 30 | app.use(flash()); 31 | 32 | var monk = require('monk'); 33 | var db = monk('localhost:2701/examdb'); 34 | 35 | var index = require('./controllers/index'); 36 | var students = require('./controllers/students'); 37 | var courses = require('./controllers/courses'); 38 | var faculties = require('./controllers/faculties'); 39 | var make_exam = require('./controllers/make_exam_controller'); 40 | var take_exam = require('./controllers/take_exam_controller'); 41 | var admin = require('./controllers/admin'); 42 | var login = require('./controllers/login_controller'); 43 | 44 | app.use('/',index); 45 | app.use('/students', students); 46 | app.use('/courses', courses); 47 | app.use('/faculties', faculties); 48 | app.use('/make_exam', make_exam); 49 | app.use('/take_exam', take_exam); 50 | app.use('/admin', admin); 51 | app.use('/login', login); 52 | 53 | // catch 404 and forward to error handler 54 | app.use(function(req, res, next) { 55 | var err = new Error('Not Found'); 56 | err.status = 404; 57 | next(err); 58 | }); 59 | 60 | // error handlers 61 | 62 | // development error handler 63 | // will print stacktrace 64 | if (app.get('env') === 'development') { 65 | app.use(function(err, req, res, next) { 66 | res.status(err.status || 500); 67 | res.render('error', { 68 | message: err.message, 69 | error: err 70 | }); 71 | }); 72 | } 73 | 74 | // production error handler 75 | // no stacktraces leaked to user 76 | app.use(function(err, req, res, next) { 77 | res.status(err.status || 500); 78 | res.render('error', { 79 | message: err.message, 80 | error: {} 81 | }); 82 | }); 83 | 84 | 85 | module.exports = app; 86 | -------------------------------------------------------------------------------- /views/students/new.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang='en') 3 | head 4 | meta(charset='utf-8') 5 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 6 | meta(name='viewport', content='width=device-width, initial-scale=1') 7 | title Add Student 8 | // CSS 9 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/font.css') 10 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/bootstrap.min.css') 11 | link(rel='stylesheet', href='/stylesheets/assets/font-awesome/css/font-awesome.min.css') 12 | link(rel='stylesheet', href='/stylesheets/assets/css/form-elements.css') 13 | link(rel='stylesheet', href='/stylesheets/assets/css/style.css') 14 | body 15 | // Top content 16 | .top-content 17 | .inner-bg 18 | .container 19 | .row 20 | .col-sm-8.col-sm-offset-2.text 21 | h1 22 | strong Add New Student 23 | .row 24 | .col-sm-3 25 | a.btn.btn-info(href='/admin/home', role='button') Go Back! 26 | .col-sm-6.form-box 27 | .form-top 28 | .form-top-left 29 | h3 Add New Student 30 | p Fill the form to add a new student: 31 | .form-bottom 32 | form.login-form(role='form', action='create', method='post') 33 | .form-group 34 | label.sr-only(for='form-name') Name 35 | input#form-name.form-name.form-control(type='text', name='name', placeholder=student.name) 36 | .form-group 37 | label.sr-only(for='form-roll') Roll Number 38 | input#form-roll.form-roll.form-control(type='text', name='rollno', placeholder=student.rollno) 39 | .form-group 40 | label.sr-only(for='form-username') Username 41 | input#form-username.form-username.form-control(type='text', name='username', placeholder=student.username) 42 | .form-group 43 | label.sr-only(for='form-password') Password 44 | input#form-password.form-password.form-control(type='password', name='password', placeholder=student.password) 45 | button.btn(type='submit') Add 46 | .col-sm-3 47 | a.btn.btn-info(href='../admin/logout', role='button') Logout! 48 | // Javascript 49 | script(src='/stylesheets/assets/js/jquery-1.11.1.min.js') 50 | script(src='/stylesheets/assets/bootstrap/js/bootstrap.min.js') 51 | script(src='/stylesheets/assets/js/jquery.backstretch.min.js') 52 | script(src='/stylesheets/assets/js/scripts.js') 53 | //if lt IE 10 54 | script(src='assets/js/placeholder.js') 55 | -------------------------------------------------------------------------------- /public/stylesheets/assets/css/form-elements.css: -------------------------------------------------------------------------------- 1 | 2 | input[type="text"], 3 | input[type="password"], 4 | textarea, 5 | textarea.form-control { 6 | height: 50px; 7 | margin: 0; 8 | padding: 0 20px; 9 | vertical-align: middle; 10 | background: #f8f8f8; 11 | border: 3px solid #ddd; 12 | font-family: 'Roboto', sans-serif; 13 | font-size: 16px; 14 | font-weight: 300; 15 | line-height: 50px; 16 | color: #888; 17 | -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; 18 | -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; 19 | -o-transition: all .3s; -moz-transition: all .3s; -webkit-transition: all .3s; -ms-transition: all .3s; transition: all .3s; 20 | } 21 | 22 | textarea, 23 | textarea.form-control { 24 | padding-top: 10px; 25 | padding-bottom: 10px; 26 | line-height: 30px; 27 | } 28 | 29 | input[type="text"]:focus, 30 | input[type="password"]:focus, 31 | textarea:focus, 32 | textarea.form-control:focus { 33 | outline: 0; 34 | background: #fff; 35 | border: 3px solid #ccc; 36 | -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; 37 | } 38 | 39 | input[type="text"]:-moz-placeholder, input[type="password"]:-moz-placeholder, 40 | textarea:-moz-placeholder, textarea.form-control:-moz-placeholder { color: #888; } 41 | 42 | input[type="text"]:-ms-input-placeholder, input[type="password"]:-ms-input-placeholder, 43 | textarea:-ms-input-placeholder, textarea.form-control:-ms-input-placeholder { color: #888; } 44 | 45 | input[type="text"]::-webkit-input-placeholder, input[type="password"]::-webkit-input-placeholder, 46 | textarea::-webkit-input-placeholder, textarea.form-control::-webkit-input-placeholder { color: #888; } 47 | 48 | 49 | 50 | button.btn { 51 | height: 50px; 52 | margin: 0; 53 | padding: 0 20px; 54 | vertical-align: middle; 55 | background: #de995e; 56 | border: 0; 57 | font-family: 'Roboto', sans-serif; 58 | font-size: 16px; 59 | font-weight: 300; 60 | line-height: 50px; 61 | color: #fff; 62 | -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; 63 | text-shadow: none; 64 | -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; 65 | -o-transition: all .3s; -moz-transition: all .3s; -webkit-transition: all .3s; -ms-transition: all .3s; transition: all .3s; 66 | } 67 | 68 | button.btn:hover { opacity: 0.6; color: #fff; } 69 | 70 | button.btn:active { outline: 0; opacity: 0.6; color: #fff; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; } 71 | 72 | button.btn:focus { outline: 0; opacity: 0.6; background: #de995e; color: #fff; } 73 | 74 | button.btn:active:focus, button.btn.active:focus { outline: 0; opacity: 0.6; background: #de995e; color: #fff; } 75 | -------------------------------------------------------------------------------- /views/students/edit.jade: -------------------------------------------------------------------------------- 1 | 2 | 3 | doctype html 4 | html(lang='en') 5 | head 6 | meta(charset='utf-8') 7 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 8 | meta(name='viewport', content='width=device-width, initial-scale=1') 9 | title Edit Student 10 | // CSS 11 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/font.css') 12 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/bootstrap.min.css') 13 | link(rel='stylesheet', href='/stylesheets/assets/font-awesome/css/font-awesome.min.css') 14 | link(rel='stylesheet', href='/stylesheets/assets/css/form-elements.css') 15 | link(rel='stylesheet', href='/stylesheets/assets/css/style.css') 16 | body 17 | // Top content 18 | .top-content 19 | .inner-bg 20 | .container 21 | .row 22 | .col-sm-8.col-sm-offset-2.text 23 | h1 24 | strong Edit Student 25 | .row 26 | .col-sm-3 27 | a.btn.btn-info(href='/admin/home', role='button') Go Back! 28 | .col-sm-6.form-box 29 | .form-top 30 | .form-top-left 31 | h3 Edit Student 32 | p Fill the form to add a new student: 33 | .form-bottom 34 | form.login-form(role='form', action='update', method='post') 35 | .form-group 36 | label.sr-only(for='form-name') Name 37 | input#form-name.form-name.form-control(type='text', name='name', value=student.name) 38 | 39 | .form-group 40 | label.sr-only(for='form-roll') Roll Number 41 | input#form-roll.form-roll.form-control(type='text', name='rollno', value=student.rollno) 42 | 43 | .form-group 44 | label.sr-only(for='form-username') Username 45 | input#form-username.form-username.form-control(type='text', name='username', value=student.username) 46 | 47 | .form-group 48 | label.sr-only(for='form-password') Password 49 | input#form-password.form-password.form-control(type='password', name='password', value=student.password) 50 | 51 | .form-group 52 | label.sr-only(for='form-password') Previous 53 | input#form-password.form-password.form-control(type='hidden', name='', value=student.username) 54 | 55 | button.btn(type='submit') Edit 56 | .col-sm-3 57 | a.btn.btn-info(href='../admin/logout', role='button') Logout! 58 | // Javascript 59 | script(src='/stylesheets/assets/js/jquery-1.11.1.min.js') 60 | script(src='/stylesheets/assets/bootstrap/js/bootstrap.min.js') 61 | script(src='/stylesheets/assets/js/jquery.backstretch.min.js') 62 | script(src='/stylesheets/assets/js/scripts.js') 63 | //if lt IE 10 64 | script(src='assets/js/placeholder.js') 65 | -------------------------------------------------------------------------------- /controllers/courses.js: -------------------------------------------------------------------------------- 1 | var express = require('express') 2 | , router = express.Router() 3 | , Course = require('../models/course'); 4 | 5 | var default_courseid = "CourseID"; 6 | 7 | var default_course = { 8 | courseid: "CourseID", 9 | coursename: "coursename" 10 | }; 11 | 12 | router.get('/new', isLoggedIn, function(req, res) { 13 | res.render('courses/new', { title: 'Add New course', course: default_course}); 14 | }); 15 | 16 | router.post('/create', isLoggedIn, function(req, res) { 17 | var course = { 18 | courseid: req.body.courseid, 19 | coursename: req.body.coursename 20 | }; 21 | var courseid = req.body.courseid; 22 | 23 | Course.getBycourseid(courseid, function(err,doc) { 24 | if(err) 25 | res.send("Some error occured"); 26 | else if(doc) 27 | res.redirect('/courses/new'); 28 | else{ 29 | Course.create(course, function(err, doc) { 30 | if(err) 31 | res.send("Some error occured"); 32 | else 33 | res.redirect('/admin/home'); 34 | }) } 35 | }) 36 | }); 37 | 38 | router.get('/get_courseid_edit', isLoggedIn, function(req, res) { 39 | res.render('courses/get_courseid_edit', { title: "Get course ID", courseid: default_courseid}); 40 | }); 41 | 42 | router.get('/edit', isLoggedIn, function(req,res) { 43 | var courseid = req.query.courseid; 44 | Course.getBycourseid(courseid, function(err,doc) { 45 | if(err) 46 | res.send("Some error occured"); 47 | else 48 | { 49 | if(doc) 50 | res.render('courses/edit', {title: 'Edit Course', course: doc}); 51 | else 52 | res.render('courses/get_courseid_edit', { title: "Get course ID", courseid: default_courseid}); 53 | } 54 | }); 55 | }); 56 | 57 | router.post('/update', isLoggedIn, function(req, res) { 58 | var course = { 59 | courseid: req.body.courseid, 60 | coursename: req.body.coursename 61 | }; 62 | var prevcourseid = req.body.prevcourseid; 63 | Course.update(prevcourseid, course, function(err, doc) { 64 | if(err) 65 | res.render('courses/edit', { title: 'Edit Course', course: doc}); 66 | else 67 | res.redirect('../admin/home'); 68 | }); 69 | }); 70 | 71 | router.get('/get_courseid_delete', isLoggedIn, function(req, res) { 72 | var default_courseid = "User Name"; 73 | res.render('courses/get_courseid_delete', { title: "Get course ID", courseid: default_courseid}); 74 | }); 75 | 76 | 77 | router.post('/delete', isLoggedIn, function(req, res) { 78 | var courseid = req.body.courseid; 79 | Course.getBycourseid(courseid, function(err,doc) { 80 | if(err) 81 | res.send("Some error occured"); 82 | else if(doc) 83 | { 84 | Course.remove(courseid, function(err, doc) { 85 | if(err) 86 | res.send("Some error occured"); 87 | else 88 | res.redirect('../admin/home'); 89 | })} 90 | else 91 | res.render('courses/get_courseid_delete', { title: "Get course ID", courseid: default_courseid}); 92 | }) 93 | }); 94 | 95 | module.exports = router; 96 | 97 | function isLoggedIn(req, res, next) { 98 | 99 | // if user is authenticated in the session, carry on 100 | if (req.isAuthenticated()&&req.user.usertype=='admin') 101 | {return next();} 102 | 103 | // if they aren't redirect them to the home page 104 | res.redirect('/'); 105 | } -------------------------------------------------------------------------------- /public/javascripts/question_list.js: -------------------------------------------------------------------------------- 1 | var questionData = []; 2 | 3 | // DOM Ready ============================================================= 4 | $(document).ready(function() { 5 | 6 | var time = { hours: "", minutes: ""}; 7 | var seconds = 0; 8 | 9 | // Populate the question table on intial load 10 | fillQuestions(time); 11 | 12 | //Timer 13 | var timer = setInterval(function() { 14 | 15 | document.getElementById("time").innerHTML = time.hours + " hrs " + time.minutes + " mins " + (seconds) + " secs" ; 16 | 17 | //Trigger submit on completion of time 18 | if(time.hours == 0 && time.minutes == 0 && seconds == 0 ) 19 | { 20 | clearInterval(timer); 21 | document.getElementById("formResponse").submit(); 22 | } 23 | 24 | seconds--; 25 | 26 | if(seconds == -1) 27 | { 28 | seconds = 59; 29 | time.minutes-=1; 30 | 31 | if(time.minutes == -1) 32 | { 33 | time.minutes = 59; 34 | time.hours-=1; 35 | } 36 | } 37 | }, 1000); 38 | 39 | // Question link click 40 | $('#questionList table tbody').on('click', 'td a.linkshowuser', showUserInfo); 41 | 42 | }); 43 | 44 | // Functions ============================================================= 45 | 46 | // Fill Question List 47 | function fillQuestions(time) { 48 | 49 | // Empty content string 50 | var tableContent = ''; 51 | 52 | // jQuery AJAX call for JSON 53 | $.getJSON( '/take_exam/list', {exam_code: exam_code}, function( data ) { 54 | 55 | // Question Content 56 | questionData = data.question_list; 57 | 58 | //Exam time data 59 | time.hours = data.duration_hours; 60 | time.minutes = data.duration_minutes; 61 | 62 | $qno=1; 63 | 64 | // For each item in our JSON, add a question link and answer select box 65 | $.each(data.question_list, function(){ 66 | tableContent += ''; 67 | tableContent += '' + $qno + ''; 68 | 69 | tableContent += ''; 70 | tableContent += ''; 71 | $qno+=1; 72 | }); 73 | 74 | // Inject the whole content string into our existing HTML table 75 | $('#questionList table tbody').html(tableContent); 76 | }); 77 | }; 78 | 79 | // Show Question 80 | function showUserInfo(event) { 81 | 82 | // Prevent Link from Firing 83 | event.preventDefault(); 84 | 85 | // Retrieve question number from link rel attribute 86 | var qno = $(this).attr('rel')-1; 87 | 88 | // Get corresponding Question 89 | var questionObject = questionData[qno]; 90 | 91 | //Populate Question Box 92 | $('#question').text(questionObject.question); 93 | $('#optionA').text(questionObject.optionA); 94 | $('#optionB').text(questionObject.optionB); 95 | $('#optionC').text(questionObject.optionC); 96 | $('#optionD').text(questionObject.optionD); 97 | $('#number').html('Question ' + (qno+1) + ' : '); 98 | }; 99 | -------------------------------------------------------------------------------- /views/exams/new.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang='en') 3 | head 4 | meta(charset='utf-8') 5 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 6 | meta(name='viewport', content='width=device-width, initial-scale=1') 7 | title Create Exam 8 | // CSS 9 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/font.css') 10 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/bootstrap.min.css') 11 | link(rel='stylesheet', href='/stylesheets/assets/font-awesome/css/font-awesome.min.css') 12 | link(rel='stylesheet', href='/stylesheets/assets/css/form-elements.css') 13 | link(rel='stylesheet', href='/stylesheets/assets/css/style.css') 14 | body 15 | // Top content 16 | .top-content 17 | .inner-bg 18 | .container 19 | .row 20 | .col-sm-8.col-sm-offset-2.text 21 | h1 22 | strong Create Exam 23 | .row 24 | .col-sm-3 25 | a.btn.btn-info(href='/faculties/home', role='button') Go Back! 26 | .col-sm-6.form-box 27 | .form-top 28 | .form-top-left 29 | h3 Create Exam 30 | p Fill the form to create an exam: 31 | .form-bottom 32 | form.login-form(role='form', action='create', method='post') 33 | .form-group 34 | label.sr-only(for='form-exam_code') Exam Code 35 | input#form-exam_code.form-exam_code.form-control(type='text', name='exam_code', placeholder=exam.exam_code) 36 | .form-group 37 | label.sr-only(for='form-exam_name') Exam Name 38 | input#form-exam_name.form-exam_name.form-control(type='text', name='exam_name', placeholder=exam.exam_name) 39 | .form-group 40 | p Select No. of Hours 41 | label.sr-only(for='form-duration_hours') Duration Hours 42 | select(name='duration_hours') 43 | option(value='1') 1 44 | option(value='2') 2 45 | option(value='3') 3 46 | .form-group 47 | p Select No. of Minutes 48 | label.sr-only(for='form-duration_minutes') Duration Minutes 49 | 50 | select(name='duration_minutes') 51 | option(value='0') 0 52 | option(value='15') 15 53 | option(value='30') 30 54 | option(value='45') 45 55 | .form-group 56 | label.sr-only(for='form-course_code') Course Code 57 | input#form-course_code.form-course_code.form-control(type='text', name='course_code', placeholder=exam.course_code) 58 | button.btn(type='submit') Create 59 | .col-sm-3 60 | a.btn.btn-info(href='/faculties/logout', role='button') Logout! 61 | // Javascript 62 | script(src='/stylesheets/assets/js/jquery-1.11.1.min.js') 63 | script(src='/stylesheets/assets/bootstrap/js/bootstrap.min.js') 64 | script(src='/stylesheets/assets/js/jquery.backstretch.min.js') 65 | script(src='/stylesheets/assets/js/scripts.js') 66 | //if lt IE 10 67 | script(src='assets/js/placeholder.js') 68 | 69 | 70 | -------------------------------------------------------------------------------- /views/exams/new_question.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang='en') 3 | head 4 | meta(charset='utf-8') 5 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 6 | meta(name='viewport', content='width=device-width, initial-scale=1') 7 | title exam_code 8 | // CSS 9 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/font.css') 10 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/bootstrap.min.css') 11 | link(rel='stylesheet', href='/stylesheets/assets/font-awesome/css/font-awesome.min.css') 12 | link(rel='stylesheet', href='/stylesheets/assets/css/form-elements.css') 13 | link(rel='stylesheet', href='/stylesheets/assets/css/style.css') 14 | body 15 | // Top content 16 | .top-content 17 | .inner-bg 18 | .container 19 | .row 20 | .col-sm-8.col-sm-offset-2.text 21 | h1 22 | strong Add Question 23 | .row 24 | .col-sm-3 25 | a.btn.btn-info(href='/admin/home', role='button') Go Back! 26 | .col-sm-6.form-box 27 | .form-top 28 | .form-top-left 29 | h3 Add new Question 30 | .form-bottom 31 | form.login-form(role='form', action='create_question', method='post') 32 | .form-group 33 | label.sr-only(for='form-question') Question 34 | input#form-question.form-question.form-control(type='text', name='question', placeholder=question_full.question) 35 | .form-group 36 | label.sr-only(for='form-optionA') Option A 37 | input#form-optionA.form-optionA.form-control(type='text', name='optionA', placeholder=question_full.optionA) 38 | .form-group 39 | label.sr-only(for='form-optionB') Option B 40 | input#form-optionB.form-optionB.form-control(type='text', name='optionB', placeholder=question_full.optionB) 41 | .form-group 42 | label.sr-only(for='form-optionC') Option C 43 | input#form-optionC.form-optionC.form-control(type='text', name='optionC', placeholder=question_full.optionC) 44 | .form-group 45 | label.sr-only(for='form-optionD') Option D 46 | input#form-optionD.form-optionD.form-control(type='text', name='optionD', placeholder=question_full.optionD) 47 | .form-group 48 | p Key 49 | label.sr-only(for='form-key') Key 50 | 51 | select(name='key') 52 | option(value='A') A 53 | option(value='B') B 54 | option(value='C') C 55 | option(value='D') D 56 | 57 | .form-group 58 | label.sr-only(for='form-exam_code') Exam Code 59 | input#form-exam_code.form-exam_code.form-control(type='hidden', name='exam_code', value=exam_code) 60 | button.btn(type='submit') Add 61 | .col-sm-3 62 | 63 | // Javascript 64 | script(src='/stylesheets/assets/js/jquery-1.11.1.min.js') 65 | script(src='/stylesheets/assets/bootstrap/js/bootstrap.min.js') 66 | script(src='/stylesheets/assets/js/jquery.backstretch.min.js') 67 | script(src='/stylesheets/assets/js/scripts.js') 68 | //if lt IE 10 69 | script(src='assets/js/placeholder.js') -------------------------------------------------------------------------------- /views/exams/take_exam.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang='en') 3 | script(src='http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js') 4 | script(src='/javascripts/question_list.js') 5 | script(type='text/javascript')| var exam_code =!{JSON.stringify(exam_code)}; 6 | script(src='/javascripts/question_list.js') 7 | head 8 | meta(charset='utf-8') 9 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 10 | meta(name='viewport', content='width=device-width, initial-scale=1') 11 | Take Exam 12 | // CSS 13 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/font.css') 14 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/bootstrap.min.css') 15 | link(rel='stylesheet', href='/stylesheets/assets/font-awesome/css/font-awesome.min.css') 16 | link(rel='stylesheet', href='/stylesheets/assets/css/form-elements.css') 17 | link(rel='stylesheet', href='/stylesheets/assets/css/style.css') 18 | body 19 | // Top content 20 | .top-content 21 | .inner-bg 22 | .container 23 | .row 24 | .col-sm-8.col-sm-offset-2.text 25 | h1 26 | strong Exam Code:"#{exam_code}" 27 |           28 | h1#time 29 | .row 30 | .col-sm-8.form-box 31 | .form-top 32 | .form-top-left 33 | h3 Questions 34 |
35 | .form-bottom 36 | p 37 | 38 | h4#number 39 | span#question 40 | br 41 | strong A: 42 | span#optionA 43 |           44 | 45 | strong B: 46 | span#optionB(align='right') 47 | br 48 | 49 | strong C: 50 | span#optionC 51 |           52 | 53 | strong D: 54 | span#optionD 55 | 56 | .col-sm-4.form-box 57 | .form-top 58 | .form-top-left 59 | h3 Questions 60 |
61 | .form-bottom 62 | form.form-response(role='takeexam', action='submit', method='post', id='formResponse') 63 | #questionList 64 | table 65 | thead 66 | th Question No. 67 | th Choice 68 | tbody 69 | br 70 | br 71 | .form-group 72 | label.sr-only(for='form-exam_code') exam_code 73 | input#form-exam_code.form-exam_code.form-control(type='hidden', name='exam_code', value=exam_code) 74 | br 75 | .form-group 76 | label.sr-only(for='form-username') username 77 | input#form-username.form-username.form-control(type='hidden', name='username', value=username) 78 | button.btn(type='submit') Submit 79 | 80 | 81 | 82 | // Javascript 83 | script(src='/stylesheets/assets/js/jquery-1.11.1.min.js') 84 | script(src='/stylesheets/assets/bootstrap/js/bootstrap.min.js') 85 | script(src='/stylesheets/assets/js/jquery.backstretch.min.js') 86 | script(src='/stylesheets/assets/js/scripts.js') 87 | //if lt IE 10 88 | script(src='assets/js/placeholder.js') 89 | -------------------------------------------------------------------------------- /views/admin/home.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang='en') 3 | head 4 | meta(charset='utf-8') 5 | meta(http-equiv='X-UA-Compatible', content='IE=edge') 6 | meta(name='viewport', content='width=device-width, initial-scale=1') 7 | title Admin Home 8 | // CSS 9 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/font.css') 10 | link(rel='stylesheet', href='/stylesheets/assets/bootstrap/css/bootstrap.min.css') 11 | link(rel='stylesheet', href='/stylesheets/assets/font-awesome/css/font-awesome.min.css') 12 | link(rel='stylesheet', href='/stylesheets/assets/css/form-elements.css') 13 | link(rel='stylesheet', href='/stylesheets/assets/css/style.css') 14 | body 15 | // Top content 16 | .top-content 17 | .inner-bg 18 | .container 19 | .row 20 | .col-sm-8.col-sm-offset-2.text 21 | h1 22 | strong Hello Admin 23 |           24 | a.btn.btn-info(href='/admin/logout', role='button') Logout! 25 | .row 26 | .col-sm-4.form-box 27 | .form-top 28 | .form-top-left 29 | h3 Student 30 |
31 | .form-group 32 | a.btn.btn-info(href='/students/new', role='button') Add Student 33 | .form-group 34 | a.btn.btn-info(href='/students/get_username_edit', role='button') Edit Student 35 | .form-group 36 | a.btn.btn-info(href='/students/get_username_delete', role='button') Delete Student 37 | .form-group 38 | a.btn.btn-info(href='/students/register_form', role='button') Register Student to a Course 39 | .form-group 40 | a.btn.btn-info(href='/students/deregister_form', role='button') Deregister Student from a Course 41 | 42 | .col-sm-4.form-box 43 | .form-top 44 | .form-top-left 45 | h3 Faculty 46 |
47 | .form-group 48 | a.btn.btn-info(href='/faculties/new', role='button') Add Faculty 49 | .form-group 50 | a.btn.btn-info(href='/faculties/get_username_edit', role='button') Edit Faculty 51 | .form-group 52 | a.btn.btn-info(href='/faculties/get_username_delete', role='button') Delete Faculty 53 | .form-group 54 | a.btn.btn-info(href='/faculties/assign_form', role='button') Assign Course to a Faculty 55 | .form-group 56 | a.btn.btn-info(href='/faculties/unassign_form', role='button') Unassign Course from a Faculty 57 | 58 | .col-sm-4.form-box 59 | .form-top 60 | .form-top-left 61 | h3 Course 62 |
63 | .form-group 64 | a.btn.btn-info(href='/courses/new', role='button') Add Course 65 | .form-group 66 | a.btn.btn-info(href='/courses/get_courseid_edit', role='button') Edit Course 67 | .form-group 68 | a.btn.btn-info(href='/courses/get_courseid_delete', role='button') Delete Course 69 | // Javascript 70 | script(src='/stylesheets/assets/js/jquery-1.11.1.min.js') 71 | script(src='/stylesheets/assets/bootstrap/js/bootstrap.min.js') 72 | script(src='/stylesheets/assets/js/jquery.backstretch.min.js') 73 | script(src='/stylesheets/assets/js/scripts.js') 74 | //if lt IE 10 75 | script(src='assets/js/placeholder.js') 76 | -------------------------------------------------------------------------------- /public/stylesheets/assets/js/jquery.backstretch.min.js: -------------------------------------------------------------------------------- 1 | /*! Backstretch - v2.0.4 - 2013-06-19 2 | * http://srobbin.com/jquery-plugins/backstretch/ 3 | * Copyright (c) 2013 Scott Robbin; Licensed MIT */ 4 | (function(a,d,p){a.fn.backstretch=function(c,b){(c===p||0===c.length)&&a.error("No images were supplied for Backstretch");0===a(d).scrollTop()&&d.scrollTo(0,0);return this.each(function(){var d=a(this),g=d.data("backstretch");if(g){if("string"==typeof c&&"function"==typeof g[c]){g[c](b);return}b=a.extend(g.options,b);g.destroy(!0)}g=new q(this,c,b);d.data("backstretch",g)})};a.backstretch=function(c,b){return a("body").backstretch(c,b).data("backstretch")};a.expr[":"].backstretch=function(c){return a(c).data("backstretch")!==p};a.fn.backstretch.defaults={centeredX:!0,centeredY:!0,duration:5E3,fade:0};var r={left:0,top:0,overflow:"hidden",margin:0,padding:0,height:"100%",width:"100%",zIndex:-999999},s={position:"absolute",display:"none",margin:0,padding:0,border:"none",width:"auto",height:"auto",maxHeight:"none",maxWidth:"none",zIndex:-999999},q=function(c,b,e){this.options=a.extend({},a.fn.backstretch.defaults,e||{});this.images=a.isArray(b)?b:[b];a.each(this.images,function(){a("")[0].src=this});this.isBody=c===document.body;this.$container=a(c);this.$root=this.isBody?l?a(d):a(document):this.$container;c=this.$container.children(".backstretch").first();this.$wrap=c.length?c:a('
').css(r).appendTo(this.$container);this.isBody||(c=this.$container.css("position"),b=this.$container.css("zIndex"),this.$container.css({position:"static"===c?"relative":c,zIndex:"auto"===b?0:b,background:"none"}),this.$wrap.css({zIndex:-999998}));this.$wrap.css({position:this.isBody&&l?"fixed":"absolute"});this.index=0;this.show(this.index);a(d).on("resize.backstretch",a.proxy(this.resize,this)).on("orientationchange.backstretch",a.proxy(function(){this.isBody&&0===d.pageYOffset&&(d.scrollTo(0,1),this.resize())},this))};q.prototype={resize:function(){try{var a={left:0,top:0},b=this.isBody?this.$root.width():this.$root.innerWidth(),e=b,g=this.isBody?d.innerHeight?d.innerHeight:this.$root.height():this.$root.innerHeight(),j=e/this.$img.data("ratio"),f;j>=g?(f=(j-g)/2,this.options.centeredY&&(a.top="-"+f+"px")):(j=g,e=j*this.$img.data("ratio"),f=(e-b)/2,this.options.centeredX&&(a.left="-"+f+"px"));this.$wrap.css({width:b,height:g}).find("img:not(.deleteable)").css({width:e,height:j}).css(a)}catch(h){}return this},show:function(c){if(!(Math.abs(c)>this.images.length-1)){var b=this,e=b.$wrap.find("img").addClass("deleteable"),d={relatedTarget:b.$container[0]};b.$container.trigger(a.Event("backstretch.before",d),[b,c]);this.index=c;clearInterval(b.interval);b.$img=a("").css(s).bind("load",function(f){var h=this.width||a(f.target).width();f=this.height||a(f.target).height();a(this).data("ratio",h/f);a(this).fadeIn(b.options.speed||b.options.fade,function(){e.remove();b.paused||b.cycle();a(["after","show"]).each(function(){b.$container.trigger(a.Event("backstretch."+this,d),[b,c])})});b.resize()}).appendTo(b.$wrap);b.$img.attr("src",b.images[c]);return b}},next:function(){return this.show(this.indexe||d.operamini&&"[object OperaMini]"==={}.toString.call(d.operamini)||n&&7458>t||-1e||h&&6>h||"palmGetResource"in d&&e&&534>e||-1=k)})(jQuery,window); -------------------------------------------------------------------------------- /public/stylesheets/assets/css/style.css: -------------------------------------------------------------------------------- 1 | 2 | body { 3 | font-family: 'Roboto', sans-serif; 4 | font-size: 16px; 5 | font-weight: 300; 6 | color: #888; 7 | line-height: 30px; 8 | text-align: center; 9 | } 10 | 11 | strong { font-weight: 500; } 12 | 13 | a, a:hover, a:focus { 14 | color: #de995e; 15 | text-decoration: none; 16 | -o-transition: all .3s; -moz-transition: all .3s; -webkit-transition: all .3s; -ms-transition: all .3s; transition: all .3s; 17 | } 18 | 19 | h1, h2 { 20 | margin-top: 10px; 21 | font-size: 38px; 22 | font-weight: 100; 23 | color: #555; 24 | line-height: 50px; 25 | } 26 | 27 | h4 { 28 | display: inline; 29 | } 30 | 31 | h3 { 32 | font-size: 22px; 33 | font-weight: 300; 34 | color: #555; 35 | line-height: 30px; 36 | } 37 | 38 | img { max-width: 100%; } 39 | 40 | ::-moz-selection { background: #de995e; color: #fff; text-shadow: none; } 41 | ::selection { background: #de995e; color: #fff; text-shadow: none; } 42 | 43 | 44 | .btn-link-1 { 45 | display: inline-block; 46 | height: 50px; 47 | margin: 5px; 48 | padding: 16px 20px 0 20px; 49 | background: #de995e; 50 | font-size: 16px; 51 | font-weight: 300; 52 | line-height: 16px; 53 | color: #fff; 54 | -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; 55 | } 56 | .btn-link-1:hover, .btn-link-1:focus, .btn-link-1:active { outline: 0; opacity: 0.6; color: #fff; } 57 | 58 | .btn-link-1.btn-link-1-facebook { background: #4862a3; } 59 | .btn-link-1.btn-link-1-twitter { background: #55acee; } 60 | .btn-link-1.btn-link-1-google-plus { background: #dd4b39; } 61 | 62 | .btn-link-1 i { 63 | padding-right: 5px; 64 | vertical-align: middle; 65 | font-size: 20px; 66 | line-height: 20px; 67 | } 68 | 69 | .btn-link-2 { 70 | display: inline-block; 71 | height: 50px; 72 | margin: 5px; 73 | padding: 15px 20px 0 20px; 74 | background: rgba(0, 0, 0, 0.3); 75 | border: 1px solid #fff; 76 | font-size: 16px; 77 | font-weight: 300; 78 | line-height: 16px; 79 | color: #fff; 80 | -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; 81 | } 82 | .btn-link-2:hover, .btn-link-2:focus, 83 | .btn-link-2:active, .btn-link-2:active:focus { outline: 0; opacity: 0.6; background: rgba(0, 0, 0, 0.3); color: #fff; } 84 | 85 | 86 | /***** Top content *****/ 87 | 88 | .inner-bg { 89 | padding: 100px 0 170px 0; 90 | } 91 | 92 | .top-content .text { 93 | color: #fff; 94 | } 95 | 96 | .top-content .text h1 { color: #fff; } 97 | 98 | .top-content .description { 99 | margin: 20px 0 10px 0; 100 | } 101 | 102 | .top-content .description p { opacity: 0.8; } 103 | 104 | .top-content .description a { 105 | color: #fff; 106 | } 107 | .top-content .description a:hover, 108 | .top-content .description a:focus { border-bottom: 1px dotted #fff; } 109 | 110 | .form-box { 111 | margin-top: 35px; 112 | } 113 | 114 | .form-top { 115 | overflow: hidden; 116 | padding: 0 25px 15px 25px; 117 | background: #fff; 118 | -moz-border-radius: 4px 4px 0 0; -webkit-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; 119 | text-align: left; 120 | } 121 | 122 | .form-top-left { 123 | float: left; 124 | width: 75%; 125 | padding-top: 25px; 126 | } 127 | 128 | .form-top-left h3 { margin-top: 0; } 129 | 130 | .form-top-right { 131 | float: left; 132 | width: 25%; 133 | padding-top: 5px; 134 | font-size: 66px; 135 | color: #ddd; 136 | line-height: 100px; 137 | text-align: right; 138 | } 139 | 140 | .form-bottom { 141 | padding: 25px 25px 30px 25px; 142 | background: #eee; 143 | -moz-border-radius: 0 0 4px 4px; -webkit-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px; 144 | text-align: left; 145 | } 146 | 147 | .form-bottom form textarea { 148 | height: 100px; 149 | } 150 | 151 | .form-bottom form button.btn { 152 | width: 100%; 153 | } 154 | 155 | .form-bottom form .input-error { 156 | border-color: #ff0000; 157 | } 158 | 159 | .social-login { 160 | margin-top: 35px; 161 | } 162 | 163 | .social-login h3 { 164 | color: #fff; 165 | } 166 | 167 | .social-login-buttons { 168 | margin-top: 25px; 169 | } 170 | 171 | 172 | /***** Media queries *****/ 173 | 174 | @media (min-width: 992px) and (max-width: 1199px) {} 175 | 176 | @media (min-width: 768px) and (max-width: 991px) {} 177 | 178 | @media (max-width: 767px) { 179 | 180 | .inner-bg { padding: 60px 0 110px 0; } 181 | 182 | } 183 | 184 | @media (max-width: 415px) { 185 | 186 | h1, h2 { font-size: 32px; } 187 | 188 | } 189 | 190 | -------------------------------------------------------------------------------- /controllers/make_exam_controller.js: -------------------------------------------------------------------------------- 1 | var express = require('express') 2 | , router = express.Router() 3 | , Exam = require('../models/exam') 4 | , Course = require('../models/student') 5 | , Faculty = require('../models/faculty') 6 | 7 | router.get('/new', isLoggedInAsFaculty, function(req, res) { 8 | var default_exam = { 9 | exam_name: "Exam Name", 10 | exam_code: "Exam Code", 11 | duration_hours:1, 12 | duration_minutes:0, 13 | course_code: "Course Code", 14 | faculty_username:"Faculty User Name" 15 | }; 16 | res.render('exams/new', { title: 'Make New Exam', exam: default_exam}); 17 | }); 18 | 19 | 20 | router.post('/create', isLoggedInAsFaculty, function(req, res) { 21 | var exam = { 22 | exam_name: req.body.exam_name, 23 | exam_code: req.body.exam_code, 24 | duration_hours: req.body.duration_hours, 25 | duration_minutes: req.body.duration_minutes, 26 | course_code: req.body.course_code, 27 | faculty_username: req.user.username 28 | }; 29 | var exam_code = req.body.exam_code; 30 | var course_code = req.body.course_code; 31 | var faculty_username = req.user.username; 32 | Exam.getByExamCode(exam_code, function(err,doc) 33 | { 34 | if(err) 35 | res.send("Some error occured"); 36 | else if(doc) 37 | {res.redirect('/make_exam/new');} 38 | else 39 | { 40 | Faculty.getBycourseid(faculty_username, course_code, function(err, doc) 41 | { 42 | if(err) 43 | res.send("Some error occured"); 44 | else if(doc) 45 | { 46 | Exam.create(exam, function(err, doc) 47 | { 48 | if(err) 49 | res.send("Some error occured"); 50 | else if(doc) 51 | {res.render('exams/question_list', {exam:exam})}; 52 | 53 | }) 54 | } 55 | else 56 | {res.redirect('/make_exam/new');} 57 | }) 58 | } 59 | 60 | }) 61 | }); 62 | 63 | router.get('/question_list', isLoggedInAsFaculty, function(req, res) { 64 | Exam.getByExamCode(req.body.exam_code, function(err,docs){ 65 | if(err) 66 | res.send("some error occured"); 67 | else 68 | res.render('exams/question_list', {exam: docs}); 69 | }); 70 | }); 71 | 72 | router.get('/add_question', isLoggedInAsFaculty, function(req,res) { 73 | var exam_code = req.body.exam_code; 74 | var default_question_full = { 75 | question: "Question", 76 | optionA: "option A", 77 | optionB: "option B", 78 | optionC: "option C", 79 | optionD: "option D", 80 | key: "Key" 81 | }; 82 | res.render('exams/new_question', { title: 'Add New Question', question_full: default_question_full, 83 | exam_code: exam_code}); 84 | }); 85 | 86 | router.post('/add_question', isLoggedInAsFaculty, function(req,res) { 87 | var exam_code = req.body.exam_code; 88 | var default_question_full = { 89 | question: "Question", 90 | optionA: "option A", 91 | optionB: "option B", 92 | optionC: "option C", 93 | optionD: "option D", 94 | key: "Key" 95 | }; 96 | res.render('exams/new_question', { title: 'Add New Question', question_full: default_question_full, 97 | exam_code: exam_code}); 98 | }); 99 | 100 | 101 | 102 | 103 | router.post('/create_question', isLoggedInAsFaculty, function(req, res) { 104 | 105 | var question_full = { 106 | question: req.body.question, 107 | optionA: req.body.optionA, 108 | optionB: req.body.optionB, 109 | optionC: req.body.optionC, 110 | optionD: req.body.optionD, 111 | key: req.body.key 112 | }; 113 | 114 | var exam_code = req.body.exam_code; 115 | 116 | Exam.addQuestion(exam_code, question_full, function(err,docs){ 117 | if(err) 118 | res.send("some error occured"); 119 | else 120 | { 121 | Exam.getByExamCode(exam_code, function(err,docs){ 122 | if(err) 123 | res.send("some error occured"); 124 | else 125 | res.render('exams/question_list', {exam: docs}); 126 | }); } 127 | }); 128 | }); 129 | 130 | 131 | router.get('/submit', isLoggedInAsFaculty, function(req, res) { 132 | res.send("exam successfully created"); 133 | }); 134 | 135 | router.get('/list', isLoggedInAsFaculty, function(req, res) { 136 | Exam.getByExamCode(req.query.exam_code, function(err,docs){ 137 | if(err) 138 | res.send("some error occured"); 139 | else 140 | res.json(docs); 141 | }); 142 | }); 143 | 144 | 145 | 146 | module.exports = router; 147 | 148 | function isLoggedInAsFaculty(req, res, next) { 149 | 150 | // if user is authenticated in the session, carry on 151 | if (req.isAuthenticated()&&req.user.usertype=='faculty') 152 | {return next();} 153 | 154 | // if they aren't redirect them to the home page 155 | res.redirect('/'); 156 | } 157 | -------------------------------------------------------------------------------- /controllers/take_exam_controller.js: -------------------------------------------------------------------------------- 1 | var express = require('express') 2 | , router = express.Router() 3 | , Exam = require('../models/exam') 4 | , Student = require('../models/student') 5 | 6 | router.get('/', isLoggedInAsStudent, function(req, res) { 7 | 8 | res.render('exams/take_exam_code_entry', {title: "Enter Exam Code", username: req.user.username}); 9 | 10 | }); 11 | 12 | router.post('/exam', isLoggedInAsStudent, function(req, res) { 13 | var exam_code = req.body.exam_code; 14 | var username = req.body.username; 15 | console.log(exam_code); 16 | console.log(username); 17 | Exam.getByExamCode(exam_code, function(err,doc1) 18 | { 19 | if(err) 20 | res.send("Some error occured"); 21 | else if(doc1) 22 | { 23 | Student.getBycourseid(username, doc1.course_code, function(err,doc) 24 | { 25 | if(err) 26 | res.send("Some error occured"); 27 | else if(doc) 28 | { 29 | Exam.checkResponse(username, exam_code, function(err, doc) 30 | { 31 | if(err) 32 | res.send("Some error occured"); 33 | else if(doc) 34 | res.redirect('/take_exam'); 35 | else 36 | { 37 | res.render('exams/take_exam', { title: 'Take Exam', exam_code: exam_code, username: username}); 38 | } 39 | }) 40 | } 41 | else 42 | res.redirect('/take_exam'); 43 | 44 | }) 45 | } 46 | else 47 | res.redirect('/take_exam'); 48 | 49 | 50 | }) 51 | }); 52 | 53 | router.get('/list', isLoggedInAsStudent, function(req, res) { 54 | 55 | Exam.getByExamCode(req.query.exam_code, function(err,docs){ 56 | if(err) 57 | res.send("some error occured"); 58 | else 59 | res.json(docs); 60 | }); 61 | }); 62 | 63 | 64 | router.post('/submit', isLoggedInAsStudent, function(req, res) { 65 | 66 | var username=req.body.username; 67 | var exam_code=req.body.exam_code; 68 | 69 | var object=req.body 70 | var response = []; 71 | 72 | for(var key in object) { 73 | response.push(object[key]); 74 | } 75 | response.pop(); 76 | response.pop(); 77 | 78 | Exam.addResponses(username, exam_code, response, function(err,docs){ 79 | if(err) 80 | res.send("some error occured"); 81 | else 82 | res.render('exams/exam_submit', { title: 'Response Submitted Successfully', response: response, username: username, exam_code: exam_code}); 83 | }); 84 | 85 | }); 86 | 87 | router.get('/performance', isLoggedInAsStudent, function(req, res) { 88 | 89 | res.render('exams/view_performance_code_entry', {title: "Enter Exam Code", username: req.user.username}); 90 | 91 | }); 92 | 93 | router.post('/performance_view', isLoggedInAsStudent, function(req, res) { 94 | 95 | var username=req.body.username; 96 | var exam_code=req.body.exam_code; 97 | 98 | Exam.checkResponse(username, exam_code, function(err, doc) 99 | { 100 | if(err) 101 | res.send("Some error occured"); 102 | else if(doc) 103 | { 104 | 105 | 106 | Exam.getByExamCode(exam_code, function(err,docs){ 107 | if(err) 108 | res.send("some error occured"); 109 | else 110 | { 111 | var exam_obj = docs.question_list; 112 | 113 | Exam.getResponseByExamCode(exam_code, username, function(err, docs){ 114 | if(err) 115 | res.send("some error occured"); 116 | else 117 | { 118 | var response_obj = docs.response; 119 | var total_questions = 0; 120 | var attempted = 0; 121 | var correct = 0; 122 | 123 | for(var temp in exam_obj) { 124 | 125 | if(response_obj[total_questions] != ' ') 126 | attempted++; 127 | if(exam_obj[total_questions].key == response_obj[total_questions]) 128 | correct++; 129 | total_questions++; 130 | } 131 | 132 | res.render('exams/performance',{title: 'Result', total_questions: total_questions, attempted: attempted, correct: correct}); 133 | } 134 | }); 135 | } 136 | })} 137 | else 138 | { 139 | res.render('exams/view_performance_code_entry', {title: "Enter Exam Code", username: req.user.username}); 140 | } 141 | }) 142 | }); 143 | 144 | module.exports = router; 145 | 146 | 147 | function isLoggedInAsStudent(req, res, next) { 148 | 149 | // if user is authenticated in the session, carry on 150 | if (req.isAuthenticated()&&req.user.usertype=='student') 151 | return next(); 152 | 153 | // if they aren't redirect them to the home page 154 | res.redirect('/'); 155 | } -------------------------------------------------------------------------------- /controllers/faculties.js: -------------------------------------------------------------------------------- 1 | var express = require('express') 2 | , router = express.Router() 3 | , Faculty = require('../models/faculty') 4 | , Course = require('../models/course'); 5 | 6 | var default_faculty = { 7 | username: "Your LDAP ID", 8 | password: "Password", 9 | name: "Name" 10 | }; 11 | 12 | var default_username = "User Name"; 13 | 14 | var default_courseid = "Course Code"; 15 | 16 | 17 | 18 | router.get('/home', isLoggedInAsFaculty, function(req, res) { 19 | res.render('faculties/home', { title: 'Faculty Home Page', faculty: default_faculty}); 20 | }); 21 | 22 | router.get('/logout', function(req, res) { 23 | req.logout(); 24 | res.redirect('/'); 25 | }); 26 | 27 | router.get('/new',isLoggedIn, function(req, res) { 28 | res.render('faculties/new', { title: 'Add New faculty', faculty: default_faculty}); 29 | }); 30 | 31 | 32 | router.post('/create',isLoggedIn, function(req, res) { 33 | var faculty = { 34 | username: req.body.username, 35 | password: req.body.password, 36 | name: req.body.name 37 | }; 38 | var username = req.body.username; 39 | 40 | Faculty.getByUserName(username, function(err,doc) { 41 | if(err) 42 | res.send("Some error occured"); 43 | else if(doc) 44 | res.redirect('/faculties/new'); 45 | else{ 46 | Faculty.create(faculty, function(err, doc) { 47 | if(err) 48 | res.send("Some error occured"); 49 | else 50 | res.redirect('/admin/home'); 51 | }) } 52 | }) 53 | }); 54 | 55 | router.get('/get_username_edit',isLoggedIn, function(req, res) { 56 | res.render('faculties/get_username_edit', { title: "Get Username", username: default_username}); 57 | }); 58 | 59 | router.get('/edit',isLoggedIn, function(req,res) { 60 | //Failure renders edit if update is incorrect 61 | var username = req.query.username; 62 | Faculty.getByUserName(username, function(err,doc) { 63 | if(err) 64 | res.send("Some error occured"); 65 | else 66 | { 67 | if(doc) 68 | res.render('faculties/edit', {title: 'Edit faculty', faculty: doc}); 69 | else 70 | res.redirect('/faculties/get_username_edit'); 71 | } 72 | }); 73 | }); 74 | 75 | router.post('/update',isLoggedIn, function(req,res) { 76 | var faculty = { 77 | username: req.body.username, 78 | password: req.body.password, 79 | name: req.body.name 80 | }; 81 | var prevusername = req.body.prevusername; 82 | Faculty.update(prevusername, faculty, function(err, doc) { 83 | if(err) 84 | res.render('faculties/edit', { title: 'Edit faculties', faculty: faculty}); 85 | else 86 | res.redirect('../admin/home'); 87 | }); 88 | }); 89 | 90 | router.get('/get_username_delete',isLoggedIn, function(req, res) { 91 | res.render('faculties/get_username_delete', { title: "Get Username", username: default_username}); 92 | }); 93 | 94 | router.post('/delete',isLoggedIn, function(req, res) { 95 | var username = req.body.username; 96 | 97 | Faculty.getByUserName(username, function(err,doc) { 98 | if(err) 99 | res.send("Some error occured"); 100 | else if(doc) 101 | { 102 | Faculty.remove(username, function(err, doc) { 103 | if(err) 104 | res.send("Some error occured"); 105 | else 106 | res.redirect('../admin/home'); 107 | })} 108 | else 109 | res.redirect('../faculties/get_username_delete'); 110 | }) 111 | }); 112 | 113 | router.get('/assign_form',isLoggedIn, function(req, res) { 114 | res.render('faculties/assign', { title: "Assign", username: default_username, 115 | courseid: default_courseid}); 116 | }); 117 | 118 | router.post('/assign',isLoggedIn, function(req, res) { 119 | var username = req.body.username; 120 | var course_code = req.body.courseid; 121 | 122 | Faculty.getByUserName(username, function(err,doc) 123 | { 124 | if(err) 125 | res.send("Some error occured"); 126 | else if(doc) 127 | { 128 | Course.getBycourseid(course_code, function(err,doc) 129 | { 130 | if(err) 131 | res.send("Some error occured"); 132 | else if(doc) 133 | { 134 | Faculty.getBycourseid(username, course_code, function(err, doc) 135 | { 136 | if(err) 137 | res.send("Some error occured"); 138 | else if(doc) 139 | {res.redirect('/faculties/assign_form');} 140 | else 141 | { 142 | Faculty.assign(username, course_code, function(err, doc) 143 | { 144 | if(err) 145 | res.send("Some error occured"); 146 | else if(doc) 147 | res.redirect('/admin/home'); 148 | 149 | }) 150 | } 151 | }) 152 | } 153 | else 154 | res.redirect('/faculties/assign_form'); 155 | 156 | }) 157 | } 158 | else 159 | res.redirect('/faculties/assign_form'); 160 | 161 | }) 162 | }); 163 | 164 | 165 | router.get('/unassign_form',isLoggedIn, function(req, res) { 166 | res.render('faculties/unassign', { title: "unassign", username: default_username, 167 | courseid: default_courseid}); 168 | }); 169 | 170 | router.post('/unassign',isLoggedIn, function(req, res) { 171 | var username = req.body.username; 172 | var course_code = req.body.courseid; 173 | 174 | Faculty.getByUserName(username, function(err,doc) 175 | { 176 | if(err) 177 | res.send("Some error occured"); 178 | else if(doc) 179 | { 180 | Course.getBycourseid(course_code, function(err,doc) 181 | { 182 | if(err) 183 | res.send("Some error occured"); 184 | else if(doc) 185 | { 186 | Faculty.getBycourseid(username, course_code, function(err, doc) 187 | { 188 | if(err) 189 | res.send("Some error occured"); 190 | else if(doc) 191 | { 192 | Faculty.unassign(username, course_code, function(err, doc) 193 | { 194 | if(err) 195 | res.send("Some error occured"); 196 | else if(doc) 197 | res.redirect('/admin/home'); 198 | }) 199 | } 200 | else 201 | { 202 | res.redirect('/faculties/unassign_form'); 203 | } 204 | 205 | }) 206 | } 207 | else 208 | res.redirect('/faculties/unassign_form'); 209 | }) 210 | } 211 | else 212 | res.redirect('/faculties/unassign_form'); 213 | }) 214 | }); 215 | 216 | module.exports = router; 217 | 218 | 219 | function isLoggedIn(req, res, next) { 220 | 221 | // if user is authenticated in the session, carry on 222 | if (req.isAuthenticated()&&req.user.usertype=='admin') 223 | {return next();} 224 | 225 | // if they aren't redirect them to the home page 226 | res.redirect('/'); 227 | } 228 | 229 | function isLoggedInAsFaculty(req, res, next) { 230 | 231 | // if user is authenticated in the session, carry on 232 | if (req.isAuthenticated()&&req.user.usertype=='faculty') 233 | {return next();} 234 | 235 | // if they aren't redirect them to the home page 236 | res.redirect('/'); 237 | } -------------------------------------------------------------------------------- /controllers/students.js: -------------------------------------------------------------------------------- 1 | var express = require('express') 2 | , router = express.Router() 3 | , Student = require('../models/student') 4 | , Course = require('../models/course'); 5 | 6 | var default_username = "User Name"; 7 | 8 | var default_student = { 9 | username: "Your LDAP ID", 10 | password: "Password", 11 | name: "Name", 12 | rollno: "Roll Number" 13 | }; 14 | 15 | var default_username = "User Name"; 16 | 17 | var default_courseid = "Course Code"; 18 | 19 | 20 | router.get('/home', isLoggedInAsStudent, function(req, res) { 21 | res.render('students/home', { title: 'Student Home Page', student: default_student}); 22 | }); 23 | 24 | router.get('/logout', function(req, res) { 25 | req.logout(); 26 | res.redirect('/'); 27 | }); 28 | 29 | router.get('/new', isLoggedIn, function(req, res) { 30 | res.render('students/new', { title: 'Add New Student', student: default_student}); 31 | }); 32 | 33 | 34 | router.post('/create', isLoggedIn, function(req, res) { 35 | // TO DO: Ensure that the student and course exists 36 | // TO DO: Add failure cases 37 | var student = { 38 | username: req.body.username, 39 | password: req.body.password, 40 | name: req.body.name, 41 | rollno: req.body.rollno 42 | }; 43 | var username = req.body.username; 44 | 45 | Student.getByUserName(username, function(err,doc) { 46 | if(err) 47 | res.send("Some error occured"); 48 | else if(doc) 49 | res.redirect('/students/new'); 50 | else{ 51 | Student.create(student, function(err, doc) { 52 | if(err) 53 | res.send("Some error occured"); 54 | else 55 | res.redirect('/admin/home'); 56 | }) } 57 | }) 58 | }); 59 | 60 | router.get('/get_username_edit', isLoggedIn, function(req, res) { 61 | res.render('students/get_username_edit', { title: "Get Username", username: default_username}); 62 | }); 63 | 64 | 65 | router.get('/edit', isLoggedIn, function(req,res) { 66 | //Failure renders edit if update is incorrect 67 | var username = req.query.username; 68 | Student.getByUserName(username, function(err,doc) { 69 | if(err) 70 | res.send("Some error occured"); 71 | else 72 | { 73 | if(doc) 74 | res.render('students/edit', {title: 'Edit Student', student: doc}); 75 | else 76 | res.redirect('/students/get_username_edit'); 77 | } 78 | }); 79 | }); 80 | 81 | router.post('/update', isLoggedIn, function(req, res) { 82 | // TO DO: Ensure that the student and course exists 83 | // TO DO: Add failure cases 84 | var student = { 85 | username: req.body.username, 86 | password: req.body.password, 87 | name: req.body.name, 88 | rollno: req.body.rollno 89 | }; 90 | var prevusername = req.body.prevusername; 91 | 92 | Student.update(prevusername, student, function(err, doc) { 93 | if(err) 94 | res.render('students/edit', { title: 'Edit Student', student: student}); 95 | else 96 | res.redirect('../admin/home'); 97 | }); 98 | }); 99 | 100 | router.get('/get_username_delete', isLoggedIn, function(req, res) { 101 | var default_username = "User Name"; 102 | res.render('students/get_username_delete', { title: "Get Username", username: default_username}); 103 | }); 104 | 105 | router.post('/delete', isLoggedIn, function(req, res) { 106 | // TO DO: Ensure that the student and course exists 107 | // TO DO: Add failure cases 108 | var username = req.body.username; 109 | 110 | Student.getByUserName(username, function(err,doc) { 111 | if(err) 112 | res.send("Some error occured"); 113 | else if(doc) 114 | { 115 | Student.remove(username, function(err, doc) { 116 | if(err) 117 | res.send("Some error occured"); 118 | else 119 | res.redirect('../admin/home'); 120 | })} 121 | else 122 | res.redirect('../students/get_username_delete'); 123 | }) 124 | }); 125 | 126 | router.get('/register_form', isLoggedIn, function(req, res) { 127 | res.render('students/register', { title: "Register", username: default_username, 128 | courseid: default_courseid}); 129 | }); 130 | 131 | router.post('/register', isLoggedIn, function(req, res) { 132 | var username = req.body.username; 133 | var course_code = req.body.courseid; 134 | 135 | Student.getByUserName(username, function(err,doc) 136 | { 137 | if(err) 138 | res.send("Some error occured"); 139 | else if(doc) 140 | { 141 | Course.getBycourseid(course_code, function(err,doc) 142 | { 143 | if(err) 144 | res.send("Some error occured"); 145 | else if(doc) 146 | { 147 | Student.getBycourseid(username, course_code, function(err, doc) 148 | { 149 | if(err) 150 | res.send("Some error occured"); 151 | else if(doc) 152 | {res.redirect('/students/register_form');} 153 | else 154 | { 155 | Student.register(username, course_code, function(err, doc) 156 | { 157 | if(err) 158 | res.send("Some error occured"); 159 | else if(doc) 160 | res.redirect('/admin/home'); 161 | 162 | }) 163 | } 164 | }) 165 | } 166 | else 167 | res.redirect('/students/register_form'); 168 | 169 | }) 170 | } 171 | else 172 | res.redirect('/students/register_form'); 173 | 174 | }) 175 | }); 176 | 177 | router.get('/deregister_form', isLoggedIn, function(req, res) { 178 | res.render('students/deregister', { title: "Deregister", username: default_username, 179 | courseid: default_courseid}); 180 | }); 181 | 182 | router.post('/deregister', isLoggedIn, function(req, res) { 183 | // TO DO: Ensure that the student and course exists 184 | // TO DO: Add failure cases 185 | var username = req.body.username; 186 | var course_code = req.body.courseid; 187 | 188 | Student.getByUserName(username, function(err,doc) 189 | { 190 | if(err) 191 | res.send("Some error occured"); 192 | else if(doc) 193 | { 194 | Course.getBycourseid(course_code, function(err,doc) 195 | { 196 | if(err) 197 | res.send("Some error occured"); 198 | else if(doc) 199 | { 200 | Student.getBycourseid(username, course_code, function(err, doc) 201 | { 202 | if(err) 203 | res.send("Some error occured"); 204 | else if(doc) 205 | { 206 | Student.deregister(username, course_code, function(err, doc) 207 | { 208 | if(err) 209 | res.send("Some error occured"); 210 | else if(doc) 211 | res.redirect('/admin/home'); 212 | }) 213 | } 214 | else 215 | { 216 | res.redirect('/students/register_form'); 217 | } 218 | 219 | }) 220 | } 221 | else 222 | res.redirect('/students/register_form'); 223 | }) 224 | } 225 | else 226 | res.redirect('/students/register_form'); 227 | }) 228 | }); 229 | 230 | module.exports = router; 231 | 232 | 233 | function isLoggedIn(req, res, next) { 234 | 235 | // if user is authenticated in the session, carry on 236 | if (req.isAuthenticated()&&req.user.usertype=='admin') 237 | return next(); 238 | 239 | // if they aren't redirect them to the home page 240 | res.redirect('/'); 241 | } 242 | 243 | function isLoggedInAsStudent(req, res, next) { 244 | 245 | // if user is authenticated in the session, carry on 246 | if (req.isAuthenticated()&&req.user.usertype=='student') 247 | return next(); 248 | 249 | // if they aren't redirect them to the home page 250 | res.redirect('/'); 251 | } -------------------------------------------------------------------------------- /public/stylesheets/assets/bootstrap/css/font.css: -------------------------------------------------------------------------------- 1 | /* cyrillic-ext */ 2 | @font-face { 3 | font-family: 'Roboto'; 4 | font-style: normal; 5 | font-weight: 100; 6 | src: local('Roboto Thin'), local('Roboto-Thin'), url(http://fonts.gstatic.com/s/roboto/v15/ty9dfvLAziwdqQ2dHoyjphTbgVql8nDJpwnrE27mub0.woff2) format('woff2'); 7 | unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; 8 | } 9 | /* cyrillic */ 10 | @font-face { 11 | font-family: 'Roboto'; 12 | font-style: normal; 13 | font-weight: 100; 14 | src: local('Roboto Thin'), local('Roboto-Thin'), url(http://fonts.gstatic.com/s/roboto/v15/frNV30OaYdlFRtH2VnZZdhTbgVql8nDJpwnrE27mub0.woff2) format('woff2'); 15 | unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; 16 | } 17 | /* greek-ext */ 18 | @font-face { 19 | font-family: 'Roboto'; 20 | font-style: normal; 21 | font-weight: 100; 22 | src: local('Roboto Thin'), local('Roboto-Thin'), url(http://fonts.gstatic.com/s/roboto/v15/gwVJDERN2Amz39wrSoZ7FxTbgVql8nDJpwnrE27mub0.woff2) format('woff2'); 23 | unicode-range: U+1F00-1FFF; 24 | } 25 | /* greek */ 26 | @font-face { 27 | font-family: 'Roboto'; 28 | font-style: normal; 29 | font-weight: 100; 30 | src: local('Roboto Thin'), local('Roboto-Thin'), url(http://fonts.gstatic.com/s/roboto/v15/aZMswpodYeVhtRvuABJWvBTbgVql8nDJpwnrE27mub0.woff2) format('woff2'); 31 | unicode-range: U+0370-03FF; 32 | } 33 | /* vietnamese */ 34 | @font-face { 35 | font-family: 'Roboto'; 36 | font-style: normal; 37 | font-weight: 100; 38 | src: local('Roboto Thin'), local('Roboto-Thin'), url(http://fonts.gstatic.com/s/roboto/v15/VvXUGKZXbHtX_S_VCTLpGhTbgVql8nDJpwnrE27mub0.woff2) format('woff2'); 39 | unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB; 40 | } 41 | /* latin-ext */ 42 | @font-face { 43 | font-family: 'Roboto'; 44 | font-style: normal; 45 | font-weight: 100; 46 | src: local('Roboto Thin'), local('Roboto-Thin'), url(http://fonts.gstatic.com/s/roboto/v15/e7MeVAyvogMqFwwl61PKhBTbgVql8nDJpwnrE27mub0.woff2) format('woff2'); 47 | unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; 48 | } 49 | /* latin */ 50 | @font-face { 51 | font-family: 'Roboto'; 52 | font-style: normal; 53 | font-weight: 100; 54 | src: local('Roboto Thin'), local('Roboto-Thin'), url(http://fonts.gstatic.com/s/roboto/v15/2tsd397wLxj96qwHyNIkxPesZW2xOQ-xsNqO47m55DA.woff2) format('woff2'); 55 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; 56 | } 57 | /* cyrillic-ext */ 58 | @font-face { 59 | font-family: 'Roboto'; 60 | font-style: normal; 61 | font-weight: 300; 62 | src: local('Roboto Light'), local('Roboto-Light'), url(http://fonts.gstatic.com/s/roboto/v15/0eC6fl06luXEYWpBSJvXCBJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); 63 | unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; 64 | } 65 | /* cyrillic */ 66 | @font-face { 67 | font-family: 'Roboto'; 68 | font-style: normal; 69 | font-weight: 300; 70 | src: local('Roboto Light'), local('Roboto-Light'), url(http://fonts.gstatic.com/s/roboto/v15/Fl4y0QdOxyyTHEGMXX8kcRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); 71 | unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; 72 | } 73 | /* greek-ext */ 74 | @font-face { 75 | font-family: 'Roboto'; 76 | font-style: normal; 77 | font-weight: 300; 78 | src: local('Roboto Light'), local('Roboto-Light'), url(http://fonts.gstatic.com/s/roboto/v15/-L14Jk06m6pUHB-5mXQQnRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); 79 | unicode-range: U+1F00-1FFF; 80 | } 81 | /* greek */ 82 | @font-face { 83 | font-family: 'Roboto'; 84 | font-style: normal; 85 | font-weight: 300; 86 | src: local('Roboto Light'), local('Roboto-Light'), url(http://fonts.gstatic.com/s/roboto/v15/I3S1wsgSg9YCurV6PUkTORJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); 87 | unicode-range: U+0370-03FF; 88 | } 89 | /* vietnamese */ 90 | @font-face { 91 | font-family: 'Roboto'; 92 | font-style: normal; 93 | font-weight: 300; 94 | src: local('Roboto Light'), local('Roboto-Light'), url(http://fonts.gstatic.com/s/roboto/v15/NYDWBdD4gIq26G5XYbHsFBJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); 95 | unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB; 96 | } 97 | /* latin-ext */ 98 | @font-face { 99 | font-family: 'Roboto'; 100 | font-style: normal; 101 | font-weight: 300; 102 | src: local('Roboto Light'), local('Roboto-Light'), url(http://fonts.gstatic.com/s/roboto/v15/Pru33qjShpZSmG3z6VYwnRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); 103 | unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; 104 | } 105 | /* latin */ 106 | @font-face { 107 | font-family: 'Roboto'; 108 | font-style: normal; 109 | font-weight: 300; 110 | src: local('Roboto Light'), local('Roboto-Light'), url(http://fonts.gstatic.com/s/roboto/v15/Hgo13k-tfSpn0qi1SFdUfVtXRa8TVwTICgirnJhmVJw.woff2) format('woff2'); 111 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; 112 | } 113 | /* cyrillic-ext */ 114 | @font-face { 115 | font-family: 'Roboto'; 116 | font-style: normal; 117 | font-weight: 400; 118 | src: local('Roboto'), local('Roboto-Regular'), url(http://fonts.gstatic.com/s/roboto/v15/ek4gzZ-GeXAPcSbHtCeQI_esZW2xOQ-xsNqO47m55DA.woff2) format('woff2'); 119 | unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; 120 | } 121 | /* cyrillic */ 122 | @font-face { 123 | font-family: 'Roboto'; 124 | font-style: normal; 125 | font-weight: 400; 126 | src: local('Roboto'), local('Roboto-Regular'), url(http://fonts.gstatic.com/s/roboto/v15/mErvLBYg_cXG3rLvUsKT_fesZW2xOQ-xsNqO47m55DA.woff2) format('woff2'); 127 | unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; 128 | } 129 | /* greek-ext */ 130 | @font-face { 131 | font-family: 'Roboto'; 132 | font-style: normal; 133 | font-weight: 400; 134 | src: local('Roboto'), local('Roboto-Regular'), url(http://fonts.gstatic.com/s/roboto/v15/-2n2p-_Y08sg57CNWQfKNvesZW2xOQ-xsNqO47m55DA.woff2) format('woff2'); 135 | unicode-range: U+1F00-1FFF; 136 | } 137 | /* greek */ 138 | @font-face { 139 | font-family: 'Roboto'; 140 | font-style: normal; 141 | font-weight: 400; 142 | src: local('Roboto'), local('Roboto-Regular'), url(http://fonts.gstatic.com/s/roboto/v15/u0TOpm082MNkS5K0Q4rhqvesZW2xOQ-xsNqO47m55DA.woff2) format('woff2'); 143 | unicode-range: U+0370-03FF; 144 | } 145 | /* vietnamese */ 146 | @font-face { 147 | font-family: 'Roboto'; 148 | font-style: normal; 149 | font-weight: 400; 150 | src: local('Roboto'), local('Roboto-Regular'), url(http://fonts.gstatic.com/s/roboto/v15/NdF9MtnOpLzo-noMoG0miPesZW2xOQ-xsNqO47m55DA.woff2) format('woff2'); 151 | unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB; 152 | } 153 | /* latin-ext */ 154 | @font-face { 155 | font-family: 'Roboto'; 156 | font-style: normal; 157 | font-weight: 400; 158 | src: local('Roboto'), local('Roboto-Regular'), url(http://fonts.gstatic.com/s/roboto/v15/Fcx7Wwv8OzT71A3E1XOAjvesZW2xOQ-xsNqO47m55DA.woff2) format('woff2'); 159 | unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; 160 | } 161 | /* latin */ 162 | @font-face { 163 | font-family: 'Roboto'; 164 | font-style: normal; 165 | font-weight: 400; 166 | src: local('Roboto'), local('Roboto-Regular'), url(http://fonts.gstatic.com/s/roboto/v15/CWB0XYA8bzo0kSThX0UTuA.woff2) format('woff2'); 167 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; 168 | } 169 | /* cyrillic-ext */ 170 | @font-face { 171 | font-family: 'Roboto'; 172 | font-style: normal; 173 | font-weight: 500; 174 | src: local('Roboto Medium'), local('Roboto-Medium'), url(http://fonts.gstatic.com/s/roboto/v15/ZLqKeelYbATG60EpZBSDyxJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); 175 | unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; 176 | } 177 | /* cyrillic */ 178 | @font-face { 179 | font-family: 'Roboto'; 180 | font-style: normal; 181 | font-weight: 500; 182 | src: local('Roboto Medium'), local('Roboto-Medium'), url(http://fonts.gstatic.com/s/roboto/v15/oHi30kwQWvpCWqAhzHcCSBJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); 183 | unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; 184 | } 185 | /* greek-ext */ 186 | @font-face { 187 | font-family: 'Roboto'; 188 | font-style: normal; 189 | font-weight: 500; 190 | src: local('Roboto Medium'), local('Roboto-Medium'), url(http://fonts.gstatic.com/s/roboto/v15/rGvHdJnr2l75qb0YND9NyBJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); 191 | unicode-range: U+1F00-1FFF; 192 | } 193 | /* greek */ 194 | @font-face { 195 | font-family: 'Roboto'; 196 | font-style: normal; 197 | font-weight: 500; 198 | src: local('Roboto Medium'), local('Roboto-Medium'), url(http://fonts.gstatic.com/s/roboto/v15/mx9Uck6uB63VIKFYnEMXrRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); 199 | unicode-range: U+0370-03FF; 200 | } 201 | /* vietnamese */ 202 | @font-face { 203 | font-family: 'Roboto'; 204 | font-style: normal; 205 | font-weight: 500; 206 | src: local('Roboto Medium'), local('Roboto-Medium'), url(http://fonts.gstatic.com/s/roboto/v15/mbmhprMH69Zi6eEPBYVFhRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); 207 | unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB; 208 | } 209 | /* latin-ext */ 210 | @font-face { 211 | font-family: 'Roboto'; 212 | font-style: normal; 213 | font-weight: 500; 214 | src: local('Roboto Medium'), local('Roboto-Medium'), url(http://fonts.gstatic.com/s/roboto/v15/oOeFwZNlrTefzLYmlVV1UBJtnKITppOI_IvcXXDNrsc.woff2) format('woff2'); 215 | unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; 216 | } 217 | /* latin */ 218 | @font-face { 219 | font-family: 'Roboto'; 220 | font-style: normal; 221 | font-weight: 500; 222 | src: local('Roboto Medium'), local('Roboto-Medium'), url(http://fonts.gstatic.com/s/roboto/v15/RxZJdnzeo3R5zSexge8UUVtXRa8TVwTICgirnJhmVJw.woff2) format('woff2'); 223 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; 224 | } 225 | -------------------------------------------------------------------------------- /public/stylesheets/assets/js/jquery.backstretch.js: -------------------------------------------------------------------------------- 1 | /*! Backstretch - v2.0.4 - 2013-06-19 2 | * http://srobbin.com/jquery-plugins/backstretch/ 3 | * Copyright (c) 2013 Scott Robbin; Licensed MIT */ 4 | 5 | ;(function ($, window, undefined) { 6 | 'use strict'; 7 | 8 | /* PLUGIN DEFINITION 9 | * ========================= */ 10 | 11 | $.fn.backstretch = function (images, options) { 12 | // We need at least one image or method name 13 | if (images === undefined || images.length === 0) { 14 | $.error("No images were supplied for Backstretch"); 15 | } 16 | 17 | /* 18 | * Scroll the page one pixel to get the right window height on iOS 19 | * Pretty harmless for everyone else 20 | */ 21 | if ($(window).scrollTop() === 0 ) { 22 | window.scrollTo(0, 0); 23 | } 24 | 25 | return this.each(function () { 26 | var $this = $(this) 27 | , obj = $this.data('backstretch'); 28 | 29 | // Do we already have an instance attached to this element? 30 | if (obj) { 31 | 32 | // Is this a method they're trying to execute? 33 | if (typeof images == 'string' && typeof obj[images] == 'function') { 34 | // Call the method 35 | obj[images](options); 36 | 37 | // No need to do anything further 38 | return; 39 | } 40 | 41 | // Merge the old options with the new 42 | options = $.extend(obj.options, options); 43 | 44 | // Remove the old instance 45 | obj.destroy(true); 46 | } 47 | 48 | obj = new Backstretch(this, images, options); 49 | $this.data('backstretch', obj); 50 | }); 51 | }; 52 | 53 | // If no element is supplied, we'll attach to body 54 | $.backstretch = function (images, options) { 55 | // Return the instance 56 | return $('body') 57 | .backstretch(images, options) 58 | .data('backstretch'); 59 | }; 60 | 61 | // Custom selector 62 | $.expr[':'].backstretch = function(elem) { 63 | return $(elem).data('backstretch') !== undefined; 64 | }; 65 | 66 | /* DEFAULTS 67 | * ========================= */ 68 | 69 | $.fn.backstretch.defaults = { 70 | centeredX: true // Should we center the image on the X axis? 71 | , centeredY: true // Should we center the image on the Y axis? 72 | , duration: 5000 // Amount of time in between slides (if slideshow) 73 | , fade: 0 // Speed of fade transition between slides 74 | }; 75 | 76 | /* STYLES 77 | * 78 | * Baked-in styles that we'll apply to our elements. 79 | * In an effort to keep the plugin simple, these are not exposed as options. 80 | * That said, anyone can override these in their own stylesheet. 81 | * ========================= */ 82 | var styles = { 83 | wrap: { 84 | left: 0 85 | , top: 0 86 | , overflow: 'hidden' 87 | , margin: 0 88 | , padding: 0 89 | , height: '100%' 90 | , width: '100%' 91 | , zIndex: -999999 92 | } 93 | , img: { 94 | position: 'absolute' 95 | , display: 'none' 96 | , margin: 0 97 | , padding: 0 98 | , border: 'none' 99 | , width: 'auto' 100 | , height: 'auto' 101 | , maxHeight: 'none' 102 | , maxWidth: 'none' 103 | , zIndex: -999999 104 | } 105 | }; 106 | 107 | /* CLASS DEFINITION 108 | * ========================= */ 109 | var Backstretch = function (container, images, options) { 110 | this.options = $.extend({}, $.fn.backstretch.defaults, options || {}); 111 | 112 | /* In its simplest form, we allow Backstretch to be called on an image path. 113 | * e.g. $.backstretch('/path/to/image.jpg') 114 | * So, we need to turn this back into an array. 115 | */ 116 | this.images = $.isArray(images) ? images : [images]; 117 | 118 | // Preload images 119 | $.each(this.images, function () { 120 | $('')[0].src = this; 121 | }); 122 | 123 | // Convenience reference to know if the container is body. 124 | this.isBody = container === document.body; 125 | 126 | /* We're keeping track of a few different elements 127 | * 128 | * Container: the element that Backstretch was called on. 129 | * Wrap: a DIV that we place the image into, so we can hide the overflow. 130 | * Root: Convenience reference to help calculate the correct height. 131 | */ 132 | this.$container = $(container); 133 | this.$root = this.isBody ? supportsFixedPosition ? $(window) : $(document) : this.$container; 134 | 135 | // Don't create a new wrap if one already exists (from a previous instance of Backstretch) 136 | var $existing = this.$container.children(".backstretch").first(); 137 | this.$wrap = $existing.length ? $existing : $('
').css(styles.wrap).appendTo(this.$container); 138 | 139 | // Non-body elements need some style adjustments 140 | if (!this.isBody) { 141 | // If the container is statically positioned, we need to make it relative, 142 | // and if no zIndex is defined, we should set it to zero. 143 | var position = this.$container.css('position') 144 | , zIndex = this.$container.css('zIndex'); 145 | 146 | this.$container.css({ 147 | position: position === 'static' ? 'relative' : position 148 | , zIndex: zIndex === 'auto' ? 0 : zIndex 149 | , background: 'none' 150 | }); 151 | 152 | // Needs a higher z-index 153 | this.$wrap.css({zIndex: -999998}); 154 | } 155 | 156 | // Fixed or absolute positioning? 157 | this.$wrap.css({ 158 | position: this.isBody && supportsFixedPosition ? 'fixed' : 'absolute' 159 | }); 160 | 161 | // Set the first image 162 | this.index = 0; 163 | this.show(this.index); 164 | 165 | // Listen for resize 166 | $(window).on('resize.backstretch', $.proxy(this.resize, this)) 167 | .on('orientationchange.backstretch', $.proxy(function () { 168 | // Need to do this in order to get the right window height 169 | if (this.isBody && window.pageYOffset === 0) { 170 | window.scrollTo(0, 1); 171 | this.resize(); 172 | } 173 | }, this)); 174 | }; 175 | 176 | /* PUBLIC METHODS 177 | * ========================= */ 178 | Backstretch.prototype = { 179 | resize: function () { 180 | try { 181 | var bgCSS = {left: 0, top: 0} 182 | , rootWidth = this.isBody ? this.$root.width() : this.$root.innerWidth() 183 | , bgWidth = rootWidth 184 | , rootHeight = this.isBody ? ( window.innerHeight ? window.innerHeight : this.$root.height() ) : this.$root.innerHeight() 185 | , bgHeight = bgWidth / this.$img.data('ratio') 186 | , bgOffset; 187 | 188 | // Make adjustments based on image ratio 189 | if (bgHeight >= rootHeight) { 190 | bgOffset = (bgHeight - rootHeight) / 2; 191 | if(this.options.centeredY) { 192 | bgCSS.top = '-' + bgOffset + 'px'; 193 | } 194 | } else { 195 | bgHeight = rootHeight; 196 | bgWidth = bgHeight * this.$img.data('ratio'); 197 | bgOffset = (bgWidth - rootWidth) / 2; 198 | if(this.options.centeredX) { 199 | bgCSS.left = '-' + bgOffset + 'px'; 200 | } 201 | } 202 | 203 | this.$wrap.css({width: rootWidth, height: rootHeight}) 204 | .find('img:not(.deleteable)').css({width: bgWidth, height: bgHeight}).css(bgCSS); 205 | } catch(err) { 206 | // IE7 seems to trigger resize before the image is loaded. 207 | // This try/catch block is a hack to let it fail gracefully. 208 | } 209 | 210 | return this; 211 | } 212 | 213 | // Show the slide at a certain position 214 | , show: function (newIndex) { 215 | 216 | // Validate index 217 | if (Math.abs(newIndex) > this.images.length - 1) { 218 | return; 219 | } 220 | 221 | // Vars 222 | var self = this 223 | , oldImage = self.$wrap.find('img').addClass('deleteable') 224 | , evtOptions = { relatedTarget: self.$container[0] }; 225 | 226 | // Trigger the "before" event 227 | self.$container.trigger($.Event('backstretch.before', evtOptions), [self, newIndex]); 228 | 229 | // Set the new index 230 | this.index = newIndex; 231 | 232 | // Pause the slideshow 233 | clearInterval(self.interval); 234 | 235 | // New image 236 | self.$img = $('') 237 | .css(styles.img) 238 | .bind('load', function (e) { 239 | var imgWidth = this.width || $(e.target).width() 240 | , imgHeight = this.height || $(e.target).height(); 241 | 242 | // Save the ratio 243 | $(this).data('ratio', imgWidth / imgHeight); 244 | 245 | // Show the image, then delete the old one 246 | // "speed" option has been deprecated, but we want backwards compatibilty 247 | $(this).fadeIn(self.options.speed || self.options.fade, function () { 248 | oldImage.remove(); 249 | 250 | // Resume the slideshow 251 | if (!self.paused) { 252 | self.cycle(); 253 | } 254 | 255 | // Trigger the "after" and "show" events 256 | // "show" is being deprecated 257 | $(['after', 'show']).each(function () { 258 | self.$container.trigger($.Event('backstretch.' + this, evtOptions), [self, newIndex]); 259 | }); 260 | }); 261 | 262 | // Resize 263 | self.resize(); 264 | }) 265 | .appendTo(self.$wrap); 266 | 267 | // Hack for IE img onload event 268 | self.$img.attr('src', self.images[newIndex]); 269 | return self; 270 | } 271 | 272 | , next: function () { 273 | // Next slide 274 | return this.show(this.index < this.images.length - 1 ? this.index + 1 : 0); 275 | } 276 | 277 | , prev: function () { 278 | // Previous slide 279 | return this.show(this.index === 0 ? this.images.length - 1 : this.index - 1); 280 | } 281 | 282 | , pause: function () { 283 | // Pause the slideshow 284 | this.paused = true; 285 | return this; 286 | } 287 | 288 | , resume: function () { 289 | // Resume the slideshow 290 | this.paused = false; 291 | this.next(); 292 | return this; 293 | } 294 | 295 | , cycle: function () { 296 | // Start/resume the slideshow 297 | if(this.images.length > 1) { 298 | // Clear the interval, just in case 299 | clearInterval(this.interval); 300 | 301 | this.interval = setInterval($.proxy(function () { 302 | // Check for paused slideshow 303 | if (!this.paused) { 304 | this.next(); 305 | } 306 | }, this), this.options.duration); 307 | } 308 | return this; 309 | } 310 | 311 | , destroy: function (preserveBackground) { 312 | // Stop the resize events 313 | $(window).off('resize.backstretch orientationchange.backstretch'); 314 | 315 | // Clear the interval 316 | clearInterval(this.interval); 317 | 318 | // Remove Backstretch 319 | if(!preserveBackground) { 320 | this.$wrap.remove(); 321 | } 322 | this.$container.removeData('backstretch'); 323 | } 324 | }; 325 | 326 | /* SUPPORTS FIXED POSITION? 327 | * 328 | * Based on code from jQuery Mobile 1.1.0 329 | * http://jquerymobile.com/ 330 | * 331 | * In a nutshell, we need to figure out if fixed positioning is supported. 332 | * Unfortunately, this is very difficult to do on iOS, and usually involves 333 | * injecting content, scrolling the page, etc.. It's ugly. 334 | * jQuery Mobile uses this workaround. It's not ideal, but works. 335 | * 336 | * Modified to detect IE6 337 | * ========================= */ 338 | 339 | var supportsFixedPosition = (function () { 340 | var ua = navigator.userAgent 341 | , platform = navigator.platform 342 | // Rendering engine is Webkit, and capture major version 343 | , wkmatch = ua.match( /AppleWebKit\/([0-9]+)/ ) 344 | , wkversion = !!wkmatch && wkmatch[ 1 ] 345 | , ffmatch = ua.match( /Fennec\/([0-9]+)/ ) 346 | , ffversion = !!ffmatch && ffmatch[ 1 ] 347 | , operammobilematch = ua.match( /Opera Mobi\/([0-9]+)/ ) 348 | , omversion = !!operammobilematch && operammobilematch[ 1 ] 349 | , iematch = ua.match( /MSIE ([0-9]+)/ ) 350 | , ieversion = !!iematch && iematch[ 1 ]; 351 | 352 | return !( 353 | // iOS 4.3 and older : Platform is iPhone/Pad/Touch and Webkit version is less than 534 (ios5) 354 | ((platform.indexOf( "iPhone" ) > -1 || platform.indexOf( "iPad" ) > -1 || platform.indexOf( "iPod" ) > -1 ) && wkversion && wkversion < 534) || 355 | 356 | // Opera Mini 357 | (window.operamini && ({}).toString.call( window.operamini ) === "[object OperaMini]") || 358 | (operammobilematch && omversion < 7458) || 359 | 360 | //Android lte 2.1: Platform is Android and Webkit version is less than 533 (Android 2.2) 361 | (ua.indexOf( "Android" ) > -1 && wkversion && wkversion < 533) || 362 | 363 | // Firefox Mobile before 6.0 - 364 | (ffversion && ffversion < 6) || 365 | 366 | // WebOS less than 3 367 | ("palmGetResource" in window && wkversion && wkversion < 534) || 368 | 369 | // MeeGo 370 | (ua.indexOf( "MeeGo" ) > -1 && ua.indexOf( "NokiaBrowser/8.5.0" ) > -1) || 371 | 372 | // IE6 373 | (ieversion && ieversion <= 6) 374 | ); 375 | }()); 376 | 377 | }(jQuery, window)); -------------------------------------------------------------------------------- /public/stylesheets/assets/bootstrap/css/bootstrap-theme.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.3.4 (http://getbootstrap.com) 3 | * Copyright 2011-2015 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */.btn-danger,.btn-default,.btn-info,.btn-primary,.btn-success,.btn-warning{text-shadow:0 -1px 0 rgba(0,0,0,.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075)}.btn-danger.active,.btn-danger:active,.btn-default.active,.btn-default:active,.btn-info.active,.btn-info:active,.btn-primary.active,.btn-primary:active,.btn-success.active,.btn-success:active,.btn-warning.active,.btn-warning:active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-danger .badge,.btn-default .badge,.btn-info .badge,.btn-primary .badge,.btn-success .badge,.btn-warning .badge{text-shadow:none}.btn.active,.btn:active{background-image:none}.btn-default{text-shadow:0 1px 0 #fff;background-image:-webkit-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:-o-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#e0e0e0));background-image:linear-gradient(to bottom,#fff 0,#e0e0e0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#dbdbdb;border-color:#ccc}.btn-default:focus,.btn-default:hover{background-color:#e0e0e0;background-position:0 -15px}.btn-default.active,.btn-default:active{background-color:#e0e0e0;border-color:#dbdbdb}.btn-default.disabled,.btn-default:disabled,.btn-default[disabled]{background-color:#e0e0e0;background-image:none}.btn-primary{background-image:-webkit-linear-gradient(top,#337ab7 0,#265a88 100%);background-image:-o-linear-gradient(top,#337ab7 0,#265a88 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#265a88));background-image:linear-gradient(to bottom,#337ab7 0,#265a88 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff265a88', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#245580}.btn-primary:focus,.btn-primary:hover{background-color:#265a88;background-position:0 -15px}.btn-primary.active,.btn-primary:active{background-color:#265a88;border-color:#245580}.btn-primary.disabled,.btn-primary:disabled,.btn-primary[disabled]{background-color:#265a88;background-image:none}.btn-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#419641 100%);background-image:-o-linear-gradient(top,#5cb85c 0,#419641 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5cb85c),to(#419641));background-image:linear-gradient(to bottom,#5cb85c 0,#419641 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#3e8f3e}.btn-success:focus,.btn-success:hover{background-color:#419641;background-position:0 -15px}.btn-success.active,.btn-success:active{background-color:#419641;border-color:#3e8f3e}.btn-success.disabled,.btn-success:disabled,.btn-success[disabled]{background-color:#419641;background-image:none}.btn-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#2aabd2 100%);background-image:-o-linear-gradient(top,#5bc0de 0,#2aabd2 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5bc0de),to(#2aabd2));background-image:linear-gradient(to bottom,#5bc0de 0,#2aabd2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#28a4c9}.btn-info:focus,.btn-info:hover{background-color:#2aabd2;background-position:0 -15px}.btn-info.active,.btn-info:active{background-color:#2aabd2;border-color:#28a4c9}.btn-info.disabled,.btn-info:disabled,.btn-info[disabled]{background-color:#2aabd2;background-image:none}.btn-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#eb9316 100%);background-image:-o-linear-gradient(top,#f0ad4e 0,#eb9316 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f0ad4e),to(#eb9316));background-image:linear-gradient(to bottom,#f0ad4e 0,#eb9316 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#e38d13}.btn-warning:focus,.btn-warning:hover{background-color:#eb9316;background-position:0 -15px}.btn-warning.active,.btn-warning:active{background-color:#eb9316;border-color:#e38d13}.btn-warning.disabled,.btn-warning:disabled,.btn-warning[disabled]{background-color:#eb9316;background-image:none}.btn-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c12e2a 100%);background-image:-o-linear-gradient(top,#d9534f 0,#c12e2a 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9534f),to(#c12e2a));background-image:linear-gradient(to bottom,#d9534f 0,#c12e2a 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#b92c28}.btn-danger:focus,.btn-danger:hover{background-color:#c12e2a;background-position:0 -15px}.btn-danger.active,.btn-danger:active{background-color:#c12e2a;border-color:#b92c28}.btn-danger.disabled,.btn-danger:disabled,.btn-danger[disabled]{background-color:#c12e2a;background-image:none}.img-thumbnail,.thumbnail{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{background-color:#e8e8e8;background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-o-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),to(#e8e8e8));background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);background-repeat:repeat-x}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{background-color:#2e6da4;background-image:-webkit-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2e6da4));background-image:linear-gradient(to bottom,#337ab7 0,#2e6da4 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);background-repeat:repeat-x}.navbar-default{background-image:-webkit-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:-o-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#f8f8f8));background-image:linear-gradient(to bottom,#fff 0,#f8f8f8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075)}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.open>a{background-image:-webkit-linear-gradient(top,#dbdbdb 0,#e2e2e2 100%);background-image:-o-linear-gradient(top,#dbdbdb 0,#e2e2e2 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dbdbdb),to(#e2e2e2));background-image:linear-gradient(to bottom,#dbdbdb 0,#e2e2e2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0);background-repeat:repeat-x;-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.075);box-shadow:inset 0 3px 9px rgba(0,0,0,.075)}.navbar-brand,.navbar-nav>li>a{text-shadow:0 1px 0 rgba(255,255,255,.25)}.navbar-inverse{background-image:-webkit-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:-o-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#3c3c3c),to(#222));background-image:linear-gradient(to bottom,#3c3c3c 0,#222 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.open>a{background-image:-webkit-linear-gradient(top,#080808 0,#0f0f0f 100%);background-image:-o-linear-gradient(top,#080808 0,#0f0f0f 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#080808),to(#0f0f0f));background-image:linear-gradient(to bottom,#080808 0,#0f0f0f 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0);background-repeat:repeat-x;-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.25);box-shadow:inset 0 3px 9px rgba(0,0,0,.25)}.navbar-inverse .navbar-brand,.navbar-inverse .navbar-nav>li>a{text-shadow:0 -1px 0 rgba(0,0,0,.25)}.navbar-fixed-bottom,.navbar-fixed-top,.navbar-static-top{border-radius:0}@media (max-width:767px){.navbar .navbar-nav .open .dropdown-menu>.active>a,.navbar .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-image:-webkit-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2e6da4));background-image:linear-gradient(to bottom,#337ab7 0,#2e6da4 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);background-repeat:repeat-x}}.alert{text-shadow:0 1px 0 rgba(255,255,255,.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05)}.alert-success{background-image:-webkit-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:-o-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dff0d8),to(#c8e5bc));background-image:linear-gradient(to bottom,#dff0d8 0,#c8e5bc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);background-repeat:repeat-x;border-color:#b2dba1}.alert-info{background-image:-webkit-linear-gradient(top,#d9edf7 0,#b9def0 100%);background-image:-o-linear-gradient(top,#d9edf7 0,#b9def0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9edf7),to(#b9def0));background-image:linear-gradient(to bottom,#d9edf7 0,#b9def0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);background-repeat:repeat-x;border-color:#9acfea}.alert-warning{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#f8efc0 100%);background-image:-o-linear-gradient(top,#fcf8e3 0,#f8efc0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fcf8e3),to(#f8efc0));background-image:linear-gradient(to bottom,#fcf8e3 0,#f8efc0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);background-repeat:repeat-x;border-color:#f5e79e}.alert-danger{background-image:-webkit-linear-gradient(top,#f2dede 0,#e7c3c3 100%);background-image:-o-linear-gradient(top,#f2dede 0,#e7c3c3 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f2dede),to(#e7c3c3));background-image:linear-gradient(to bottom,#f2dede 0,#e7c3c3 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);background-repeat:repeat-x;border-color:#dca7a7}.progress{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:-o-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#ebebeb),to(#f5f5f5));background-image:linear-gradient(to bottom,#ebebeb 0,#f5f5f5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0);background-repeat:repeat-x}.progress-bar{background-image:-webkit-linear-gradient(top,#337ab7 0,#286090 100%);background-image:-o-linear-gradient(top,#337ab7 0,#286090 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#286090));background-image:linear-gradient(to bottom,#337ab7 0,#286090 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff286090', GradientType=0);background-repeat:repeat-x}.progress-bar-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:-o-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5cb85c),to(#449d44));background-image:linear-gradient(to bottom,#5cb85c 0,#449d44 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0);background-repeat:repeat-x}.progress-bar-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:-o-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5bc0de),to(#31b0d5));background-image:linear-gradient(to bottom,#5bc0de 0,#31b0d5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0);background-repeat:repeat-x}.progress-bar-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:-o-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f0ad4e),to(#ec971f));background-image:linear-gradient(to bottom,#f0ad4e 0,#ec971f 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0);background-repeat:repeat-x}.progress-bar-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:-o-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9534f),to(#c9302c));background-image:linear-gradient(to bottom,#d9534f 0,#c9302c 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0);background-repeat:repeat-x}.progress-bar-striped{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.list-group{border-radius:4px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{text-shadow:0 -1px 0 #286090;background-image:-webkit-linear-gradient(top,#337ab7 0,#2b669a 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2b669a 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2b669a));background-image:linear-gradient(to bottom,#337ab7 0,#2b669a 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2b669a', GradientType=0);background-repeat:repeat-x;border-color:#2b669a}.list-group-item.active .badge,.list-group-item.active:focus .badge,.list-group-item.active:hover .badge{text-shadow:none}.panel{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.05);box-shadow:0 1px 2px rgba(0,0,0,.05)}.panel-default>.panel-heading{background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-o-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),to(#e8e8e8));background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);background-repeat:repeat-x}.panel-primary>.panel-heading{background-image:-webkit-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2e6da4));background-image:linear-gradient(to bottom,#337ab7 0,#2e6da4 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);background-repeat:repeat-x}.panel-success>.panel-heading{background-image:-webkit-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:-o-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dff0d8),to(#d0e9c6));background-image:linear-gradient(to bottom,#dff0d8 0,#d0e9c6 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0);background-repeat:repeat-x}.panel-info>.panel-heading{background-image:-webkit-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:-o-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9edf7),to(#c4e3f3));background-image:linear-gradient(to bottom,#d9edf7 0,#c4e3f3 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0);background-repeat:repeat-x}.panel-warning>.panel-heading{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:-o-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fcf8e3),to(#faf2cc));background-image:linear-gradient(to bottom,#fcf8e3 0,#faf2cc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0);background-repeat:repeat-x}.panel-danger>.panel-heading{background-image:-webkit-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:-o-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f2dede),to(#ebcccc));background-image:linear-gradient(to bottom,#f2dede 0,#ebcccc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0);background-repeat:repeat-x}.well{background-image:-webkit-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:-o-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#e8e8e8),to(#f5f5f5));background-image:linear-gradient(to bottom,#e8e8e8 0,#f5f5f5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);background-repeat:repeat-x;border-color:#dcdcdc;-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1)} --------------------------------------------------------------------------------