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 requests
import json 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 .MongoModels import LectureVideo
from . logic import batch_process as bp from . logic import batch_process as bp
from MonitorLecturerApp.logic import lecturer_batch_process as lbp 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") ...@@ -86,8 +87,13 @@ def automation_process(lecturer, subject, subject_code, video_length="00:20:00")
"lecture_video_length": video_length "lecture_video_length": video_length
} }
# create the lecturer audio # create the lecturer audio content
lecturer_audio_content = {} lecturer_audio_content = {
"lecturer": lecturer,
"subject": subject,
"audio_name": lecturer_audio_name
}
# save the student video # save the student video
...@@ -102,7 +108,8 @@ def automation_process(lecturer, subject, subject_code, video_length="00:20:00") ...@@ -102,7 +108,8 @@ def automation_process(lecturer, subject, subject_code, video_length="00:20:00")
print('lecturer video response: ', lecturer_video_response) print('lecturer video response: ', lecturer_video_response)
# save the lecturer audio # 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): # for i in range(100):
# print('outer loop: ', i) # print('outer loop: ', i)
...@@ -112,24 +119,23 @@ def automation_process(lecturer, subject, subject_code, video_length="00:20:00") ...@@ -112,24 +119,23 @@ def automation_process(lecturer, subject, subject_code, video_length="00:20:00")
# start the batch processing for lecture summarization component # start the batch processing for lecture summarization component
# lecture_summary_batch_process = lecture_summarization_batch_process(audio_name) lecture_summary_batch_process = summarization_batch_process(audio_id, lecturer_audio_name)
lecture_summary_batch_process = True
# if the lecture summarization process is successful # if the lecture summarization process is successful
# if lecture_summary_batch_process: if lecture_summary_batch_process:
#
# # start the batch processing for monitoring lecturer performance component # start the batch processing for monitoring lecturer performance component
# lecturer_batch_process_response = lecturer_batch_process(lecturer_video_name, lecturer_audio_name) lecturer_batch_process_response = lecturer_batch_process(lecturer_video_name, lecturer_audio_name)
#
# # if the lecturer performance process is successful # if the lecturer performance process is successful
# if lecturer_batch_process_response: if lecturer_batch_process_response:
#
# # start the batch processing for monitoring student behavior component # start the batch processing for monitoring student behavior component
# student_batch_process_response = student_behavior_batch_process(student_video_id, student_video_name) student_batch_process_response = student_behavior_batch_process(student_video_id, student_video_name)
#
# # if the student behavior process is successful # if the student behavior process is successful
# if student_batch_process_response: if student_batch_process_response:
# is_all_processed = True is_all_processed = True
# return the status # return the status
......
...@@ -304,13 +304,17 @@ ...@@ -304,13 +304,17 @@
} }
/*
//this is a test function (delete later) //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(() => { 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; let url = 'http://127.0.0.1:8000/check-availability/?video_name=' + due_lecture_video_name;
fetch(url) fetch(url)
...@@ -320,7 +324,6 @@ ...@@ -320,7 +324,6 @@
}, 5000); }, 5000);
//this function will handle the displaying loaders and status in the workflow //this function will handle the displaying loaders and status in the workflow
function displayProcess(response) { function displayProcess(response) {
...@@ -364,8 +367,7 @@ ...@@ -364,8 +367,7 @@
} }
}
*/
}); });
...@@ -450,11 +452,11 @@ ...@@ -450,11 +452,11 @@
<td class="font-weight-bolder">{{ lecture.end_time }}</td> <td class="font-weight-bolder">{{ lecture.end_time }}</td>
<td> <td>
<span class="font-italic text-success" id="processing" hidden>Processing</span> <span class="font-italic text-success" id="processing" hidden>Processing</span>
<button type="button" class="btn btn-success batch_process" {# <button type="button" class="btn btn-success batch_process"#}
data-video-id="{{ lecture.video_id }}" {# data-video-id="{{ lecture.video_id }}"#}
data-video-name="{{ lecture.video_name }}" {# data-video-name="{{ lecture.video_name }}"#}
id="{{ lecture.subject }}">Process {# id="{{ lecture.subject }}">Process#}
</button> {# </button>#}
{# <span class="font-italic font-weight-bolder text-success">Processing</span>#} {# <span class="font-italic font-weight-bolder text-success">Processing</span>#}
</td> </td>
</tr> </tr>
......
...@@ -294,8 +294,11 @@ def video_result(request): ...@@ -294,8 +294,11 @@ def video_result(request):
# due_lecture_video_name = "Test.mp4" # due_lecture_video_name = "Test.mp4"
print('due lecture video name: ', due_lecture_video_name) 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", 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 # 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