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
e350172a
Commit
e350172a
authored
Jul 12, 2020
by
Иван Кубота
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rewrite back for /api/quiz/active/:userID
parent
17f1e86d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
quiz.js
src/api/quiz.js
+13
-2
No files found.
src/api/quiz.js
View file @
e350172a
...
@@ -270,9 +270,7 @@ module.exports = {
...
@@ -270,9 +270,7 @@ module.exports = {
summary
:
'monitor'
,
summary
:
'monitor'
,
fn
:
async
function
(
args
,
req
,
res
){
fn
:
async
function
(
args
,
req
,
res
){
res
.
header
(
"Content-Type"
,
"text/html; charset=utf-8"
);
res
.
header
(
"Content-Type"
,
"text/html; charset=utf-8"
);
return
(
await
readFile
(
'./public/monitor.html'
)).
toString
(
'utf-8'
);
return
(
await
readFile
(
'./public/monitor.html'
)).
toString
(
'utf-8'
);
}
}
},
},
'/api/quiz/monitordata'
:
{
'/api/quiz/monitordata'
:
{
...
@@ -288,5 +286,17 @@ module.exports = {
...
@@ -288,5 +286,17 @@ module.exports = {
return
l
.
date
>
args
.
start
return
l
.
date
>
args
.
start
});
});
}
}
},
'/api/quiz/active/:userID'
:
{
options
:
{
userID
:
{
required
:
false
,
description
:
'id of user'
,
type
:
Number
},
},
method
:
'GET'
,
summary
:
'Get active quiz for user'
,
fn
:
async
function
(
args
)
{
return
await
asyncPool
(
`select * from quiz
left join quiz_position on quiz_position.quiz_id = quiz.id
WHERE user_position_id=(SELECT position_id from users WHERE id=?) and end_date>=CURDATE();`
,
[
args
.
userID
]);
}
}
}
};
};
\ No newline at end of file
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