Skip to content

Commit 775a545

Browse files
authored
Plugin: Exercise monitoring and mouse focus tracking - refs BT#20900 BT#20901 (#4900)
* Plugin: ExerciseFocused: Add plugin - refs BT#20900 * Plugin: ExerciseFocused: Refactoring variable and setting names - refs BT#20900 * Plugin: ExerciseMonitoring: Add plugin - refs BT#20901 * Plugin: ExerciseMonitoring: Terms popup is not callable - refs BT#20901 * Plugin: ExerciseMonitoring: Remove countdown to snap - refs BT#20901 * Plugin: ExerciseMonitoring: Snap when pressing spacer - refs BT#20901 * Plugin: ExerciseMonitoring: Redirect when ending initial photos - refs BT#20901 * Plugin: ExerciseMonitoring: Differ between exercise one per page or all question per page - refs BT#20901 * Plugin: ExerciseMonitoring: Set snapshot dimension to 640x480 - refs BT#20901 * Plugin: ExerciseFocused: Show warning to alert user before leaving exercise - refs BT#20900 * Plugin: ExerciseMonitoring: Don't show modal when there isn't Start button - refs BT#20901 * Plugin: ExerciseFocused: Block click event - refs BT#20900 * Plugin: ExerciseMonitoring: Fix video responsive - refs BT#20901 * Plugin: ExerciseMonitoring: Add instructions to take snapshots - refs BT#20901 * Plugin: ExerciseFocused: Refactor query for results - refs BT#20901 * Plugin: ExerciseFocused: Add setting to generate random sampling - refs BT#21074 * Plugin: ExerciseFocused: Display motive in report with contextual style - refs BT#21074 * Plugin: ExerciseMonitoring: Show snapshot logs in ExerciseFocused plugin report - refs BT#21074 * Minor: Format code - refs BT#21074 * Plugin: ExerciseFocused: Language variable - refs BT#20900 * Plugin: ExerciseMonitoring: Fix extrafield name - refs BT#20900 * Plugin: ExerciseFocused: Allow to enable time limit by setting - refs BT#20901 * Plugin: ExerciseFocused: Add spanish language - refs BT#20901 * Plugin: ExerciseMonitoring: Add spanish language - refs BT#20900 * Plugin: ExerciseMonitoring: Add placeholders to camera - refs BT#20901 * Plugin: ExerciseMonitoring: Refactor to show link in plugin Exercise Focused - refs BT#20901 * Plugin: ExerciseMonitoring: Fix lang var - refs BT#20901 * Plugin: ExerciseMonitoring: Fix irregular grid - refs BT#20901 * Plugin: ExerciseFocused: Allow save level in log - refs BT#20900 * Plugin: ExerciseFocused: Allow export for exercise with one question per page - refs BT#21074 * Plugin: ExerciseFocused: ExerciseMonitoring: Fix lang variables - refs BT#20900 BT#20901 * Plugin: ExerciseFocused: Fix report when there is no exercise attempts in course - refs BT#21074 * Plugin: ExerciseFocused: Include snapshots column from ExerciseMonitoring plugin in report - refs BT#21074 * Minor: Format code - refs BT#21074 * Plugin: ExerciseFocused: Simplify conditions with exercise type - refs BT#20900 * Plugin: ExerciseFocused: ExerciseMonitoring: Use new term to level + improve warning message - refs BT#21074 * Plugin: ExerciseMonitoring: set genera column to level in report - refs BT#21074 * Plugin: ExerciseMonitoring: ExerciseFocused: Change language vars - refs BT#21074 * Plugin: ExerciseMonitoring: ExerciseFocused: unify header in modals - BT#21074 * Plugin: ExerciseMonitoring: ExerciseFocused: use Student term instead of Learner - BT#21074 * Plugin: ExerciseFocused: Display level reached in detail - BT#21074 * Plugin: ExerciseMonitoring: Move code to function - BT#21074 * Plugin: ExerciseFocused: Change language variable - refs BT#21074 * Plugin: ExerciseFocused: Change language variables - refs BT#21074 * Plugin: ExerciseFocused: Add columns about session/course in admin report - refs BT#21074 * Plugin: ExerciseFocused: Fix language vars in report - refs BT#21074 * Plugin: ExerciseFocused: Add IP report exported + fix lang var - refs BT#21074 * Plugin: ExerciseMonitoring: Add option to set instructions with age distinction - refs BT#21179 * Plugin: ExerciseMonitoring: Move code to function - refs BT#20901 * Plugin: ExerciseMonitoring: Fix ID and user snapshots without track_e_exercise.id - refs BT#20901 * Plugin: ExerciseFocused: Separate the column full name in two columns + separate username row in report - refs BT#21074 * Plugin: ExerciseFocused: Search form has optional fields - refs BT#21074 * Plugin: ExerciseMonitoring: Show the birthdate and legal age in report - refs BT#21074 * Minor: Add missing webcam.png icon with size small - refs BT#21074 * Plugin: ExerciseFocused: Fix detail for admin report - refs BT#21074 * Plugin: ExerciseMonitoring: Add setting and cron job to delete snapshots taken - refs BT#21074 * Minor: Plugin: ExerciseFocused: Delay backdrop - refs BT#21074 * Minor: Plugin: ExerciseFocused: change message for window/tab title - refs BT#21074 * Plugin: ExerciseFocused: Keep message visibility after refocusing - refs BT#20901 * Plugin: ExerciseFocused: Fix filter by session extra fields - refs BT#21074 * Plugin: ExerciseFocused: Fix report by session extra fields - refs BT#21074 * Plugin: ExerciseMonitoring: Make the live camera floating - refs BT#20901 * Plugin: ExerciseFocused: Make the alert message floating - refs BT#20901 * Plugin: ExerciseFocused: Change lang var for motive - refs BT#21074 * Plugin: ExerciseFocused: Increase delay time to hide messages - refs BT#20900 * Plugin: ExerciseMonitoring: Improve image placeholders for id card and student - refs BT#20901 * Plugin: ExerciseMonitoring: Improve image placeholders for id card - refs BT#20901 * Minor: Plugin: ExerciseFocused: Fix lang var - refs BT#20901 * Plugin: ExerciseFocused: Fix random results - refs BT#21074 * Plugin: ExerciseFocused: Fix session filter - refs BT#21074 * Plugin: ExerciseFocused: Allow multiple match in firstname and lastname filters - refs BT#21074 * Plugin: ExerciseFocused: Round number of random results - refs BT#21074 * Plugin: ExerciseFocused: Add button to reset search - refs BT#21074 * Minor: Format code
1 parent 3e2582f commit 775a545

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+3473
-0
lines changed

main/exercise/exercise_report.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,8 @@
500500
'comparative_group_report.php?'.api_get_cidreq().'&id='.$exercise_id,
501501
['class' => 'btn btn-default']
502502
);
503+
504+
$actions .= ExerciseFocusedPlugin::create()->getLinkReporting($exercise_id);
503505
}
504506
} else {
505507
$actions .= '<a href="exercise.php">'.

main/img/icons/22/webcam_na.png

5.12 KB
Loading

plugin/exercisefocused/admin.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
/* For licensing terms, see /license.txt */
4+
5+
use Chamilo\PluginBundle\ExerciseFocused\Controller\AdminController;
6+
use Chamilo\PluginBundle\ExerciseFocused\Entity\Log;
7+
use Symfony\Component\HttpFoundation\Request as HttpRequest;
8+
use Symfony\Component\HttpFoundation\Response as HttpResponse;
9+
10+
$cidReset = true;
11+
12+
require_once __DIR__.'/../../main/inc/global.inc.php';
13+
14+
api_protect_admin_script();
15+
16+
$em = Database::getManager();
17+
$logRepository = $em->getRepository(Log::class);
18+
19+
$reportingController = new AdminController(
20+
ExerciseFocusedPlugin::create(),
21+
HttpRequest::createFromGlobals(),
22+
$em,
23+
$logRepository
24+
);
25+
26+
try {
27+
$response = $reportingController();
28+
} catch (Exception $e) {
29+
$response = HttpResponse::create('', HttpResponse::HTTP_FORBIDDEN);
30+
}
31+
32+
$response->send();

plugin/exercisefocused/index.php

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
/* For licensing terms, see /license.txt */
4+
5+
use Chamilo\CoreBundle\Entity\TrackEExercises;
6+
use Chamilo\PluginBundle\ExerciseFocused\Entity\Log;
7+
8+
$plugin = ExerciseFocusedPlugin::create();
9+
10+
$exerciseId = (int) ($_GET['exerciseId'] ?? 0);
11+
12+
$renderRegion = $plugin->isEnableForExercise($exerciseId);
13+
14+
if ($renderRegion) {
15+
$_template['show_region'] = true;
16+
17+
$em = Database::getManager();
18+
19+
$existingExeId = (int) ChamiloSession::read('exe_id');
20+
$trackingExercise = null;
21+
22+
if ($existingExeId) {
23+
$trackingExercise = $em->find(TrackEExercises::class, $existingExeId);
24+
}
25+
26+
$_template['sec_token'] = Security::get_token('exercisefocused');
27+
28+
if ('true' === $plugin->get(ExerciseFocusedPlugin::SETTING_ENABLE_OUTFOCUSED_LIMIT)) {
29+
$logRepository = $em->getRepository(Log::class);
30+
31+
if ($trackingExercise) {
32+
$countOutfocused = $logRepository->countByActionInExe($trackingExercise, Log::TYPE_OUTFOCUSED);
33+
} else {
34+
$countOutfocused = 0;
35+
}
36+
37+
$_template['count_outfocused'] = $countOutfocused;
38+
$_template['remaining_outfocused'] = (int) $plugin->get(ExerciseFocusedPlugin::SETTING_OUTFOCUSED_LIMIT) - $countOutfocused;
39+
}
40+
41+
if ($trackingExercise) {
42+
$exercise = new Exercise($trackingExercise->getCId());
43+
44+
if ($exercise->read($trackingExercise->getExeExoId())) {
45+
$_template['exercise_type'] = (int) $exercise->selectType();
46+
}
47+
}
48+
}

plugin/exercisefocused/install.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
/* For licensing terms, see /license.txt */
4+
5+
ExerciseFocusedPlugin::create()->install();
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
/* For licensing terms, see /license.txt */
4+
5+
$strings['plugin_title'] = "Exercise Focused";
6+
$strings['plugin_comment'] = "Show a message to return to the exercise when the user exits the Chamilo window/tab.";
7+
8+
$strings['tool_enable'] = "Enable tool";
9+
$strings['enable_time_limit'] = 'Enable time limit';
10+
$strings['time_limit'] = "Limit time";
11+
$strings['time_limit_help'] = "Limit time (in seconds) to return to the exercise. After this time the exercise will be closed.";
12+
$strings['enable_outfocused_limit'] = "Enable maximum of outfocused";
13+
$strings['outfocused_limit'] = "Maximum number of outfocused allowed";
14+
$strings['outfocused_limit_help'] = "Number of outfocused allowed. After this limit the exercise will be closed.";
15+
$strings['session_field_filters'] = "Session field as filter";
16+
$strings['session_field_filters_help'] = "Extra field names separeted by a comma.";
17+
$strings['percentage_sampling'] = "Percentage of sampling attempts";
18+
$strings['percentage_sampling_help'] = "A percentage of attempts will be selected for random review";
19+
20+
$strings['ReportByAttempts'] = "Exercise focused: Report by attempts";
21+
$strings['YouHaveLeftTheExercise'] = "Careful! We detect that you have left the exam window.<br><br>You must return and complete it.";
22+
$strings['YouHaveXTimeToReturn'] = "You have <span class=\"h3 text-danger\" id=\"time-limit-target\">%s</span> seconds to return";
23+
$strings['YouAreAllowedXOutfocused'] = "You are allowed <span class=\"h3 text-danger\" id=\"outfocused-limit-target\">%d</span> outfocused";
24+
$strings['OutfocusedLimitExceeded'] = "You have exceeded the allowed limit of outfocused";
25+
$strings['SelectExercise'] = "Select exercise";
26+
$strings['UnselectExercise'] = "Unselect exercise";
27+
$strings['Returns'] = "Returns";
28+
$strings['MaxOutfocusedReached'] = "Max outfocused reached";
29+
$strings['TimeLimitReached'] = "Time limit reached";
30+
$strings['Outfocused'] = "Outfocused";
31+
$strings['Return'] = "Return";
32+
$strings['Motive'] = "Motive";
33+
$strings['AlertBeforeLeaving'] = "Please stay within the exam";
34+
$strings['RandomSampling'] = "Random sampling";
35+
$strings['WindowTitleOutfocused'] = '🚨 Stay within the exam!';
36+
$strings['LevelReached'] = 'Level reached';
37+
$strings['ExerciseStartDateAndTime'] = "Exercise start date and time";
38+
$strings['ExerciseEndDateAndTime'] = "Exercise end date and time";
39+
$strings['MotiveExerciseFinished'] = "Successfully completed the exam";
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
/* For licensing terms, see /license.txt */
4+
5+
$strings['plugin_title'] = "Enfoque en el Ejercicio";
6+
$strings['plugin_comment'] = "Mostrar un mensaje para regresar al ejercicio cuando el usuario sale de la ventana/pestaña de Chamilo.";
7+
8+
$strings['tool_enable'] = "Habilitar herramienta";
9+
$strings['enable_time_limit'] = 'Habilitar límite de tiempo';
10+
$strings['time_limit'] = "Límite de tiempo";
11+
$strings['time_limit_help'] = "Límite el tiempo (en segundos) para regresar al ejercicio. Pasado este tiempo, el ejercicio se cerrará.";
12+
$strings['enable_outfocused_limit'] = "Habilitar el máximo de desenfoque";
13+
$strings['outfocused_limit'] = "Número máximo de desenfoques permitidos";
14+
$strings['outfocused_limit_help'] = "Número de desenfoques permitidos. Después de este límite, el ejercicio se cerrará.";
15+
$strings['session_field_filters'] = "Campo de sesión como filtro";
16+
$strings['session_field_filters_help'] = "Nombres de campos adicionales separados por comas.";
17+
$strings['percentage_sampling'] = "Porcentaje de intentos de muestreo";
18+
$strings['percentage_sampling_help'] = "Se seleccionará un porcentaje de intentos para una revisión aleatoria";
19+
20+
$strings['ReportByAttempts'] = "Enfoque en el Ejercicio: Informe por intentos";
21+
$strings['YouHaveLeftTheExercise'] = "¡Cuidado! Detectamos que has abandonado la ventana del examen.<br><br>Debes retornar y culminarlo.";
22+
$strings['YouHaveXTimeToReturn'] = "Tienes <span class=\"h3 text-danger\" id=\"time-limit-target\">%s</span> segundos para regresar";
23+
$strings['YouAreAllowedXOutfocused'] = "Se te permite <span class=\"h3 text-danger\" id=\"outfocused-limit-target\">%d</span> desenfoques";
24+
$strings['OutfocusedLimitExceeded'] = "Has excedido el límite permitido de desenfoques";
25+
$strings['SelectExercise'] = "Seleccionar ejercicio";
26+
$strings['UnselectExercise'] = "Deseleccionar ejercicio";
27+
$strings['Returns'] = "Regresos";
28+
$strings['MaxOutfocusedReached'] = "Se ha alcanzado el máximo de desenfoques";
29+
$strings['TimeLimitReached'] = "Se ha alcanzado el límite de tiempo";
30+
$strings['Outfocused'] = "Desenfoques";
31+
$strings['Return'] = "Regresos";
32+
$strings['Motive'] = "Motivo";
33+
$strings['AlertBeforeLeaving'] = "Por favor, mantente dentro del examen.";
34+
$strings['RandomSampling'] = "Muestreo Aleatorio";
35+
$strings['WindowTitleOutfocused'] = '🚨 Retorna y culmina tu examen';
36+
$strings['LevelReached'] = 'Nivel alcanzado';
37+
$strings['ExerciseStartDateAndTime'] = "Fecha y hora de inicio del ejercicio";
38+
$strings['ExerciseEndDateAndTime'] = "Fecha y hora de finalización del ejercicio";
39+
$strings['MotiveExerciseFinished'] = "Culminó exitosamente el examen";
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
/* For licensing terms, see /license.txt */
4+
5+
use Chamilo\PluginBundle\ExerciseFocused\Controller\DetailController;
6+
use Chamilo\PluginBundle\ExerciseFocused\Entity\Log;
7+
use Symfony\Component\HttpFoundation\Request as HttpRequest;
8+
use Symfony\Component\HttpFoundation\Response as HttpResponse;
9+
10+
require_once __DIR__.'/../../../main/inc/global.inc.php';
11+
12+
if (!api_is_allowed_to_edit()) {
13+
api_not_allowed(true);
14+
}
15+
16+
$em = Database::getManager();
17+
$logRepository = $em->getRepository(Log::class);
18+
19+
$detailController = new DetailController(
20+
ExerciseFocusedPlugin::create(),
21+
HttpRequest::createFromGlobals(),
22+
$em,
23+
$logRepository
24+
);
25+
26+
try {
27+
$response = $detailController();
28+
} catch (Exception $e) {
29+
$response = HttpResponse::create('', HttpResponse::HTTP_FORBIDDEN);
30+
}
31+
32+
$response->send();

0 commit comments

Comments
 (0)