projects
/
qomet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d4dba33
)
'update'
author
Benjamin Auder
<benjamin.auder@somewhere>
Mon, 19 Feb 2018 11:11:23 +0000
(12:11 +0100)
committer
Benjamin Auder
<benjamin.auder@somewhere>
Mon, 19 Feb 2018 11:11:23 +0000
(12:11 +0100)
public/javascripts/components/statements.js
patch
|
blob
|
blame
|
history
public/javascripts/course.js
patch
|
blob
|
blame
|
history
public/javascripts/grade.js
patch
|
blob
|
blame
|
history
routes/users.js
patch
|
blob
|
blame
|
history
views/course.pug
patch
|
blob
|
blame
|
history
diff --git
a/public/javascripts/components/statements.js
b/public/javascripts/components/statements.js
index
86138c0
..
6e12eb6
100644
(file)
--- a/
public/javascripts/components/statements.js
+++ b/
public/javascripts/components/statements.js
@@
-32,7
+32,7
@@
Vue.component("statements", {
displayStyle: "compact", //or "all": all on same page
parameters: 0, //TODO: DO NOT re-draw parameters for already answered questions
};
displayStyle: "compact", //or "all": all on same page
parameters: 0, //TODO: DO NOT re-draw parameters for already answered questions
};
- }
+ }
,
// Full questions tree is rendered, but some parts hidden depending on display settings
render(h) {
// Prepare questions groups, ordered
// Full questions tree is rendered, but some parts hidden depending on display settings
render(h) {
// Prepare questions groups, ordered
@@
-158,7
+158,7
@@
Vue.component("statements", {
{
"class": {
"question": true,
{
"class": {
"question": true,
-
"depth" + depth
: true,
+
["depth" + depth]
: true,
},
},
questionContent
},
},
questionContent
@@
-171,7
+171,7
@@
Vue.component("statements", {
"questionGroup": true,
"hide": this.display == "one" && this.iidx != i,
},
"questionGroup": true,
"hide": this.display == "one" && this.iidx != i,
},
- }
+ }
,
qgDom
);
});
qgDom
);
});
diff --git
a/public/javascripts/course.js
b/public/javascripts/course.js
index
6320538
..
781424a
100644
(file)
--- a/
public/javascripts/course.js
+++ b/
public/javascripts/course.js
@@
-44,23
+44,8
@@
new Vue({
questionsText: "", //questions in an evaluation, in text format
},
mounted: function() {
questionsText: "", //questions in an evaluation, in text format
},
mounted: function() {
-
-
-
- $('.modal').each( (i,elem) => {
- if (elem.id != "evaluationEdit")
- $(elem).modal();
- });
- $('ul.tabs').tabs(); //--> migrate to grade.js
-
-
-
- $('#evaluationEdit').modal({
- complete: () => {
- this.parseEvaluation();
- Vue.nextTick(statementsLibsRefresh);
- },
- });
+ $('.modal').modal();
+ Materialize.updateTextFields(); //textareas, time field...
},
methods: {
// GENERAL:
},
methods: {
// GENERAL:
@@
-145,10
+130,6
@@
new Vue({
}
);
},
}
);
},
- materialOpenModal: function(id) {
- $("#" + id).modal("open");
- Materialize.updateTextFields(); //textareas, time field...
- },
updateEvaluation: function() {
$.ajax("/evaluations", {
method: "PUT",
updateEvaluation: function() {
$.ajax("/evaluations", {
method: "PUT",
diff --git
a/public/javascripts/grade.js
b/public/javascripts/grade.js
index
d0f04cf
..
74e4c04
100644
(file)
--- a/
public/javascripts/grade.js
+++ b/
public/javascripts/grade.js
@@
-14,6
+14,7
@@
new Vue({
},
mounted: function() {
// TODO
},
mounted: function() {
// TODO
+ $('ul.tabs').tabs(); //--> migrate to grade.js
},
methods: {
// GRADES:
},
methods: {
// GRADES:
diff --git
a/routes/users.js
b/routes/users.js
index
993c15e
..
f56b4af
100644
(file)
--- a/
routes/users.js
+++ b/
routes/users.js
@@
-19,7
+19,7
@@
function setAndSendLoginToken(subject, to, res)
subject: subject,
body: "Hello " + to.initials + "!\n" +
"Access your account here: " +
subject: subject,
body: "Hello " + to.initials + "!\n" +
"Access your account here: " +
- params.siteURL + "/authenticate
?token=
" + token + "\\n" +
+ params.siteURL + "/authenticate
/
" + token + "\\n" +
"Token will expire in " + params.token.expire/(1000*60) + " minutes."
}, err => {
res.json(err || {});
"Token will expire in " + params.token.expire/(1000*60) + " minutes."
}, err => {
res.json(err || {});
@@
-30,8
+30,8
@@
function setAndSendLoginToken(subject, to, res)
router.post('/register', access.ajax, access.unlogged, (req,res) => {
const newUser = {
router.post('/register', access.ajax, access.unlogged, (req,res) => {
const newUser = {
- email:
req.body.email
,
- name:
req.body.name
,
+ email:
decodeURIComponent(req.body.email)
,
+ name:
decodeURIComponent(req.body.name)
,
};
let error = validator(newUser, "User");
if (error.length > 0)
};
let error = validator(newUser, "User");
if (error.length > 0)
@@
-52,7
+52,7
@@
router.post('/register', access.ajax, access.unlogged, (req,res) => {
// Login:
router.put('/sendtoken', access.ajax, access.unlogged, (req,res) => {
// Login:
router.put('/sendtoken', access.ajax, access.unlogged, (req,res) => {
- const email =
req.body.email
;
+ const email =
decodeURIComponent(req.body.email)
;
let error = validator({email:email}, "User");
if (error.length > 0)
return res.json({errmsg:error});
let error = validator({email:email}, "User");
if (error.length > 0)
return res.json({errmsg:error});
@@
-65,7
+65,7
@@
router.put('/sendtoken', access.ajax, access.unlogged, (req,res) => {
});
// Authentication process, optionally with email changing:
});
// Authentication process, optionally with email changing:
-router.
pu
t('/authenticate/:token([a-z0-9]+)', access.unlogged, (req,res) => {
+router.
ge
t('/authenticate/:token([a-z0-9]+)', access.unlogged, (req,res) => {
const loginToken = req.params.token;
UserModel.getByLoginToken(loginToken, (err,user) => {
access.checkRequest(res, err, user, "Invalid token", () => {
const loginToken = req.params.token;
UserModel.getByLoginToken(loginToken, (err,user) => {
access.checkRequest(res, err, user, "Invalid token", () => {
@@
-96,7
+96,7
@@
router.put('/authenticate/:token([a-z0-9]+)', access.unlogged, (req,res) => {
});
});
});
});
-router.
pu
t('/logout', access.logged, (req,res) => {
+router.
ge
t('/logout', access.logged, (req,res) => {
UserModel.removeToken(req.user._id, req.cookies.token, (err,ret) => {
access.checkRequest(res, err, ret, "Logout failed", () => {
res.clearCookie("initials");
UserModel.removeToken(req.user._id, req.cookies.token, (err,ret) => {
access.checkRequest(res, err, ret, "Logout failed", () => {
res.clearCookie("initials");
diff --git
a/views/course.pug
b/views/course.pug
index
9d84018
..
cfe56a4
100644
(file)
--- a/
views/course.pug
+++ b/
views/course.pug
@@
-7,9
+7,9
@@
block append stylesheets
block content
.container#course
if teacher
block content
.container#course
if teacher
- #new
e
valuation.modal
+ #new
E
valuation.modal
.modal-content
.modal-content
- form(@submit.prevent="add
e
valuation")
+ form(@submit.prevent="add
E
valuation")
.input-field
input#evaluationName(type="text" v-model="newEvaluation.name" required)
label(for="evaluationName") Name
.input-field
input#evaluationName(type="text" v-model="newEvaluation.name" required)
label(for="evaluationName") Name
@@
-38,11
+38,11
@@
block content
td {{ student.group }}
.row
.col.s12.m10.offset-m1
td {{ student.group }}
.row
.col.s12.m10.offset-m1
- h4.title(@click="toggleDisplay('evaluations')")
e
valuations
+ h4.title(@click="toggleDisplay('evaluations')")
E
valuations
.card(v-show="display=='evaluations'")
if teacher
.center-align
.card(v-show="display=='evaluations'")
if teacher
.center-align
- a.on-left.waves-effect.waves-light.btn.modal-trigger(href="#new
e
valuation") New evaluation
+ a.on-left.waves-effect.waves-light.btn.modal-trigger(href="#new
E
valuation") New evaluation
input#password(type="password" v-model="monitorPwd" @keyup.enter="setPassword"
placeholder="Password" title="Monitoring password")
table
input#password(type="password" v-model="monitorPwd" @keyup.enter="setPassword"
placeholder="Password" title="Monitoring password")
table
@@
-53,7
+53,7
@@
block content
th #Questions
tbody
tr.evaluation(v-for="(evaluation,i) in evaluationArray" :class="{idle:!evaluation.active}"
th #Questions
tbody
tr.evaluation(v-for="(evaluation,i) in evaluationArray" :class="{idle:!evaluation.active}"
- @click.left="action
evaluation(i)" @contextmenu.prevent="deletee
valuation(evaluation)")
+ @click.left="action
Evaluation(i)" @contextmenu.prevent="deleteE
valuation(evaluation)")
td {{ evaluation.name }}
td {{ evaluation.mode }}
td {{ evaluation.questions.length }}
td {{ evaluation.name }}
td {{ evaluation.mode }}
td {{ evaluation.questions.length }}