Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
knowledge-platform
Commits
34f0dd21
Commit
34f0dd21
authored
5 years ago
by
Pradyumna Nagendra
Browse files
Options
Download
Patches
Plain Diff
Issue #devcon feat: School APIs
parent
b921ae44
devcon-2020
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
learning-api/content-service/app/controllers/v3/TeacherController.scala
+12
-0
...ontent-service/app/controllers/v3/TeacherController.scala
learning-api/content-service/conf/routes
+4
-2
learning-api/content-service/conf/routes
with
16 additions
and
2 deletions
+16
-2
learning-api/content-service/app/controllers/v3/TeacherController.scala
+
12
−
0
View file @
34f0dd21
...
...
@@ -67,4 +67,16 @@ class TeacherController @Inject()(@Named(ActorNames.SCHOOL_ACTOR) schoolActor: A
val
result
=
cmd
.!!
Ok
(
result
).
as
(
"application/json"
)
}
def
getAssessmentScore
(
sessionId
:
String
)
=
Action
{
implicit
request
=>
val
cmd
=
Seq
(
"curl"
,
"-X"
,
"POST"
,
s
"http://50.1.0.12:8082/druid/v2"
,
"-H"
,
"Content-Type: application/json"
,
"-H"
,
"Content-Type: application/json"
,
"-d"
,
"{\n \"queryType\": \"groupBy\",\n \"dataSource\": \"devcon-events\",\n \"dimensions\": [\n \"profileId\",\n \"profileName\"\n ],\n \"aggregations\": [\n {\n \"fieldName\": \"edata_duration\",\n \"fieldNames\": [\n \"edata_duration\"\n ],\n \"type\": \"doubleSum\",\n \"name\": \"SUM(edata_duration)\"\n },\n {\n \"fieldName\": \"edata_score\",\n \"fieldNames\": [\n \"edata_score\"\n ],\n \"type\": \"doubleSum\",\n \"name\": \"SUM(edata_score)\"\n }\n ],\n \"granularity\": \"all\",\n \"postAggregations\": [],\n \"intervals\": \"2020-02-15T00:00:00+00:00/2020-02-23T00:00:00+00:00\",\n \"filter\": {\n \"type\": \"and\",\n \"fields\": [\n {\n \"type\": \"selector\",\n \"dimension\": \"sid\",\n \"value\": \""
+
sessionId
+
"\"\n },\n {\n \"type\": \"selector\",\n \"dimension\": \"eid\",\n \"value\": \"DC_ASSESS\"\n }\n ]\n },\n \"limitSpec\": {\n \"type\": \"default\",\n \"limit\": 10000,\n \"columns\": [\n {\n \"dimension\": \"SUM(edata_duration)\",\n \"direction\": \"descending\"\n }\n ]\n }\n}"
)
val
result
=
cmd
.!!
Ok
(
result
).
as
(
"application/json"
)
}
def
getAttendance
(
sessionId
:
String
)
=
Action
{
implicit
request
=>
val
cmd
=
Seq
(
"curl"
,
"-X"
,
"POST"
,
s
"http://50.1.0.12:8082/druid/v2"
,
"-H"
,
"Content-Type: application/json"
,
"-H"
,
"Content-Type: application/json"
,
"-d"
,
"{\"queryType\":\"groupBy\",\"dataSource\":\"devcon-events\",\"dimensions\":[\"profileId\",\"profileName\"],\"aggregations\":[],\"granularity\":\"all\",\"postAggregations\":[],\"intervals\":\"2020-02-15T00:00:00+00:00/2020-02-23T00:00:00+00:00\",\"filter\":{\"type\":\"and\",\"fields\":[{\"type\":\"selector\",\"dimension\":\"sid\",\"value\":\""
+
sessionId
+
"\"},{\"type\":\"selector\",\"dimension\":\"eid\",\"value\":\"DC_ATTEND\"}]},\"limitSpec\":{\"type\":\"default\",\"limit\":10000,\"columns\":[{\"dimension\":\"profileId\",\"direction\":\"descending\"}]}}"
)
val
result
=
cmd
.!!
Ok
(
result
).
as
(
"application/json"
)
}
}
This diff is collapsed.
Click to expand it.
learning-api/content-service/conf/routes
+
4
−
2
View file @
34f0dd21
...
...
@@ -27,8 +27,10 @@ POST /period/v3/create controllers.v3.PeriodController.cr
GET /period/v3/read/:identifier controllers.v3.PeriodController.read(identifier: String)
POST /teacher/v3/user/profile controllers.v3.TeacherController.addUserProfile
POST /period/v3/user/attend controllers.v3.PeriodController.addUserAttended
GET /period/v3/attendance/:identifier controllers.v3.PeriodController.getAttendance(identifier: String)
#
GET /period/v3/attendance/:identifier controllers.v3.PeriodController.getAttendance(identifier: String)
GET /teacher/v3/user/profile/:identifier controllers.v3.TeacherController.getUserProfile(identifier: String)
POST /teacher/v3/notify/batch controllers.v3.TeacherController.notifyBatch
POST /teacher/v3/notify/batch controllers.v3.TeacherController.notifyBatch
GET /period/v3/attendance/:sessionId controllers.v3.TeacherController.getAttendance(sessionId: String)
GET /period/v3/assessment/:sessionId controllers.v3.TeacherController.getAssessmentScore(sessionId: String)
#Devcon-School - End
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets