Skip to content

Commit

Permalink
Plugin: ExerciseMonitoring: Add instructions to take snapshots - refs…
Browse files Browse the repository at this point in the history
… BT#20901
  • Loading branch information
AngelFQC committed Oct 3, 2023
1 parent 83cd805 commit 50dc5f8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
5 changes: 4 additions & 1 deletion plugin/exercisemonitoring/lang/english.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@

$strings['ExerciseMonitored'] = "Exercise monitored";
$strings['Retry'] = "Retry";
$strings['IdDocumentSnapshot'] = "Snapshot of the ID document";
$strings['IdDocumentSnapshot'] = "Snapshot of the ID or identification document";
$strings['LearnerSnapshot'] = "Snapshot of the student";

$strings['ImageIdDocumentCameraInstructions'] = "Show / Place / Situate / Put / Accommodate / Approximate your ID or identification document in front of the camera. Once you see the photo inside the screen box, press the Snapshot button or space bar on your keyboard";
$strings['ImageLearnerCameraInstructions'] = 'Show / Place / Situate / Put / Accommodate / Approximate your face in front of the camera. Once you see the photo inside the screen box, press the Snapshot button or space bar on your keyboard';
23 changes: 19 additions & 4 deletions plugin/exercisemonitoring/templates/modal.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,27 @@
</div>

<div class="modal-body text-center" id="em-camera-body" style="display: none;">
<p id="txt-iddoc-img-instructions" class="lead" style="display: block;">
{{ 'ImageIdDocumentCameraInstructions'|get_plugin_lang('ExerciseMonitoringPlugin') }}
</p>
<p id="txt-learner-img-instructions" class="lead" style="display: none;">
{{ 'ImageLearnerCameraInstructions'|get_plugin_lang('ExerciseMonitoringPlugin') }}
</p>
<div id="monitoring-camera" class="embed-responsive embed-responsive-4by3"></div>
<p id="countdown"></p>
<br>
<button class="btn btn-default" type="button" id="btn-snap" disabled>
<span class="fa fa-camera" aria-hidden="true"></span>
{{ 'Snapshot'|get_lang }}
</button>
</div>

<div class="modal-body text-center" id="em-iddoc-body" style="display: none;">
<p><b>{{ 'IdDocumentSnapshot'|get_plugin_lang('ExerciseMonitoringPlugin') }}</b></p>
<p class="lead">{{ 'IdDocumentSnapshot'|get_plugin_lang('ExerciseMonitoringPlugin') }}</p>
<div id="img-iddoc"></div>
</div>

<div class="modal-body text-center" id="em-student-body" style="display: none;">
<p><b>{{ 'LearnerSnapshot'|get_plugin_lang('ExerciseMonitoringPlugin') }}</b></p>
<p class="lead">{{ 'LearnerSnapshot'|get_plugin_lang('ExerciseMonitoringPlugin') }}</p>
<div id="img-learner"></div>
</div>

Expand Down Expand Up @@ -76,6 +82,9 @@
var $imgIdDoc = $('#img-iddoc');
var $imgLearner = $('#img-learner');
var $txtIdDocInstructions = $('#txt-iddoc-img-instructions');
var $txtLearnerInstructions = $('#txt-learner-img-instructions');
var hasIdDoc = false;
var hasLearner = false;
Expand Down Expand Up @@ -103,6 +112,9 @@
});
Webcam.attach('#monitoring-camera');
Webcam.on('live', function () {
$txtIdDocInstructions.show();
$txtLearnerInstructions.hide();
$btnSnap.prop({disabled: false}).focus();
$('#monitoring-camera video').addClass('embed-responsive-item');
});
Expand Down Expand Up @@ -153,6 +165,9 @@
$bodyIdDoc.hide();
$bodyCamera.show();
$txtIdDocInstructions.hide();
$txtLearnerInstructions.show();
$btnSnap.prop({disabled: false}).focus();
} else if (hasIdDoc && hasLearner) {
$btnNext.prop({disabled: true});
Expand Down Expand Up @@ -183,7 +198,7 @@
Webcam.snap(function (dataUri) {
var $imgSnapshot = $('<img>')
.prop({src: dataUri, id: 'img-iddoc'})
.prop({src: dataUri, id: 'img-snapshot'})
.addClass('img-responsive');
if (!hasIdDoc && !hasLearner) {
Expand Down

0 comments on commit 50dc5f8

Please sign in to comment.