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
5b1ec409
Commit
5b1ec409
authored
Oct 04, 2020
by
SohanDanushka
Committed by
I.K Seneviratne
Oct 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db changes verifying in lecturer video
parent
006dc258
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
20 deletions
+27
-20
MonitorLecturerApp/serializers.py
MonitorLecturerApp/serializers.py
+9
-8
MonitorLecturerApp/templates/MonitorLecturerApp/index.html
MonitorLecturerApp/templates/MonitorLecturerApp/index.html
+10
-6
MonitorLecturerApp/views.py
MonitorLecturerApp/views.py
+8
-6
No files found.
MonitorLecturerApp/serializers.py
View file @
5b1ec409
...
...
@@ -17,14 +17,6 @@ class LecturerVideoSerializer(serializers.ModelSerializer):
model
=
LecturerVideo
fields
=
'__all__'
class
LecturerVideoMetaDataSerializer
(
serializers
.
ModelSerializer
):
lecturer_video_id
=
LectureRecordedVideo
()
class
Meta
:
model
=
LecturerVideoMetaData
fields
=
'__all__'
class
LecturerAudioTextSerializer
(
serializers
.
ModelSerializer
):
...
...
@@ -43,3 +35,12 @@ class LectureRecordedVideoSerializer(serializers.ModelSerializer):
class
Meta
:
model
=
LectureRecordedVideo
fields
=
'__all__'
class
LecturerVideoMetaDataSerializer
(
serializers
.
ModelSerializer
):
lecturer_video_id
=
LectureRecordedVideoSerializer
()
class
Meta
:
model
=
LecturerVideoMetaData
fields
=
'__all__'
\ No newline at end of file
MonitorLecturerApp/templates/MonitorLecturerApp/index.html
View file @
5b1ec409
...
...
@@ -39,7 +39,7 @@
var
lecture_audio_text_summary
=
{};
$
(
document
).
ready
(
function
()
{
$
(
'
.calc
'
).
click
(
function
()
{
$
(
'
.calc
'
).
click
(
function
(
e
)
{
let
video_name
=
$
(
this
).
attr
(
'
data-name
'
);
$
(
'
#no_content_message
'
).
attr
(
'
hidden
'
,
true
);
...
...
@@ -53,7 +53,7 @@
//fetching data from the API
fetch
(
'
http://127.0.0.1:8000/lecturer/activities/?video_name=
'
+
video_name
)
.
then
((
res
)
=>
res
.
json
())
.
then
((
out
)
=>
assignPerct
(
out
.
response
))
.
then
((
out
)
=>
assignPerct
(
out
.
response
,
e
))
.
catch
((
error
)
=>
alert
(
'
error
'
+
error
));
...
...
@@ -62,10 +62,9 @@
//this function will handle the lecturer video results button
$
(
'
.results
'
).
click
(
function
()
{
$
(
'
.results
'
).
click
(
function
(
e
)
{
let
video_id
=
$
(
this
).
attr
(
'
data-id
'
);
$
(
'
#no_content_message
'
).
attr
(
'
hidden
'
,
true
);
$
(
'
#video_loader
'
).
attr
(
'
hidden
'
,
false
);
...
...
@@ -73,7 +72,7 @@
//fetch the results
fetch
(
'
http://127.0.0.1:8000/lecturer/get-lecturer-video-results/?video_id=
'
+
video_id
)
.
then
((
res
)
=>
res
.
json
())
.
then
((
out
)
=>
assignPerct
(
out
.
response
))
.
then
((
out
)
=>
assignPerct
(
out
.
response
,
e
))
.
catch
((
err
)
=>
alert
(
'
error:
'
+
err
))
});
...
...
@@ -81,11 +80,16 @@
//to assign percentage values
function
assignPerct
(
percentages
)
{
function
assignPerct
(
percentages
,
e
)
{
$
(
'
#no_content_message
'
).
attr
(
'
hidden
'
,
true
);
$
(
'
#progress_bars
'
).
attr
(
'
hidden
'
,
false
);
$
(
'
#loader
'
).
attr
(
'
hidden
'
,
true
);
//display the 'results' button
{
#
e
.
target
.
parentNode
.
innerHTML
=
"
<span class='font-italic bg-success'>Processed</span>
"
;
#
}
{
#
alert
(
"
Result button error
"
);
#
}
{
#
let
sitting
=
Math
.
round
(
percentages
.
sitting_perct
);
#
}
let
sitting
=
Math
.
round
(
percentages
.
sitting_perct
);
...
...
MonitorLecturerApp/views.py
View file @
5b1ec409
...
...
@@ -71,9 +71,9 @@ def hello(request):
lec_list
.
sort
(
key
=
lambda
date
:
dt
.
strptime
(
str
(
date
[
'date'
]),
"
%
Y-
%
m-
%
d"
),
reverse
=
True
)
# retrieve exsiting lecture recorded videos
lec_
recorded_video
=
LectureRecordedVideo
.
objects
.
all
()
lec_
recorded_video_ser
=
LectureRecordedVideoSerializer
(
lec_recorded_video
,
many
=
True
)
lec_
recorded_video_data
=
lec_recorded_video
_ser
.
data
lec_
video_meta
=
LecturerVideoMetaData
.
objects
.
all
()
lec_
video_meta_ser
=
LecturerVideoMetaDataSerializer
(
lec_video_meta
,
many
=
True
)
lec_
video_meta_data
=
lec_video_meta
_ser
.
data
for
videoPath
in
videoPaths
:
video
=
LecturerVideo
()
...
...
@@ -92,11 +92,13 @@ def hello(request):
video
[
'video_id'
]
=
None
# checking whether this video already exists
for
recorded_lecture
in
lec_
recorded_video
_data
:
for
recorded_lecture
in
lec_
video_meta
_data
:
if
videoName
==
recorded_lecture
[
'lecture_video_name'
]:
print
(
'recorded lecture: '
,
recorded_lecture
)
if
videoName
==
recorded_lecture
[
'lecturer_video_id'
][
'lecture_video_name'
]:
video
[
'isAvailable'
]
=
True
video
[
'video_id'
]
=
recorded_lecture
[
'id'
]
video
[
'video_id'
]
=
recorded_lecture
[
'
lecturer_video_id'
][
'
id'
]
videos
.
append
(
video
)
...
...
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