Exercises: Add hide category table option BT#18095

pull/3673/head
Julio Montoya 5 years ago
parent 581308d983
commit 9ee96d1dd2
  1. 10
      main/exercise/TestCategory.php
  2. 14
      main/exercise/exercise.class.php
  3. 4
      main/exercise/exercise_admin.php
  4. 2
      main/inc/lib/extra_field_value.lib.php
  5. 7
      main/lang/english/trad4all.inc.php
  6. 8
      main/lang/french/trad4all.inc.php
  7. 8
      main/lang/spanish/trad4all.inc.php

@ -757,10 +757,16 @@ class TestCategory
*/
public static function get_stats_table_by_attempt($exercise, $category_list = [])
{
$exerciseId = $exercise->iId;
if (empty($category_list)) {
if (empty($category_list) || empty($exercise)) {
return null;
}
$hide = (int) $exercise->getPageConfigurationAttribute('hide_category_table');
if (1 === $hide) {
return null;
}
$exerciseId = $exercise->iId;
$categoryNameList = self::getListOfCategoriesNameForTest($exerciseId);
$table = new HTML_Table(
[

@ -2198,6 +2198,12 @@ class Exercise
null,
get_lang('HideQuestionScore')
),
$form->createElement(
'checkbox',
'hide_category_table',
null,
get_lang('HideCategoryTable')
),
];
$form->addGroup($group, null, get_lang('ResultsConfigurationPage'));
}
@ -8288,8 +8294,6 @@ class Exercise
/**
* @param array $values
*
* @throws \Doctrine\DBAL\DBALException
*/
public function setPageResultConfiguration($values)
{
@ -8299,6 +8303,7 @@ class Exercise
'hide_expected_answer' => isset($values['hide_expected_answer']) ? $values['hide_expected_answer'] : '',
'hide_question_score' => isset($values['hide_question_score']) ? $values['hide_question_score'] : '',
'hide_total_score' => isset($values['hide_total_score']) ? $values['hide_total_score'] : '',
'hide_category_table' => isset($values['hide_category_table']) ? $values['hide_category_table'] : '',
];
$type = Type::getType('array');
$platform = Database::getManager()->getConnection()->getDatabasePlatform();
@ -8324,11 +8329,6 @@ class Exercise
{
$pageConfig = api_get_configuration_value('allow_quiz_results_page_config');
if ($pageConfig) {
/*$params = [
'hide_expected_answer' => isset($values['hide_expected_answer']) ? $values['hide_expected_answer'] : '',
'hide_question_score' => isset($values['hide_question_score']) ? $values['hide_question_score'] : '',
'hide_total_score' => isset($values['hide_total_score']) ? $values['hide_total_score'] : ''
];*/
$type = Type::getType('array');
$platform = Database::getManager()->getConnection()->getDatabasePlatform();

@ -70,6 +70,10 @@ $htmlHeadXtra[] = '<script>
if (document.getElementById(\'result_disabled_1\').checked == true) {
document.getElementById(\'result_disabled_0\').checked = true;
}
if (document.getElementById(\'exerciseType_0\').checked == true) {
document.getElementById(\'result_disabled_0\').checked = true;
}
}
function check_direct_feedback() {

@ -1231,7 +1231,7 @@ class ExtraFieldValue extends Model
if (!empty($sourceValues) && isset($sourceValues['value']) && $sourceValues['value'] != '') {
$params = [
'extra_'.$variable => $sourceValues['value'],
'item_id' => $destinationId
'item_id' => $destinationId,
];
$extraFieldValue->saveFieldValues($params, true);
}

@ -8703,4 +8703,11 @@ $ToInvoice = "To invoice";
$LearningPathItemByAuthor = "LP item by author";
$DeleteExerciseAttempts = "Delete also the exercise attempts. If not check then the exercise results will still be available in the exercise tool.";
$ExerciseCategoriesRadarMode = "Only show a radar of scores by category, instead of a table of categories. Do not show individual scores or feedback.";
$ExerciseBlockBecausePercentageX = "All attemps blocked because you did not reach the minimum score of %s % at one of your attemps.";
$RegisteredAuthors = "Authors that have been registered :";
$Price = "Price";
$PriceUpdated = "Price updated";
$RemoveSelected = "Remove selected authors";
$DeletedAuthors = "Authors have been removed";
$HideCategoryTable = "Hide category table";
?>

@ -8634,4 +8634,12 @@ $Tariff = "Tarification";
$ToInvoice = "À facturer";
$LearningPathItemByAuthor = "Éléménts de parcours par auteur";
$DeleteExerciseAttempts = "Supprimer également les tentatives des exercices concernés";
$ExerciseCategoriesRadarMode = "Afficher uniquement un radar des scores par catégorie, au lieu d'un tableau de catégories. Ne montre pas les scores ou les commentaires individuels.";
$ExerciseBlockBecausePercentageX = "Toutes les tentatives ont été bloquées car vous n’avez pas atteint le score minimum de %s % à l’une de vos tentatives.";
$RegisteredAuthors = "Auteurs qui ont été enregistrés :";
$Price = "Prix";
$PriceUpdated = "Prix mis à jour";
$RemoveSelected = "Retirer les auteurs sélectionnés";
$DeletedAuthors = "Les auteurs ont été retirés";
$HideCategoryTable = "Cacher le tableau de catégories";
?>

@ -8730,4 +8730,12 @@ $Tariff = "Tarifa";
$ToInvoice = "Por facturar";
$LearningPathItemByAuthor = "Item de lección, por autor";
$DeleteExerciseAttempts = "También eliminar el resultado de los ejercicios, de lo contrario los resultados seguirán existiendo desconectados de la lección.";
$ExerciseCategoriesRadarMode = "Muestra solo un radar de puntuaciones por categoría, en lugar de una tabla de categorías. No muestra puntuaciones o comentarios individuales.";
$ExerciseBlockBecausePercentageX = "Todos los intentos bloqueados porque no alcanzó la puntuación mínima de %s % en uno de sus intentos.";
$RegisteredAuthors = "Autores que han sido registrados:";
$Price = "Precio";
$PriceUpdated = "Precio actualizado";
$RemoveSelected = "Eliminar autores seleccionados";
$DeletedAuthors = "Los autores han sido eliminados";
$HideCategoryTable = "Esconder la tabla de categorías";
?>
Loading…
Cancel
Save