Skip to content

Commit 8c4297c

Browse files
matheuszychthojou
authored andcommitted
Prevents saving of invalid variable divider in formula question and removes language variable err_divider_too_big_specific
1 parent 1e61ed6 commit 8c4297c

32 files changed

Lines changed: 6 additions & 36 deletions

components/ILIAS/TestQuestionPool/classes/class.assFormulaQuestionGUI.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -614,11 +614,12 @@ public function editQuestion(
614614

615615
$decimal_spots = $form->getItemByPostVar('precision_' . $variable->getVariable());
616616
$int_precision = $form->getItemByPostVar('intprecision_' . $variable->getVariable());
617-
if ($decimal_spots instanceof ilFormPropertyGUI && $decimal_spots->getValue() === 0) {
618-
$txt = !$variable->isIntPrecisionValid($int_precision?->getValue(), $min_range_value, $max_range_value)
619-
? 'err_divider_too_big_specific'
620-
: 'err_division';
621-
$int_precision?->setAlert($this->lng->txt($txt));
617+
if (
618+
$decimal_spots instanceof ilFormPropertyGUI
619+
&& $decimal_spots->getValue() === 0.0
620+
&& !$variable->isIntPrecisionValid($int_precision?->getValue(), $min_range_value, $max_range_value)
621+
) {
622+
$int_precision?->setAlert($this->lng->txt('err_division'));
622623
$custom_errors = true;
623624
}
624625
}

lang/ilias_ar.lang

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,6 @@ assessment#:#errFormulaQuestion#:#A Formula Question contains incorrect informat
643643
assessment#:#errRecursionInResult#:#The formula contains an infinite recursion.###24 10 2013 new variable
644644
assessment#:#err_category_in_use#:#At least one category cannot be deleted. One or more units of the category are already in use.###24 10 2013 new variable
645645
assessment#:#err_divider_too_big#:#The divider of one of the variables in this question is too big.###29 07 2022 new variable
646-
assessment#:#err_divider_too_big_specific#:#The divider of this variable is too big.###29 10 2025 new variable
647646
assessment#:#err_division#:#The value you chose would make it impossible to generate a valid value for the variable.###29 07 2022 new variable
648647
assessment#:#err_duplicate_results#:#You used a result variable more than once. This is not allowed in the question text.###24 10 2013 new variable
649648
assessment#:#err_no_formula#:#You must enter a formula###24 10 2013 new variable

lang/ilias_bg.lang

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,6 @@ assessment#:#errFormulaQuestion#:#A Formula Question contains incorrect informat
643643
assessment#:#errRecursionInResult#:#The formula contains an infinite recursion.###24 10 2013 new variable
644644
assessment#:#err_category_in_use#:#At least one category cannot be deleted. One or more units of the category are already in use.###24 10 2013 new variable
645645
assessment#:#err_divider_too_big#:#The divider of one of the variables in this question is too big.###29 07 2022 new variable
646-
assessment#:#err_divider_too_big_specific#:#The divider of this variable is too big.###29 10 2025 new variable
647646
assessment#:#err_division#:#The value you chose would make it impossible to generate a valid value for the variable.###29 07 2022 new variable
648647
assessment#:#err_duplicate_results#:#You used a result variable more than once. This is not allowed in the question text.###24 10 2013 new variable
649648
assessment#:#err_no_formula#:#You must enter a formula###24 10 2013 new variable

lang/ilias_cs.lang

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,6 @@ assessment#:#errFormulaQuestion#:#Otázka se vzorcem obsahuje nekorektní inform
643643
assessment#:#errRecursionInResult#:#Vzorec obsahuje neurčitou rekurzi.
644644
assessment#:#err_category_in_use#:#Nejméně jedna kategorie nemůže být smazána. Jedna nebo více jednotek je již v použití.
645645
assessment#:#err_divider_too_big#:#The divider of one of the variables in this question is too big.###29 07 2022 new variable
646-
assessment#:#err_divider_too_big_specific#:#The divider of this variable is too big.###29 10 2025 new variable
647646
assessment#:#err_division#:#The value you chose would make it impossible to generate a valid value for the variable.###29 07 2022 new variable
648647
assessment#:#err_duplicate_results#:#Použil(a) jste více než jednu proměnnou výsledku. To textu otázky není povoleno.
649648
assessment#:#err_no_formula#:#Musíte vložit vzorec

lang/ilias_da.lang

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,6 @@ assessment#:#errFormulaQuestion#:#A Formula Question contains incorrect informat
643643
assessment#:#errRecursionInResult#:#The formula contains an infinite recursion.###16 09 2013 new variable
644644
assessment#:#err_category_in_use#:#At least one category cannot be deleted. One or more units of the category are already in use.###16 09 2013 new variable
645645
assessment#:#err_divider_too_big#:#The divider of one of the variables in this question is too big.###29 07 2022 new variable
646-
assessment#:#err_divider_too_big_specific#:#The divider of this variable is too big.###29 10 2025 new variable
647646
assessment#:#err_division#:#The value you chose would make it impossible to generate a valid value for the variable.###29 07 2022 new variable
648647
assessment#:#err_duplicate_results#:#You used a result variable more than once. This is not allowed in the question text.###16 09 2013 new variable
649648
assessment#:#err_no_formula#:#You must enter a formula###16 09 2013 new variable

lang/ilias_de.lang

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,6 @@ assessment#:#errFormulaQuestion#:#Eine Formelfrage enthält fehlerhafte Angaben
643643
assessment#:#errRecursionInResult#:#Die Formel enthält eine nicht auflösbare Rekursion.
644644
assessment#:#err_category_in_use#:#Die Kategorie kann nicht gelöscht werden. Eine oder mehrere Einheiten der Kategorie sind bereits in Benutzung.
645645
assessment#:#err_divider_too_big#:#Der Teiler einer der Variablen in dieser Frage ist zu gross.
646-
assessment#:#err_divider_too_big_specific#:#Der Teiler dieser Variable ist zu gross.
647646
assessment#:#err_division#:#Der von Ihnen gesetzte Wert macht es unmöglich einen gültigen Wert für die Variable zu generieren.
648647
assessment#:#err_duplicate_results#:#Sie haben eine Ergebnisvariable mehrfach verwendet. Das ist innerhalb des Aufgabentextes nicht erlaubt!
649648
assessment#:#err_no_formula#:#Bitte geben Sie eine Formel zur Berechnung des Ergebnisses an.

lang/ilias_el.lang

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,6 @@ assessment#:#errFormulaQuestion#:#A Formula Question contains incorrect informat
644644
assessment#:#errRecursionInResult#:#The formula contains an infinite recursion.###24 10 2013 new variable
645645
assessment#:#err_category_in_use#:#At least one category cannot be deleted. One or more units of the category are already in use.###24 10 2013 new variable
646646
assessment#:#err_divider_too_big#:#The divider of one of the variables in this question is too big.###29 07 2022 new variable
647-
assessment#:#err_divider_too_big_specific#:#The divider of this variable is too big.###29 10 2025 new variable
648647
assessment#:#err_division#:#The value you chose would make it impossible to generate a valid value for the variable.###29 07 2022 new variable
649648
assessment#:#err_duplicate_results#:#You used a result variable more than once. This is not allowed in the question text.###24 10 2013 new variable
650649
assessment#:#err_no_formula#:#You must enter a formula###24 10 2013 new variable

lang/ilias_en.lang

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,6 @@ assessment#:#errFormulaQuestion#:#A Formula Question contains incorrect informat
643643
assessment#:#errRecursionInResult#:#The formula contains an infinite recursion.
644644
assessment#:#err_category_in_use#:#At least one category cannot be deleted. One or more units of the category are already in use.
645645
assessment#:#err_divider_too_big#:#The divider of one of the variables in this question is too big.
646-
assessment#:#err_divider_too_big_specific#:#The divider of this variable is too big.
647646
assessment#:#err_division#:#The value you chose would make it impossible to generate a valid value for the variable.
648647
assessment#:#err_duplicate_results#:#You used a result variable more than once. This is not allowed in the question text.
649648
assessment#:#err_no_formula#:#You must enter a formula

lang/ilias_es.lang

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,6 @@ assessment#:#errFormulaQuestion#:#¡Una fórmula de pregunta contiene informaci
645645
assessment#:#errRecursionInResult#:#La fórmula contiene una recursividad infinita.
646646
assessment#:#err_category_in_use#:#Al menos una categoría no se puede eliminar. Una o más unidades de la categoría ya están en uso.
647647
assessment#:#err_divider_too_big#:#The divider of one of the variables in this question is too big.###29 07 2022 new variable
648-
assessment#:#err_divider_too_big_specific#:#The divider of this variable is too big.###29 10 2025 new variable
649648
assessment#:#err_division#:#The value you chose would make it impossible to generate a valid value for the variable.###29 07 2022 new variable
650649
assessment#:#err_duplicate_results#:#Ha utilizado una variable de resultado más de una vez. Esto no está permitido en el texto de la pregunta.
651650
assessment#:#err_no_formula#:#Debe introducir introducir una formula

lang/ilias_et.lang

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,6 @@ assessment#:#errFormulaQuestion#:#A Formula Question contains incorrect informat
643643
assessment#:#errRecursionInResult#:#The formula contains an infinite recursion.
644644
assessment#:#err_category_in_use#:#At least one category cannot be deleted. One or more units of the category are already in use.
645645
assessment#:#err_divider_too_big#:#The divider of one of the variables in this question is too big.###29 07 2022 new variable
646-
assessment#:#err_divider_too_big_specific#:#The divider of this variable is too big.###29 10 2025 new variable
647646
assessment#:#err_division#:#The value you chose would make it impossible to generate a valid value for the variable.###29 07 2022 new variable
648647
assessment#:#err_duplicate_results#:#You used a result variable more than once. This is not allowed in the question text.
649648
assessment#:#err_no_formula#:#You must enter a formula

0 commit comments

Comments
 (0)