Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kus-admin
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Кубота
kus-admin
Commits
178b3c5a
Commit
178b3c5a
authored
Jul 05, 2020
by
Иван Кубота
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes
parent
a007984e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
quiz.js
src/api/quiz.js
+4
-4
No files found.
src/api/quiz.js
View file @
178b3c5a
...
...
@@ -90,8 +90,8 @@ module.exports = {
summary
:
'Compliting attempt'
,
fn
:
async
function
(
args
)
{
var
att
=
await
asyncPool
(
'SELECT * from quiz_attempt WHERE'
+
'quiz_position_id=?, user_id=?
?
'
,
[
args
.
body
.
quiz_position_id
,
args
.
body
.
user_id
]);
var
att
=
await
asyncPool
(
'SELECT * from quiz_attempt WHERE
'
+
'quiz_position_id=?, user_id=?'
,
[
args
.
body
.
quiz_position_id
,
args
.
body
.
user_id
]);
if
(
!
att
||
!
att
.
length
){
console
.
error
(
'NO ATTEMPT, '
,
att
);
...
...
@@ -101,7 +101,7 @@ module.exports = {
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
])
}
...
...
@@ -144,7 +144,7 @@ module.exports = {
}
maxChain
=
Math
.
max
(
maxChain
,
curChain
);
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
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment