Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2020-101
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sachith Fernando
2020-101
Commits
1da1edbb
Commit
1da1edbb
authored
Oct 02, 2020
by
I.K Seneviratne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Committing minor modifications in the Lecturer Home Page
parent
a03e6d94
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
2 deletions
+24
-2
FirstApp/api.py
FirstApp/api.py
+19
-1
FirstApp/templates/FirstApp/Home.html
FirstApp/templates/FirstApp/Home.html
+1
-1
FirstApp/urls.py
FirstApp/urls.py
+4
-0
No files found.
FirstApp/api.py
View file @
1da1edbb
...
@@ -198,7 +198,7 @@ class GetLectureVideoViewSet(APIView):
...
@@ -198,7 +198,7 @@ class GetLectureVideoViewSet(APIView):
lecturer_video
=
LectureVideo
.
objects
.
filter
(
lecturer_id
=
lecturer
,
date
=
date
)
lecturer_video
=
LectureVideo
.
objects
.
filter
(
lecturer_id
=
lecturer
,
date
=
date
)
serializer
=
LectureVideoSerializer
(
lecturer_video
,
many
=
True
)
serializer
=
LectureVideoSerializer
(
lecturer_video
,
many
=
True
)
lecture_video_id
=
serializer
.
data
[
index
][
'lecture_video_id'
]
lecture_video_id
=
serializer
.
data
[
0
][
'lecture_video_id'
]
print
(
'lecture video id: '
,
lecture_video_id
)
print
(
'lecture video id: '
,
lecture_video_id
)
activities
=
LectureActivity
.
objects
.
filter
(
lecture_video_id__lecture_video_id
=
lecture_video_id
)
activities
=
LectureActivity
.
objects
.
filter
(
lecture_video_id__lecture_video_id
=
lecture_video_id
)
isActivityFound
=
(
len
(
activities
)
>
0
)
isActivityFound
=
(
len
(
activities
)
>
0
)
...
@@ -209,6 +209,24 @@ class GetLectureVideoViewSet(APIView):
...
@@ -209,6 +209,24 @@ class GetLectureVideoViewSet(APIView):
})
})
# this API will retrieve lecture video details for lecturer Home Page
class
GetLectureVideoViewSetForHome
(
APIView
):
def
get
(
self
,
request
):
lecturer
=
request
.
query_params
.
get
(
'lecturer'
)
date
=
request
.
query_params
.
get
(
'date'
)
lecturer_video
=
LectureVideo
.
objects
.
filter
(
lecturer_id
=
lecturer
,
date
=
date
)
serializer
=
LectureVideoSerializer
(
lecturer_video
,
many
=
True
)
lecture_video_id
=
serializer
.
data
[
0
][
'lecture_video_id'
]
print
(
'lecture video id: '
,
lecture_video_id
)
return
Response
({
"response"
:
serializer
.
data
[
0
]
})
# ACTIVITY
# ACTIVITY
# API for lecture activities
# API for lecture activities
class
LectureActivityViewSet
(
APIView
):
class
LectureActivityViewSet
(
APIView
):
...
...
FirstApp/templates/FirstApp/Home.html
View file @
1da1edbb
...
@@ -75,7 +75,7 @@
...
@@ -75,7 +75,7 @@
//display the video loading message
//display the video loading message
$
(
'
#student_behavior_video_loading
'
).
attr
(
'
hidden
'
,
false
);
$
(
'
#student_behavior_video_loading
'
).
attr
(
'
hidden
'
,
false
);
fetch
(
'
http://127.0.0.1:8000/get-lecture-video
/?lecturer=
'
+
global_lecturer
+
'
&date=
'
+
date_format
+
'
&index=
'
+
global_lecturer_subject_index
)
fetch
(
'
http://127.0.0.1:8000/get-lecture-video
-for-home/?lecturer=
'
+
global_lecturer
+
'
&date=
'
+
date_format
)
.
then
((
res
)
=>
res
.
json
())
.
then
((
res
)
=>
res
.
json
())
.
then
((
out
)
=>
retrieveLectureVideoDetails
(
out
))
.
then
((
out
)
=>
retrieveLectureVideoDetails
(
out
))
.
catch
((
error
)
=>
alert
(
'
an error occurred:
'
+
error
));
.
catch
((
error
)
=>
alert
(
'
an error occurred:
'
+
error
));
...
...
FirstApp/urls.py
View file @
1da1edbb
...
@@ -86,6 +86,9 @@ urlpatterns = [
...
@@ -86,6 +86,9 @@ urlpatterns = [
# lecture video API (to retrieve a lecture)
# lecture video API (to retrieve a lecture)
url
(
r'^get-lecture-video/$'
,
api
.
GetLectureVideoViewSet
.
as_view
()),
url
(
r'^get-lecture-video/$'
,
api
.
GetLectureVideoViewSet
.
as_view
()),
# lecture video API (to retrieve a lecture)
url
(
r'^get-lecture-video-for-home/$'
,
api
.
GetLectureVideoViewSetForHome
.
as_view
()),
##### ACTIVITIES API #####
##### ACTIVITIES API #####
# lecture activity API (to retrieve lecture activities)
# lecture activity API (to retrieve lecture activities)
...
@@ -150,6 +153,7 @@ urlpatterns = [
...
@@ -150,6 +153,7 @@ urlpatterns = [
# lecture video individual student process pose estimation API (for Pose estimation)
# lecture video individual student process pose estimation API (for Pose estimation)
url
(
r'^process-lecture-video-individual-pose-estimation'
,
api
.
ProcessIndividualStudentPoseEstimation
.
as_view
()),
url
(
r'^process-lecture-video-individual-pose-estimation'
,
api
.
ProcessIndividualStudentPoseEstimation
.
as_view
()),
##### GAZE Section #####
##### GAZE Section #####
# lecture video Gaze estimation
# lecture video Gaze estimation
url
(
r'^get-lecture-video-gaze-estimation-availability/$'
,
api
.
GetLectureGazeEstimationAvailaibility
.
as_view
()),
url
(
r'^get-lecture-video-gaze-estimation-availability/$'
,
api
.
GetLectureGazeEstimationAvailaibility
.
as_view
()),
...
...
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