-
Notifications
You must be signed in to change notification settings - Fork 492
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '1.11.x' of github.com:chamilo/chamilo-lms into 1.11.x
- Loading branch information
Showing
49 changed files
with
3,482 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
/* For licensing terms, see /license.txt */ | ||
|
||
use Chamilo\PluginBundle\ExerciseFocused\Controller\AdminController; | ||
use Chamilo\PluginBundle\ExerciseFocused\Entity\Log; | ||
use Symfony\Component\HttpFoundation\Request as HttpRequest; | ||
use Symfony\Component\HttpFoundation\Response as HttpResponse; | ||
|
||
$cidReset = true; | ||
|
||
require_once __DIR__.'/../../main/inc/global.inc.php'; | ||
|
||
api_protect_admin_script(); | ||
|
||
$em = Database::getManager(); | ||
$logRepository = $em->getRepository(Log::class); | ||
|
||
$reportingController = new AdminController( | ||
ExerciseFocusedPlugin::create(), | ||
HttpRequest::createFromGlobals(), | ||
$em, | ||
$logRepository | ||
); | ||
|
||
try { | ||
$response = $reportingController(); | ||
} catch (Exception $e) { | ||
$response = HttpResponse::create('', HttpResponse::HTTP_FORBIDDEN); | ||
} | ||
|
||
$response->send(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
/* For licensing terms, see /license.txt */ | ||
|
||
use Chamilo\CoreBundle\Entity\TrackEExercises; | ||
use Chamilo\PluginBundle\ExerciseFocused\Entity\Log; | ||
|
||
$plugin = ExerciseFocusedPlugin::create(); | ||
|
||
$exerciseId = (int) ($_GET['exerciseId'] ?? 0); | ||
|
||
$renderRegion = $plugin->isEnableForExercise($exerciseId); | ||
|
||
if ($renderRegion) { | ||
$_template['show_region'] = true; | ||
|
||
$em = Database::getManager(); | ||
|
||
$existingExeId = (int) ChamiloSession::read('exe_id'); | ||
$trackingExercise = null; | ||
|
||
if ($existingExeId) { | ||
$trackingExercise = $em->find(TrackEExercises::class, $existingExeId); | ||
} | ||
|
||
$_template['sec_token'] = Security::get_token('exercisefocused'); | ||
|
||
if ('true' === $plugin->get(ExerciseFocusedPlugin::SETTING_ENABLE_OUTFOCUSED_LIMIT)) { | ||
$logRepository = $em->getRepository(Log::class); | ||
|
||
if ($trackingExercise) { | ||
$countOutfocused = $logRepository->countByActionInExe($trackingExercise, Log::TYPE_OUTFOCUSED); | ||
} else { | ||
$countOutfocused = 0; | ||
} | ||
|
||
$_template['count_outfocused'] = $countOutfocused; | ||
$_template['remaining_outfocused'] = (int) $plugin->get(ExerciseFocusedPlugin::SETTING_OUTFOCUSED_LIMIT) - $countOutfocused; | ||
} | ||
|
||
if ($trackingExercise) { | ||
$exercise = new Exercise($trackingExercise->getCId()); | ||
|
||
if ($exercise->read($trackingExercise->getExeExoId())) { | ||
$_template['exercise_type'] = (int) $exercise->selectType(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
|
||
/* For licensing terms, see /license.txt */ | ||
|
||
ExerciseFocusedPlugin::create()->install(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
/* For licensing terms, see /license.txt */ | ||
|
||
$strings['plugin_title'] = "Exercise Focused"; | ||
$strings['plugin_comment'] = "Show a message to return to the exercise when the user exits the Chamilo window/tab."; | ||
|
||
$strings['tool_enable'] = "Enable tool"; | ||
$strings['enable_time_limit'] = 'Enable time limit'; | ||
$strings['time_limit'] = "Limit time"; | ||
$strings['time_limit_help'] = "Limit time (in seconds) to return to the exercise. After this time the exercise will be closed."; | ||
$strings['enable_outfocused_limit'] = "Enable maximum of outfocused"; | ||
$strings['outfocused_limit'] = "Maximum number of outfocused allowed"; | ||
$strings['outfocused_limit_help'] = "Number of outfocused allowed. After this limit the exercise will be closed."; | ||
$strings['session_field_filters'] = "Session field as filter"; | ||
$strings['session_field_filters_help'] = "Extra field names separeted by a comma."; | ||
$strings['percentage_sampling'] = "Percentage of sampling attempts"; | ||
$strings['percentage_sampling_help'] = "A percentage of attempts will be selected for random review"; | ||
|
||
$strings['ReportByAttempts'] = "Exercise focused: Report by attempts"; | ||
$strings['YouHaveLeftTheExercise'] = "Careful! We detect that you have left the exam window.<br><br>You must return and complete it."; | ||
$strings['YouHaveXTimeToReturn'] = "You have <span class=\"h3 text-danger\" id=\"time-limit-target\">%s</span> seconds to return"; | ||
$strings['YouAreAllowedXOutfocused'] = "You are allowed <span class=\"h3 text-danger\" id=\"outfocused-limit-target\">%d</span> outfocused"; | ||
$strings['OutfocusedLimitExceeded'] = "You have exceeded the allowed limit of outfocused"; | ||
$strings['SelectExercise'] = "Select exercise"; | ||
$strings['UnselectExercise'] = "Unselect exercise"; | ||
$strings['Returns'] = "Returns"; | ||
$strings['MaxOutfocusedReached'] = "Max outfocused reached"; | ||
$strings['TimeLimitReached'] = "Time limit reached"; | ||
$strings['Outfocused'] = "Outfocused"; | ||
$strings['Return'] = "Return"; | ||
$strings['Motive'] = "Motive"; | ||
$strings['AlertBeforeLeaving'] = "Please stay within the exam"; | ||
$strings['RandomSampling'] = "Random sampling"; | ||
$strings['WindowTitleOutfocused'] = '🚨 Stay within the exam!'; | ||
$strings['LevelReached'] = 'Level reached'; | ||
$strings['ExerciseStartDateAndTime'] = "Exercise start date and time"; | ||
$strings['ExerciseEndDateAndTime'] = "Exercise end date and time"; | ||
$strings['MotiveExerciseFinished'] = "Successfully completed the exam"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
/* For licensing terms, see /license.txt */ | ||
|
||
$strings['plugin_title'] = "Enfoque en el Ejercicio"; | ||
$strings['plugin_comment'] = "Mostrar un mensaje para regresar al ejercicio cuando el usuario sale de la ventana/pestaña de Chamilo."; | ||
|
||
$strings['tool_enable'] = "Habilitar herramienta"; | ||
$strings['enable_time_limit'] = 'Habilitar límite de tiempo'; | ||
$strings['time_limit'] = "Límite de tiempo"; | ||
$strings['time_limit_help'] = "Límite el tiempo (en segundos) para regresar al ejercicio. Pasado este tiempo, el ejercicio se cerrará."; | ||
$strings['enable_outfocused_limit'] = "Habilitar el máximo de desenfoque"; | ||
$strings['outfocused_limit'] = "Número máximo de desenfoques permitidos"; | ||
$strings['outfocused_limit_help'] = "Número de desenfoques permitidos. Después de este límite, el ejercicio se cerrará."; | ||
$strings['session_field_filters'] = "Campo de sesión como filtro"; | ||
$strings['session_field_filters_help'] = "Nombres de campos adicionales separados por comas."; | ||
$strings['percentage_sampling'] = "Porcentaje de intentos de muestreo"; | ||
$strings['percentage_sampling_help'] = "Se seleccionará un porcentaje de intentos para una revisión aleatoria"; | ||
|
||
$strings['ReportByAttempts'] = "Enfoque en el Ejercicio: Informe por intentos"; | ||
$strings['YouHaveLeftTheExercise'] = "¡Cuidado! Detectamos que has abandonado la ventana del examen.<br><br>Debes retornar y culminarlo."; | ||
$strings['YouHaveXTimeToReturn'] = "Tienes <span class=\"h3 text-danger\" id=\"time-limit-target\">%s</span> segundos para regresar"; | ||
$strings['YouAreAllowedXOutfocused'] = "Se te permite <span class=\"h3 text-danger\" id=\"outfocused-limit-target\">%d</span> desenfoques"; | ||
$strings['OutfocusedLimitExceeded'] = "Has excedido el límite permitido de desenfoques"; | ||
$strings['SelectExercise'] = "Seleccionar ejercicio"; | ||
$strings['UnselectExercise'] = "Deseleccionar ejercicio"; | ||
$strings['Returns'] = "Regresos"; | ||
$strings['MaxOutfocusedReached'] = "Se ha alcanzado el máximo de desenfoques"; | ||
$strings['TimeLimitReached'] = "Se ha alcanzado el límite de tiempo"; | ||
$strings['Outfocused'] = "Desenfoques"; | ||
$strings['Return'] = "Regresos"; | ||
$strings['Motive'] = "Motivo"; | ||
$strings['AlertBeforeLeaving'] = "Por favor, mantente dentro del examen."; | ||
$strings['RandomSampling'] = "Muestreo Aleatorio"; | ||
$strings['WindowTitleOutfocused'] = '🚨 Retorna y culmina tu examen'; | ||
$strings['LevelReached'] = 'Nivel alcanzado'; | ||
$strings['ExerciseStartDateAndTime'] = "Fecha y hora de inicio del ejercicio"; | ||
$strings['ExerciseEndDateAndTime'] = "Fecha y hora de finalización del ejercicio"; | ||
$strings['MotiveExerciseFinished'] = "Culminó exitosamente el examen"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
/* For licensing terms, see /license.txt */ | ||
|
||
use Chamilo\PluginBundle\ExerciseFocused\Controller\DetailController; | ||
use Chamilo\PluginBundle\ExerciseFocused\Entity\Log; | ||
use Symfony\Component\HttpFoundation\Request as HttpRequest; | ||
use Symfony\Component\HttpFoundation\Response as HttpResponse; | ||
|
||
require_once __DIR__.'/../../../main/inc/global.inc.php'; | ||
|
||
if (!api_is_allowed_to_edit()) { | ||
api_not_allowed(true); | ||
} | ||
|
||
$em = Database::getManager(); | ||
$logRepository = $em->getRepository(Log::class); | ||
|
||
$detailController = new DetailController( | ||
ExerciseFocusedPlugin::create(), | ||
HttpRequest::createFromGlobals(), | ||
$em, | ||
$logRepository | ||
); | ||
|
||
try { | ||
$response = $detailController(); | ||
} catch (Exception $e) { | ||
$response = HttpResponse::create('', HttpResponse::HTTP_FORBIDDEN); | ||
} | ||
|
||
$response->send(); |
Oops, something went wrong.