|
ILIAS
trunk Revision v13.0_alpha-62-g3b72d83f2e5
|
Formula Question Result. More...
Inheritance diagram for assFormulaQuestionResult:
Collaboration diagram for assFormulaQuestionResult:Public Member Functions | |
| __construct (private string $result, private ?string $range_min_txt, private ?string $range_max_txt, private float $tolerance, private ?assFormulaQuestionUnit $unit, private ?string $formula, private float $points, private int $precision, private bool $rating_simple=true, private ?float $rating_sign=null, private ?float $rating_value=null, private ?float $rating_unit=null, private float $result_type=0) | |
| substituteFormula (array $variables, array $results) | |
| calculateFormula ($variables, $results, $question_id=0, $use_precision=true) | |
| findValidRandomVariables ($variables, $results) | |
| suggestRange ($variables, $results) | |
| isCorrect ($variables, $results, $value, $unit=null) | |
| getReachedPoints (array $variables, array $results, string $answer_value, ?assFormulaQuestionUnit $answer_unit) | |
| getResultInfo ($variables, $results, $value, $unit, $units) | |
| setResult ($result) | |
| getResult () | |
| setRangeMin (?string $range_min) | |
| getRangeMin () | |
| getRangeMinBase () | |
| setRangeMax (?string $range_max) | |
| getRangeMax () | |
| getRangeMaxBase () | |
| setTolerance ($tolerance) | |
| getTolerance () | |
| setUnit (?assFormulaQuestionUnit $unit) | |
| getUnit () | |
| setFormula (?string $formula) | |
| getFormula () | |
| setPoints (float $points) | |
| getPoints () | |
| setRatingSimple (bool $rating_simple) | |
| getRatingSimple () | |
| setRatingSign (float $rating_sign) | |
| getRatingSign () | |
| setRatingValue (float $rating_value) | |
| getRatingValue () | |
| setRatingUnit (float $rating_unit) | |
| getRatingUnit () | |
| setPrecision (float $precision) | |
| getPrecision () | |
| setResultType (int $a_result_type) | |
| getResultType () | |
| setRangeMaxTxt (string $range_max_txt) | |
| getRangeMaxTxt () | |
| setRangeMinTxt (string $range_min_txt) | |
| getRangeMinTxt () | |
| getAvailableResultUnits ($question_id) | |
| toNormalized (Transformations $transformations, array $context=[]) | |
| Convert the internal state of the implementing object into a language-neutral array structure. More... | |
| fromNormalized (array $normalized, Transformations $transformations) | |
| Restore the object from its normalized representation. More... | |
| toNormalized (Transformations $transformations, array $context=[]) | |
| Convert the internal state of the implementing object into a language-neutral array structure. More... | |
| fromNormalized (array $normalized, Transformations $transformations) | |
| Restore the object from its normalized representation. More... | |
Static Public Member Functions | |
| static | getResultTypeByQstId ($a_qst_id, $a_result) |
| static | isCoprimeFraction ($numerator, $denominator) |
| static | convertDecimalToCoprimeFraction ($decimal_value, $tolerance=1.e-9) |
| static | getGreatestCommonDivisor ($a, $b) |
Data Fields | |
| const | RESULT_NO_SELECTION = 0 |
| const | RESULT_DEC = 1 |
| const | RESULT_FRAC = 2 |
| const | RESULT_CO_FRAC = 3 |
Protected Member Functions | |
| isInTolerance ($user_answer, $expected, $tolerated_percentage) | |
Private Member Functions | |
| checkSign (float $v1, float $v2) | |
| calculateCorrectResult (array $variables, array $results) | |
| transformAnswerValueAccordingToType (string $value, ?assFormulaQuestionUnit $unit) | |
Private Attributes | |
| ilGlobalTemplateInterface | $main_tpl |
| Refinery | $refinery |
| ilLanguage | $lng |
| $available_units = [] | |
| float | $range_min = null |
| float | $range_max = null |
Formula Question Result.
\
Definition at line 30 of file class.assFormulaQuestionResult.php.
| assFormulaQuestionResult::__construct | ( | private string | $result, |
| private ?string | $range_min_txt, | ||
| private ?string | $range_max_txt, | ||
| private float | $tolerance, | ||
| private ?assFormulaQuestionUnit | $unit, | ||
| private ?string | $formula, | ||
| private float | $points, | ||
| private int | $precision, | ||
| private bool | $rating_simple = true, |
||
| private ?float | $rating_sign = null, |
||
| private ?float | $rating_value = null, |
||
| private ?float | $rating_unit = null, |
||
| private float | $result_type = 0 |
||
| ) |
Definition at line 45 of file class.assFormulaQuestionResult.php.
References $DIC, ILIAS\Repository\lng(), ILIAS\Repository\refinery(), setRangeMax(), and setRangeMin().
Here is the call graph for this function:
|
private |
Definition at line 456 of file class.assFormulaQuestionResult.php.
References $results.
| assFormulaQuestionResult::calculateFormula | ( | $variables, | |
| $results, | |||
$question_id = 0, |
|||
$use_precision = true |
|||
| ) |
Definition at line 104 of file class.assFormulaQuestionResult.php.
References $res, $results, ilMath\_div(), getAvailableResultUnits(), getPrecision(), getResultType(), getUnit(), and substituteFormula().
Here is the call graph for this function:
|
private |
Definition at line 412 of file class.assFormulaQuestionResult.php.
|
static |
Definition at line 792 of file class.assFormulaQuestionResult.php.
References Vendor\Package\$a, and Vendor\Package\$b.
Referenced by assFormulaQuestion\getBestSolution(), and assFormulaQuestion\substituteVariables().
Here is the caller graph for this function:| assFormulaQuestionResult::findValidRandomVariables | ( | $variables, | |
| $results | |||
| ) |
Definition at line 144 of file class.assFormulaQuestionResult.php.
References $results, getRangeMax(), getRangeMaxBase(), getRangeMin(), getRangeMinBase(), and substituteFormula().
Here is the call graph for this function:| assFormulaQuestionResult::fromNormalized | ( | array | $normalized, |
| Transformations | $transformations | ||
| ) |
Restore the object from its normalized representation.
| array<array-key,mixed> | $normalized |
Implements ILIAS\TestQuestionPool\ExportImport\Foundation\Normalize\FromNormalized.
Definition at line 896 of file class.assFormulaQuestionResult.php.
References ILIAS\TestQuestionPool\ExportImport\Foundation\Normalize\Transformations\bool(), ILIAS\TestQuestionPool\ExportImport\Foundation\Normalize\Transformations\denormalize(), ILIAS\TestQuestionPool\ExportImport\Foundation\Normalize\Transformations\float(), ILIAS\TestQuestionPool\ExportImport\Foundation\Normalize\Transformations\int(), and ILIAS\TestQuestionPool\ExportImport\Foundation\Normalize\Transformations\string().
Here is the call graph for this function:| assFormulaQuestionResult::getAvailableResultUnits | ( | $question_id | ) |
Definition at line 847 of file class.assFormulaQuestionResult.php.
References $DIC, $ilDB, and $res.
Referenced by calculateFormula().
Here is the caller graph for this function:| assFormulaQuestionResult::getFormula | ( | ) |
Definition at line 670 of file class.assFormulaQuestionResult.php.
Referenced by assFormulaQuestion\buildResultsForLog(), and substituteFormula().
Here is the caller graph for this function:
|
static |
Definition at line 837 of file class.assFormulaQuestionResult.php.
References Vendor\Package\$a, and Vendor\Package\$b.
| assFormulaQuestionResult::getPoints | ( | ) |
Definition at line 680 of file class.assFormulaQuestionResult.php.
Referenced by assFormulaQuestion\buildResultsForLog(), and getReachedPoints().
Here is the caller graph for this function:| assFormulaQuestionResult::getPrecision | ( | ) |
Definition at line 730 of file class.assFormulaQuestionResult.php.
Referenced by assFormulaQuestion\buildResultsForLog(), calculateFormula(), isCorrect(), isInTolerance(), and suggestRange().
Here is the caller graph for this function:| assFormulaQuestionResult::getRangeMax | ( | ) |
Definition at line 631 of file class.assFormulaQuestionResult.php.
Referenced by findValidRandomVariables().
Here is the caller graph for this function:| assFormulaQuestionResult::getRangeMaxBase | ( | ) |
Definition at line 636 of file class.assFormulaQuestionResult.php.
References ilMath\_mul().
Referenced by findValidRandomVariables().
Here is the call graph for this function:
Here is the caller graph for this function:| assFormulaQuestionResult::getRangeMaxTxt | ( | ) |
Definition at line 750 of file class.assFormulaQuestionResult.php.
Referenced by assFormulaQuestion\buildResultsForLog().
Here is the caller graph for this function:| assFormulaQuestionResult::getRangeMin | ( | ) |
Definition at line 606 of file class.assFormulaQuestionResult.php.
Referenced by findValidRandomVariables().
Here is the caller graph for this function:| assFormulaQuestionResult::getRangeMinBase | ( | ) |
Definition at line 611 of file class.assFormulaQuestionResult.php.
References ilMath\_mul().
Referenced by findValidRandomVariables().
Here is the call graph for this function:
Here is the caller graph for this function:| assFormulaQuestionResult::getRangeMinTxt | ( | ) |
Definition at line 760 of file class.assFormulaQuestionResult.php.
Referenced by assFormulaQuestion\buildResultsForLog().
Here is the caller graph for this function:| assFormulaQuestionResult::getRatingSign | ( | ) |
Definition at line 700 of file class.assFormulaQuestionResult.php.
| assFormulaQuestionResult::getRatingSimple | ( | ) |
Definition at line 690 of file class.assFormulaQuestionResult.php.
| assFormulaQuestionResult::getRatingUnit | ( | ) |
Definition at line 720 of file class.assFormulaQuestionResult.php.
| assFormulaQuestionResult::getRatingValue | ( | ) |
Definition at line 710 of file class.assFormulaQuestionResult.php.
| assFormulaQuestionResult::getReachedPoints | ( | array | $variables, |
| array | $results, | ||
| string | $answer_value, | ||
| ?assFormulaQuestionUnit | $answer_unit | ||
| ) |
Definition at line 417 of file class.assFormulaQuestionResult.php.
References $results, getPoints(), and isCorrect().
Here is the call graph for this function:| assFormulaQuestionResult::getResult | ( | ) |
Definition at line 590 of file class.assFormulaQuestionResult.php.
Referenced by assFormulaQuestion\addResult(), assFormulaQuestion\buildResultsForLog(), assFormulaQuestion\getResultUnits(), and substituteFormula().
Here is the caller graph for this function:| assFormulaQuestionResult::getResultInfo | ( | $variables, | |
| $results, | |||
| $value, | |||
| $unit, | |||
| $units | |||
| ) |
Definition at line 505 of file class.assFormulaQuestionResult.php.
References $results, ilMath\_mul(), and assFormulaQuestionUnit\getId().
Here is the call graph for this function:| assFormulaQuestionResult::getResultType | ( | ) |
Definition at line 740 of file class.assFormulaQuestionResult.php.
Referenced by assFormulaQuestion\buildResultsForLog(), calculateFormula(), and isCorrect().
Here is the caller graph for this function:
|
static |
Definition at line 765 of file class.assFormulaQuestionResult.php.
References $DIC, $ilDB, and $res.
Referenced by assFormulaQuestionGUI\getPreview(), and assFormulaQuestionGUI\getTestOutput().
Here is the caller graph for this function:| assFormulaQuestionResult::getTolerance | ( | ) |
Definition at line 650 of file class.assFormulaQuestionResult.php.
Referenced by assFormulaQuestion\buildResultsForLog(), and isCorrect().
Here is the caller graph for this function:| assFormulaQuestionResult::getUnit | ( | ) |
Definition at line 660 of file class.assFormulaQuestionResult.php.
Referenced by assFormulaQuestion\buildResultsForLog(), calculateFormula(), assFormulaQuestion\canUseAdvancedRating(), isCorrect(), assFormulaQuestion\loadFromDb(), and suggestRange().
Here is the caller graph for this function:
|
static |
Definition at line 785 of file class.assFormulaQuestionResult.php.
| assFormulaQuestionResult::isCorrect | ( | $variables, | |
| $results, | |||
| $value, | |||
$unit = null |
|||
| ) |
| $variables | array formula variables containing units | |
| $results | array formula results containing units | |
| $value | string user input value | |
| null | $unit | user input unit |
Definition at line 222 of file class.assFormulaQuestionResult.php.
References $results, ilMath\_div(), ilMath\_mul(), getPrecision(), getResultType(), getTolerance(), getUnit(), isInTolerance(), RESULT_CO_FRAC, RESULT_DEC, RESULT_FRAC, RESULT_NO_SELECTION, and substituteFormula().
Referenced by getReachedPoints().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
Definition at line 401 of file class.assFormulaQuestionResult.php.
References ilMath\_add(), ilMath\_div(), ilMath\_mul(), ilMath\_sub(), and getPrecision().
Referenced by isCorrect().
Here is the call graph for this function:
Here is the caller graph for this function:| assFormulaQuestionResult::setFormula | ( | ?string | $formula | ) |
Definition at line 665 of file class.assFormulaQuestionResult.php.
| assFormulaQuestionResult::setPoints | ( | float | $points | ) |
Definition at line 675 of file class.assFormulaQuestionResult.php.
| assFormulaQuestionResult::setPrecision | ( | float | $precision | ) |
Definition at line 725 of file class.assFormulaQuestionResult.php.
| assFormulaQuestionResult::setRangeMax | ( | ?string | $range_max | ) |
Definition at line 620 of file class.assFormulaQuestionResult.php.
Referenced by __construct(), and suggestRange().
Here is the caller graph for this function:| assFormulaQuestionResult::setRangeMaxTxt | ( | string | $range_max_txt | ) |
Definition at line 745 of file class.assFormulaQuestionResult.php.
| assFormulaQuestionResult::setRangeMin | ( | ?string | $range_min | ) |
Definition at line 595 of file class.assFormulaQuestionResult.php.
Referenced by __construct(), and suggestRange().
Here is the caller graph for this function:| assFormulaQuestionResult::setRangeMinTxt | ( | string | $range_min_txt | ) |
Definition at line 755 of file class.assFormulaQuestionResult.php.
| assFormulaQuestionResult::setRatingSign | ( | float | $rating_sign | ) |
Definition at line 695 of file class.assFormulaQuestionResult.php.
| assFormulaQuestionResult::setRatingSimple | ( | bool | $rating_simple | ) |
Definition at line 685 of file class.assFormulaQuestionResult.php.
| assFormulaQuestionResult::setRatingUnit | ( | float | $rating_unit | ) |
Definition at line 715 of file class.assFormulaQuestionResult.php.
| assFormulaQuestionResult::setRatingValue | ( | float | $rating_value | ) |
Definition at line 705 of file class.assFormulaQuestionResult.php.
| assFormulaQuestionResult::setResult | ( | $result | ) |
Definition at line 585 of file class.assFormulaQuestionResult.php.
| assFormulaQuestionResult::setResultType | ( | int | $a_result_type | ) |
Definition at line 735 of file class.assFormulaQuestionResult.php.
| assFormulaQuestionResult::setTolerance | ( | $tolerance | ) |
Definition at line 645 of file class.assFormulaQuestionResult.php.
| assFormulaQuestionResult::setUnit | ( | ?assFormulaQuestionUnit | $unit | ) |
Definition at line 655 of file class.assFormulaQuestionResult.php.
| assFormulaQuestionResult::substituteFormula | ( | array | $variables, |
| array | $results | ||
| ) |
Definition at line 78 of file class.assFormulaQuestionResult.php.
References $results, getFormula(), getResult(), ILIAS\Repository\lng(), and substituteFormula().
Referenced by calculateFormula(), findValidRandomVariables(), isCorrect(), substituteFormula(), and suggestRange().
Here is the call graph for this function:
Here is the caller graph for this function:| assFormulaQuestionResult::suggestRange | ( | $variables, | |
| $results | |||
| ) |
Definition at line 180 of file class.assFormulaQuestionResult.php.
References $range_max, $range_min, $results, ilMath\_div(), ilMath\_mul(), getPrecision(), getUnit(), setRangeMax(), setRangeMin(), and substituteFormula().
Here is the call graph for this function:| assFormulaQuestionResult::toNormalized | ( | Transformations | $transformations, |
| array | $context = [] |
||
| ) |
Convert the internal state of the implementing object into a language-neutral array structure.
The resulting array must contain only null, scalar values (string, int, float, bool) and nested arrays following the same rules.
| array<string,mixed> | $context |
Implements ILIAS\TestQuestionPool\ExportImport\Foundation\Normalize\ToNormalized.
Definition at line 870 of file class.assFormulaQuestionResult.php.
References ILIAS\TestQuestionPool\ExportImport\Foundation\Normalize\Transformations\normalize().
Here is the call graph for this function:
|
private |
Definition at line 464 of file class.assFormulaQuestionResult.php.
References ilMath\_div().
Here is the call graph for this function:
|
private |
Definition at line 41 of file class.assFormulaQuestionResult.php.
|
private |
Definition at line 39 of file class.assFormulaQuestionResult.php.
|
private |
Definition at line 37 of file class.assFormulaQuestionResult.php.
|
private |
Definition at line 43 of file class.assFormulaQuestionResult.php.
Referenced by suggestRange().
|
private |
Definition at line 42 of file class.assFormulaQuestionResult.php.
Referenced by suggestRange().
|
private |
Definition at line 38 of file class.assFormulaQuestionResult.php.
| const assFormulaQuestionResult::RESULT_CO_FRAC = 3 |
Definition at line 35 of file class.assFormulaQuestionResult.php.
Referenced by assFormulaQuestion\getBestSolution(), isCorrect(), assFormulaQuestionTest\simpleRatedCalculationsData(), and assFormulaQuestion\substituteVariables().
| const assFormulaQuestionResult::RESULT_DEC = 1 |
Definition at line 33 of file class.assFormulaQuestionResult.php.
Referenced by isCorrect(), assFormulaQuestionTest\simpleRatedCalculationsData(), and assFormulaQuestion\substituteVariables().
| const assFormulaQuestionResult::RESULT_FRAC = 2 |
Definition at line 34 of file class.assFormulaQuestionResult.php.
Referenced by assFormulaQuestion\getBestSolution(), isCorrect(), assFormulaQuestionTest\simpleRatedCalculationsData(), and assFormulaQuestion\substituteVariables().
| const assFormulaQuestionResult::RESULT_NO_SELECTION = 0 |
Definition at line 32 of file class.assFormulaQuestionResult.php.
Referenced by isCorrect(), assFormulaQuestionTest\simpleRatedCalculationsData(), and assFormulaQuestion\substituteVariables().