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
e3c708cb
Commit
e3c708cb
authored
Jan 04, 2021
by
I.K Seneviratne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Committing the implementations of displaying graphs on activity, emotion and gaze individual pages.
parent
a7659974
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
697 additions
and
236 deletions
+697
-236
FirstApp/api.py
FirstApp/api.py
+8
-3
FirstApp/serializers.py
FirstApp/serializers.py
+6
-1
FirstApp/templates/FirstApp/activity.html
FirstApp/templates/FirstApp/activity.html
+230
-60
FirstApp/templates/FirstApp/emotion.html
FirstApp/templates/FirstApp/emotion.html
+281
-124
FirstApp/templates/FirstApp/gaze.html
FirstApp/templates/FirstApp/gaze.html
+172
-48
No files found.
FirstApp/api.py
View file @
e3c708cb
...
@@ -168,13 +168,17 @@ class LectureVideoViewSet(APIView):
...
@@ -168,13 +168,17 @@ class LectureVideoViewSet(APIView):
# serializer = LectureVideoSerializer(data=request.data, many=True)
# serializer = LectureVideoSerializer(data=request.data, many=True)
serializer
=
LectureVideoSerializer
(
data
=
request
.
data
)
serializer
=
LectureVideoSerializer
(
data
=
request
.
data
)
# serializer.create(validated_data=request.data)
# serializer.create(validated_data=request.data)
data
=
{}
data_ser
=
{}
if
serializer
.
is_valid
(
raise_exception
=
ValueError
):
if
serializer
.
is_valid
(
raise_exception
=
ValueError
):
print
(
'valid'
)
data
=
serializer
.
create
(
validated_data
=
request
.
data
)
serializer
.
create
(
validated_data
=
request
.
data
)
print
(
'data: '
,
data
)
# data_ser = LectureVideoSerializer(data, many=True)
return
Response
(
serializer
.
data
,
status
=
status
.
HTTP_201_CREATED
)
# return Response(serializer.data, status=status.HTTP_201_CREATED)
return
Response
(
data
,
status
=
status
.
HTTP_201_CREATED
)
# return Response(serializer.error_messages,
# return Response(serializer.error_messages,
...
@@ -462,6 +466,7 @@ class GetLectureEmotionReportViewSet(APIView):
...
@@ -462,6 +466,7 @@ class GetLectureEmotionReportViewSet(APIView):
lecture_emotions
=
LectureEmotionReport
.
objects
.
filter
(
lecture_video_id__lecture_video_id
=
lecture_video_id
)
lecture_emotions
=
LectureEmotionReport
.
objects
.
filter
(
lecture_video_id__lecture_video_id
=
lecture_video_id
)
serializer
=
LectureEmotionSerializer
(
lecture_emotions
,
many
=
True
)
serializer
=
LectureEmotionSerializer
(
lecture_emotions
,
many
=
True
)
print
(
'data: '
,
serializer
.
data
)
return
Response
({
return
Response
({
"response"
:
serializer
.
data
,
"response"
:
serializer
.
data
,
...
...
FirstApp/serializers.py
View file @
e3c708cb
...
@@ -275,6 +275,11 @@ class LectureVideoSerializer(serializers.ModelSerializer):
...
@@ -275,6 +275,11 @@ class LectureVideoSerializer(serializers.ModelSerializer):
video_length
=
video_length
video_length
=
video_length
)
)
# retrieve the created object
created_lecture_video
=
LectureVideo
.
objects
.
filter
(
lecture_video_id
=
lecture_video
)
create_lecture_video_ser
=
LectureVideoSerializer
(
created_lecture_video
,
many
=
True
)
create_lecture_video_ser_data
=
create_lecture_video_ser
.
data
# faculty_data = validated_data.pop('faculty')
# faculty_data = validated_data.pop('faculty')
# serialized_faculty = FacultySerializer(data=faculty_data)
# serialized_faculty = FacultySerializer(data=faculty_data)
#
#
...
@@ -294,7 +299,7 @@ class LectureVideoSerializer(serializers.ModelSerializer):
...
@@ -294,7 +299,7 @@ class LectureVideoSerializer(serializers.ModelSerializer):
#
#
# return lecturer
# return lecturer
#
#
return
lecture_video
return
create_lecture_video_ser_data
return
None
return
None
...
...
FirstApp/templates/FirstApp/activity.html
View file @
e3c708cb
This diff is collapsed.
Click to expand it.
FirstApp/templates/FirstApp/emotion.html
View file @
e3c708cb
This diff is collapsed.
Click to expand it.
FirstApp/templates/FirstApp/gaze.html
View file @
e3c708cb
This diff is collapsed.
Click to expand it.
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