ILIAS
Release_5_0_x_branch Revision 61816
|
Formula Question Result. More...
Public Member Functions | |
__construct ($result, $range_min, $range_max, $tolerance, $unit, $formula, $points, $precision, $rating_simple=TRUE, $rating_sign=33, $rating_value=34, $rating_unit=33, $result_type=0) | |
assFormulaQuestionResult constructor | |
substituteFormula ($variables, $results) | |
calculateFormula ($variables, $results, $question_id=0, $use_precision=true) | |
findValidRandomVariables ($variables, $results) | |
suggestRange ($variables, $results) | |
isCorrect ($variables, $results, $value, $unit=NULL) | |
getReachedPoints ($variables, $results, $value, $unit, $units) | |
getResultInfo ($variables, $results, $value, $unit, $units) | |
setResult ($result) | |
getResult () | |
setRangeMin ($range_min) | |
getRangeMin () | |
getRangeMinBase () | |
setRangeMax ($range_max) | |
getRangeMax () | |
getRangeMaxBase () | |
setTolerance ($tolerance) | |
getTolerance () | |
setUnit ($unit) | |
getUnit () | |
setFormula ($formula) | |
getFormula () | |
setPoints ($points) | |
getPoints () | |
setRatingSimple ($rating_simple) | |
getRatingSimple () | |
setRatingSign ($rating_sign) | |
getRatingSign () | |
setRatingValue ($rating_value) | |
getRatingValue () | |
setRatingUnit ($rating_unit) | |
getRatingUnit () | |
setPrecision ($precision) | |
getPrecision () | |
setResultType ($a_result_type) | |
getResultType () | |
setRangeMaxTxt ($range_max_txt) | |
getRangeMaxTxt () | |
setRangeMinTxt ($range_min_txt) | |
getRangeMinTxt () | |
getAvailableResultUnits ($question_id) |
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 ($v1, $v2, $p) | |
checkSign ($v1, $v2) |
Private Attributes | |
$result | |
$range_min | |
$range_max | |
$tolerance | |
$unit | |
$formula | |
$rating_simple | |
$rating_sign | |
$rating_value | |
$rating_unit | |
$points | |
$precision | |
$result_type | |
$range_min_txt | |
$range_max_txt | |
$available_units = array() |
Formula Question Result.
Definition at line 10 of file class.assFormulaQuestionResult.php.
assFormulaQuestionResult::__construct | ( | $result, | |
$range_min, | |||
$range_max, | |||
$tolerance, | |||
$unit, | |||
$formula, | |||
$points, | |||
$precision, | |||
$rating_simple = TRUE , |
|||
$rating_sign = 33 , |
|||
$rating_value = 34 , |
|||
$rating_unit = 33 , |
|||
$result_type = 0 |
|||
) |
assFormulaQuestionResult constructor
string | $result | Result name |
double | $range_min | Range minimum |
double | $range_max | Range maximum |
double | $tolerance | Tolerance of the result in percent |
object | $unit | Unit |
string | $formula | The formula to calculate the result |
double | $points | The maximum available points for the result |
integer | $precision | Number of decimal places of the value |
boolean | $rating_simple | Use simple rating (100% if right, 0 % if wrong) |
double | $rating_sign | Percentage of rating for the correct sign |
double | $rating_value | Percentage of rating for the correct value |
double | $rating_unit | Percentage of rating for the correct unit public |
Definition at line 51 of file class.assFormulaQuestionResult.php.
References $formula, $points, $precision, $range_max, $range_min, $rating_sign, $rating_simple, $rating_unit, $rating_value, $result, $result_type, $tolerance, $unit, setRangeMax(), setRangeMaxTxt(), setRangeMin(), and setRangeMinTxt().
assFormulaQuestionResult::calculateFormula | ( | $variables, | |
$results, | |||
$question_id = 0 , |
|||
$use_precision = true |
|||
) |
Definition at line 105 of file class.assFormulaQuestionResult.php.
References $formula, $res, $result, $results, ilMath\_div(), ilMath\_round(), getAvailableResultUnits(), getPrecision(), getResultType(), getUnit(), RESULT_NO_SELECTION, and substituteFormula().
|
protected |
Definition at line 477 of file class.assFormulaQuestionResult.php.
Referenced by getReachedPoints(), and getResultInfo().
|
static |
Definition at line 948 of file class.assFormulaQuestionResult.php.
References $result, and $tolerance.
Referenced by assFormulaQuestion\getBestSolution(), and assFormulaQuestion\substituteVariables().
assFormulaQuestionResult::findValidRandomVariables | ( | $variables, | |
$results | |||
) |
Definition at line 156 of file class.assFormulaQuestionResult.php.
References $formula, $result, $results, getRangeMax(), getRangeMaxBase(), getRangeMin(), getRangeMinBase(), and substituteFormula().
assFormulaQuestionResult::getAvailableResultUnits | ( | $question_id | ) |
Definition at line 1010 of file class.assFormulaQuestionResult.php.
References $available_units, $ilDB, $res, and $row.
Referenced by calculateFormula().
assFormulaQuestionResult::getFormula | ( | ) |
Definition at line 828 of file class.assFormulaQuestionResult.php.
References $formula.
Referenced by substituteFormula().
|
static |
Definition at line 997 of file class.assFormulaQuestionResult.php.
Referenced by isCoprimeFraction().
assFormulaQuestionResult::getPoints | ( | ) |
Definition at line 838 of file class.assFormulaQuestionResult.php.
References $points.
Referenced by getReachedPoints(), and getResultInfo().
assFormulaQuestionResult::getPrecision | ( | ) |
Definition at line 888 of file class.assFormulaQuestionResult.php.
References $precision.
Referenced by calculateFormula(), getReachedPoints(), isCorrect(), isInTolerance(), and suggestRange().
assFormulaQuestionResult::getRangeMax | ( | ) |
Definition at line 785 of file class.assFormulaQuestionResult.php.
References $range_max.
Referenced by findValidRandomVariables(), and getRangeMaxBase().
assFormulaQuestionResult::getRangeMaxBase | ( | ) |
Definition at line 790 of file class.assFormulaQuestionResult.php.
References ilMath\_mul(), getRangeMax(), and getUnit().
Referenced by findValidRandomVariables().
assFormulaQuestionResult::getRangeMaxTxt | ( | ) |
Definition at line 908 of file class.assFormulaQuestionResult.php.
References $range_max_txt.
assFormulaQuestionResult::getRangeMin | ( | ) |
Definition at line 750 of file class.assFormulaQuestionResult.php.
References $range_min.
Referenced by findValidRandomVariables(), and getRangeMinBase().
assFormulaQuestionResult::getRangeMinBase | ( | ) |
Definition at line 755 of file class.assFormulaQuestionResult.php.
References ilMath\_mul(), getRangeMin(), and getUnit().
Referenced by findValidRandomVariables().
assFormulaQuestionResult::getRangeMinTxt | ( | ) |
Definition at line 918 of file class.assFormulaQuestionResult.php.
References $range_min_txt.
assFormulaQuestionResult::getRatingSign | ( | ) |
Definition at line 858 of file class.assFormulaQuestionResult.php.
References $rating_sign.
Referenced by getReachedPoints(), and getResultInfo().
assFormulaQuestionResult::getRatingSimple | ( | ) |
Definition at line 848 of file class.assFormulaQuestionResult.php.
References $rating_simple.
Referenced by getReachedPoints(), and getResultInfo().
assFormulaQuestionResult::getRatingUnit | ( | ) |
Definition at line 878 of file class.assFormulaQuestionResult.php.
References $rating_unit.
Referenced by getReachedPoints(), and getResultInfo().
assFormulaQuestionResult::getRatingValue | ( | ) |
Definition at line 868 of file class.assFormulaQuestionResult.php.
References $rating_value.
Referenced by getReachedPoints(), and getResultInfo().
assFormulaQuestionResult::getReachedPoints | ( | $variables, | |
$results, | |||
$value, | |||
$unit, | |||
$units | |||
) |
Definition at line 489 of file class.assFormulaQuestionResult.php.
References $formula, $ilLog, $points, $result, $results, $unit, ilMath\_div(), ilMath\_equals(), ilMath\_mul(), checkSign(), getPoints(), getPrecision(), getRatingSign(), getRatingSimple(), getRatingUnit(), getRatingValue(), getResultType(), getTolerance(), getUnit(), isCorrect(), isInTolerance(), RESULT_CO_FRAC, RESULT_DEC, RESULT_FRAC, RESULT_NO_SELECTION, and substituteFormula().
assFormulaQuestionResult::getResult | ( | ) |
Definition at line 727 of file class.assFormulaQuestionResult.php.
References $result.
Referenced by substituteFormula().
assFormulaQuestionResult::getResultInfo | ( | $variables, | |
$results, | |||
$value, | |||
$unit, | |||
$units | |||
) |
Definition at line 647 of file class.assFormulaQuestionResult.php.
References $formula, $points, $result, $results, $unit, ilMath\_mul(), checkSign(), getPoints(), getRatingSign(), getRatingSimple(), getRatingUnit(), getRatingValue(), getTolerance(), getUnit(), isCorrect(), isInTolerance(), and substituteFormula().
assFormulaQuestionResult::getResultType | ( | ) |
Definition at line 898 of file class.assFormulaQuestionResult.php.
References $result_type.
Referenced by calculateFormula(), getReachedPoints(), and isCorrect().
|
static |
Definition at line 923 of file class.assFormulaQuestionResult.php.
References $ilDB, $res, and $row.
Referenced by assFormulaQuestionGUI\getPreview(), and assFormulaQuestionGUI\getTestOutput().
assFormulaQuestionResult::getTolerance | ( | ) |
Definition at line 808 of file class.assFormulaQuestionResult.php.
References $tolerance.
Referenced by getReachedPoints(), getResultInfo(), and isCorrect().
assFormulaQuestionResult::getUnit | ( | ) |
Definition at line 818 of file class.assFormulaQuestionResult.php.
References $unit.
Referenced by calculateFormula(), getRangeMaxBase(), getRangeMinBase(), getReachedPoints(), getResultInfo(), isCorrect(), and suggestRange().
|
static |
Definition at line 941 of file class.assFormulaQuestionResult.php.
References getGreatestCommonDivisor().
assFormulaQuestionResult::isCorrect | ( | $variables, | |
$results, | |||
$value, | |||
$unit = NULL |
|||
) |
$variables | formula variables containing units | |
$results | formula results containing units | |
$value | user input value | |
null | $unit | user input unit |
Definition at line 248 of file class.assFormulaQuestionResult.php.
References $formula, $result, $results, $unit, ilMath\_div(), ilMath\_equals(), ilMath\_mul(), ilMath\_round(), getPrecision(), getResultType(), getTolerance(), getUnit(), isInTolerance(), RESULT_CO_FRAC, RESULT_DEC, RESULT_FRAC, RESULT_NO_SELECTION, and substituteFormula().
Referenced by getReachedPoints(), and getResultInfo().
|
protected |
Definition at line 467 of file class.assFormulaQuestionResult.php.
References ilMath\_add(), ilMath\_div(), ilMath\_mul(), ilMath\_sub(), and getPrecision().
Referenced by getReachedPoints(), getResultInfo(), and isCorrect().
assFormulaQuestionResult::setFormula | ( | $formula | ) |
Definition at line 823 of file class.assFormulaQuestionResult.php.
References $formula.
assFormulaQuestionResult::setPoints | ( | $points | ) |
Definition at line 833 of file class.assFormulaQuestionResult.php.
References $points.
assFormulaQuestionResult::setPrecision | ( | $precision | ) |
Definition at line 883 of file class.assFormulaQuestionResult.php.
References $precision.
assFormulaQuestionResult::setRangeMax | ( | $range_max | ) |
Definition at line 768 of file class.assFormulaQuestionResult.php.
References $range_max, and $result.
Referenced by __construct(), and suggestRange().
assFormulaQuestionResult::setRangeMaxTxt | ( | $range_max_txt | ) |
Definition at line 903 of file class.assFormulaQuestionResult.php.
References $range_max_txt.
Referenced by __construct().
assFormulaQuestionResult::setRangeMin | ( | $range_min | ) |
Definition at line 732 of file class.assFormulaQuestionResult.php.
References $range_min, and $result.
Referenced by __construct(), and suggestRange().
assFormulaQuestionResult::setRangeMinTxt | ( | $range_min_txt | ) |
Definition at line 913 of file class.assFormulaQuestionResult.php.
References $range_min_txt.
Referenced by __construct().
assFormulaQuestionResult::setRatingSign | ( | $rating_sign | ) |
Definition at line 853 of file class.assFormulaQuestionResult.php.
References $rating_sign.
assFormulaQuestionResult::setRatingSimple | ( | $rating_simple | ) |
Definition at line 843 of file class.assFormulaQuestionResult.php.
References $rating_simple.
assFormulaQuestionResult::setRatingUnit | ( | $rating_unit | ) |
Definition at line 873 of file class.assFormulaQuestionResult.php.
References $rating_unit.
assFormulaQuestionResult::setRatingValue | ( | $rating_value | ) |
Definition at line 863 of file class.assFormulaQuestionResult.php.
References $rating_value.
assFormulaQuestionResult::setResult | ( | $result | ) |
Definition at line 722 of file class.assFormulaQuestionResult.php.
References $result.
assFormulaQuestionResult::setResultType | ( | $a_result_type | ) |
Definition at line 893 of file class.assFormulaQuestionResult.php.
assFormulaQuestionResult::setTolerance | ( | $tolerance | ) |
Definition at line 803 of file class.assFormulaQuestionResult.php.
References $tolerance.
assFormulaQuestionResult::setUnit | ( | $unit | ) |
Definition at line 813 of file class.assFormulaQuestionResult.php.
References $unit.
assFormulaQuestionResult::substituteFormula | ( | $variables, | |
$results | |||
) |
Definition at line 74 of file class.assFormulaQuestionResult.php.
References $formula, $lng, $result, $results, getFormula(), getResult(), and ilUtil\sendFailure().
Referenced by calculateFormula(), findValidRandomVariables(), getReachedPoints(), getResultInfo(), isCorrect(), and suggestRange().
assFormulaQuestionResult::suggestRange | ( | $variables, | |
$results | |||
) |
Definition at line 202 of file class.assFormulaQuestionResult.php.
References $formula, $range_max, $range_min, $result, $results, ilMath\_div(), ilMath\_mul(), getPrecision(), getUnit(), setRangeMax(), setRangeMin(), and substituteFormula().
|
private |
Definition at line 33 of file class.assFormulaQuestionResult.php.
Referenced by getAvailableResultUnits().
|
private |
Definition at line 22 of file class.assFormulaQuestionResult.php.
Referenced by __construct(), calculateFormula(), findValidRandomVariables(), getFormula(), getReachedPoints(), getResultInfo(), isCorrect(), setFormula(), substituteFormula(), and suggestRange().
|
private |
Definition at line 27 of file class.assFormulaQuestionResult.php.
Referenced by __construct(), getPoints(), getReachedPoints(), getResultInfo(), and setPoints().
|
private |
Definition at line 28 of file class.assFormulaQuestionResult.php.
Referenced by __construct(), getPrecision(), and setPrecision().
|
private |
Definition at line 19 of file class.assFormulaQuestionResult.php.
Referenced by __construct(), getRangeMax(), setRangeMax(), and suggestRange().
|
private |
Definition at line 31 of file class.assFormulaQuestionResult.php.
Referenced by getRangeMaxTxt(), and setRangeMaxTxt().
|
private |
Definition at line 18 of file class.assFormulaQuestionResult.php.
Referenced by __construct(), getRangeMin(), setRangeMin(), and suggestRange().
|
private |
Definition at line 30 of file class.assFormulaQuestionResult.php.
Referenced by getRangeMinTxt(), and setRangeMinTxt().
|
private |
Definition at line 24 of file class.assFormulaQuestionResult.php.
Referenced by __construct(), getRatingSign(), and setRatingSign().
|
private |
Definition at line 23 of file class.assFormulaQuestionResult.php.
Referenced by __construct(), getRatingSimple(), and setRatingSimple().
|
private |
Definition at line 26 of file class.assFormulaQuestionResult.php.
Referenced by __construct(), getRatingUnit(), and setRatingUnit().
|
private |
Definition at line 25 of file class.assFormulaQuestionResult.php.
Referenced by __construct(), getRatingValue(), and setRatingValue().
|
private |
Definition at line 17 of file class.assFormulaQuestionResult.php.
Referenced by __construct(), calculateFormula(), convertDecimalToCoprimeFraction(), findValidRandomVariables(), getReachedPoints(), getResult(), getResultInfo(), isCorrect(), setRangeMax(), setRangeMin(), setResult(), substituteFormula(), and suggestRange().
|
private |
Definition at line 29 of file class.assFormulaQuestionResult.php.
Referenced by __construct(), and getResultType().
|
private |
Definition at line 20 of file class.assFormulaQuestionResult.php.
Referenced by __construct(), convertDecimalToCoprimeFraction(), getTolerance(), and setTolerance().
|
private |
Definition at line 21 of file class.assFormulaQuestionResult.php.
Referenced by __construct(), getReachedPoints(), getResultInfo(), getUnit(), isCorrect(), and setUnit().
const assFormulaQuestionResult::RESULT_CO_FRAC = 3 |
Definition at line 15 of file class.assFormulaQuestionResult.php.
Referenced by assFormulaQuestion\getBestSolution(), getReachedPoints(), isCorrect(), and assFormulaQuestion\substituteVariables().
const assFormulaQuestionResult::RESULT_DEC = 1 |
Definition at line 13 of file class.assFormulaQuestionResult.php.
Referenced by getReachedPoints(), isCorrect(), and assFormulaQuestion\substituteVariables().
const assFormulaQuestionResult::RESULT_FRAC = 2 |
Definition at line 14 of file class.assFormulaQuestionResult.php.
Referenced by assFormulaQuestion\getBestSolution(), getReachedPoints(), isCorrect(), and assFormulaQuestion\substituteVariables().
const assFormulaQuestionResult::RESULT_NO_SELECTION = 0 |
Definition at line 12 of file class.assFormulaQuestionResult.php.
Referenced by calculateFormula(), getReachedPoints(), isCorrect(), and assFormulaQuestion\substituteVariables().