Commit 178b3c5a by Иван Кубота

fixes

parent a007984e
...@@ -90,8 +90,8 @@ module.exports = { ...@@ -90,8 +90,8 @@ module.exports = {
summary: 'Compliting attempt', summary: 'Compliting attempt',
fn: async function (args) { fn: async function (args) {
var att = await asyncPool('SELECT * from quiz_attempt WHERE' + var att = await asyncPool('SELECT * from quiz_attempt WHERE ' +
'quiz_position_id=?, user_id=??', [args.body.quiz_position_id, args.body.user_id]); 'quiz_position_id=?, user_id=?', [args.body.quiz_position_id, args.body.user_id]);
if(!att || !att.length){ if(!att || !att.length){
console.error('NO ATTEMPT, ', att); console.error('NO ATTEMPT, ', att);
...@@ -101,7 +101,7 @@ module.exports = { ...@@ -101,7 +101,7 @@ module.exports = {
return await asyncPool('UPDATE quiz_attempt SET' + return await asyncPool('UPDATE quiz_attempt SET' +
'is_top=?, completed=?, completed_at=?,' + 'is_top=?, completed=?, completed_at=?' +
' WHERE attempt_id=?', [args.body.is_top?1:0, 1, new Date(), att.id]) ' WHERE attempt_id=?', [args.body.is_top?1:0, 1, new Date(), att.id])
} }
...@@ -144,7 +144,7 @@ module.exports = { ...@@ -144,7 +144,7 @@ module.exports = {
} }
maxChain = Math.max(maxChain, curChain); maxChain = Math.max(maxChain, curChain);
return await asyncPool('UPDATE quiz_attempt SET' + return await asyncPool('UPDATE quiz_attempt SET' +
'count_correct=?, max_chain=?, completed=?, completed_at=?,' + 'count_correct=?, max_chain=?, completed=?, completed_at=?' +
' WHERE attempt_id=?', [countCorrect, maxChain, 1, new Date(), q[0].attempt_id]) ' WHERE attempt_id=?', [countCorrect, maxChain, 1, new Date(), q[0].attempt_id])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment