Skip to content

Commit

Permalink
Merge pull request #4484 from okaufman/ilias7_fix32522
Browse files Browse the repository at this point in the history
T&A fix for 32522
# Conflicts:
#	Modules/TestQuestionPool/classes/class.assFormulaQuestionVariable.php
  • Loading branch information
mbecker-databay committed May 5, 2022
1 parent a705970 commit 9475f48
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -695,9 +695,12 @@ public function editQuestion($checkonly = false) : bool
$custom_errors = true;
}
$intPrecision = $form->getItemByPostVar('intprecision_' . $variable->getVariable());
if ($intPrecision->getValue() > $max_range->getValue()) {
$intPrecision->setAlert($this->lng->txt('err_division'));
$custom_errors = true;
$decimal_spots = $form->getItemByPostVar('precision_' . $variable->getVariable());
if ($decimal_spots->getValue() == 0) {
if ($intPrecision->getValue() > $max_range->getValue()) {
$intPrecision->setAlert($this->lng->txt('err_division'));
$custom_errors = true;
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ public function __construct($variable, $range_min, $range_max, $unit = null, $pr
public function getRandomValue()
{

// @todo check this
if ($this->getIntprecision() > $this->getRangeMax()) {
global $DIC;
$lng = $DIC['lng'];
$tpl = $DIC['tpl'];
$tpl->setOnScreenMessage('failure', $lng->txt("err_divider_too_big"));
if ($this->getPrecision() == 0) {
if ($this->getIntprecision() > $this->getRangeMax()) {
global $DIC;
$lng = $DIC['lng'];
ilUtil::sendFailure($lng->txt('err_divider_too_big'));
}
}

include_once "./Services/Math/classes/class.ilMath.php";
Expand Down

0 comments on commit 9475f48

Please sign in to comment.