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
  • Loading branch information
mbecker-databay authored May 5, 2022
2 parents 34ae36f + 4f9c383 commit cd9e0c7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -690,9 +690,12 @@ public function editQuestion($checkonly = false)
$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 @@ -47,10 +47,12 @@ public function getRandomValue()
{

// @todo check this
if ($this->getIntprecision() > $this->getRangeMax()){
global $DIC;
$lng = $DIC['lng'];
ilUtil::sendFailure($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 cd9e0c7

Please sign in to comment.