Commit 2a68f43b authored by I.K Seneviratne's avatar I.K Seneviratne

Committing the final modifications in video_results.html file and automation_process.py file.

parent fd544989
import requests
import json
from LectureSummarizingApp.lecture_audio_batch_process import save_lecturer_audio, summarization_batch_process
from MonitorLecturerApp.logic.lecturer_batch_process import lecturer_batch_process
from .MongoModels import LectureVideo
from . logic import batch_process as bp
from MonitorLecturerApp.logic import lecturer_batch_process as lbp
......@@ -86,8 +87,13 @@ def automation_process(lecturer, subject, subject_code, video_length="00:20:00")
"lecture_video_length": video_length
}
# create the lecturer audio
lecturer_audio_content = {}
# create the lecturer audio content
lecturer_audio_content = {
"lecturer": lecturer,
"subject": subject,
"audio_name": lecturer_audio_name
}
# save the student video
......@@ -102,7 +108,8 @@ def automation_process(lecturer, subject, subject_code, video_length="00:20:00")
print('lecturer video response: ', lecturer_video_response)
# save the lecturer audio
lecturer_audio_response = save_lecturer_audio(lecturer_audio_content)
audio_id = lecturer_audio_response['audio_id']
# for i in range(100):
# print('outer loop: ', i)
......@@ -112,24 +119,23 @@ def automation_process(lecturer, subject, subject_code, video_length="00:20:00")
# start the batch processing for lecture summarization component
# lecture_summary_batch_process = lecture_summarization_batch_process(audio_name)
lecture_summary_batch_process = True
lecture_summary_batch_process = summarization_batch_process(audio_id, lecturer_audio_name)
# if the lecture summarization process is successful
# if lecture_summary_batch_process:
#
# # start the batch processing for monitoring lecturer performance component
# lecturer_batch_process_response = lecturer_batch_process(lecturer_video_name, lecturer_audio_name)
#
# # if the lecturer performance process is successful
# if lecturer_batch_process_response:
#
# # start the batch processing for monitoring student behavior component
# student_batch_process_response = student_behavior_batch_process(student_video_id, student_video_name)
#
# # if the student behavior process is successful
# if student_batch_process_response:
# is_all_processed = True
if lecture_summary_batch_process:
# start the batch processing for monitoring lecturer performance component
lecturer_batch_process_response = lecturer_batch_process(lecturer_video_name, lecturer_audio_name)
# if the lecturer performance process is successful
if lecturer_batch_process_response:
# start the batch processing for monitoring student behavior component
student_batch_process_response = student_behavior_batch_process(student_video_id, student_video_name)
# if the student behavior process is successful
if student_batch_process_response:
is_all_processed = True
# return the status
......
......@@ -304,13 +304,17 @@
}
/*
//this is a test function (delete later)
//get the due lecture video name
var due_lecture_video_name = "{{ due_lecture_video_name }}";
var isDue = {{ isDue }};
if (isDue > 0) {
let interval = setInterval(() => {
$('#activity_loader').attr('hidden', false);
//get the due lecture video name
var due_lecture_video_name = "{{ due_lecture_video_name }}";
let url = 'http://127.0.0.1:8000/check-availability/?video_name=' + due_lecture_video_name;
fetch(url)
......@@ -320,7 +324,6 @@
}, 5000);
//this function will handle the displaying loaders and status in the workflow
function displayProcess(response) {
......@@ -364,8 +367,7 @@
}
*/
}
});
......@@ -450,11 +452,11 @@
<td class="font-weight-bolder">{{ lecture.end_time }}</td>
<td>
<span class="font-italic text-success" id="processing" hidden>Processing</span>
<button type="button" class="btn btn-success batch_process"
data-video-id="{{ lecture.video_id }}"
data-video-name="{{ lecture.video_name }}"
id="{{ lecture.subject }}">Process
</button>
{# <button type="button" class="btn btn-success batch_process"#}
{# data-video-id="{{ lecture.video_id }}"#}
{# data-video-name="{{ lecture.video_name }}"#}
{# id="{{ lecture.subject }}">Process#}
{# </button>#}
{# <span class="font-italic font-weight-bolder text-success">Processing</span>#}
</td>
</tr>
......
......@@ -294,8 +294,11 @@ def video_result(request):
# due_lecture_video_name = "Test.mp4"
print('due lecture video name: ', due_lecture_video_name)
# check whether there are due lectures or not
isDue = len(due_lecture_list)
return render(request, "FirstApp/video_results.html",
{"lecturer": lecturer, "due_lectures": due_lecture_list, "due_lecture_video_name": due_lecture_video_name})
{"lecturer": lecturer, "due_lectures": due_lecture_list, "due_lecture_video_name": due_lecture_video_name, 'isDue': isDue})
# view for emotion page
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment