138 return is_numeric($a_points);
212 $new_points = str_replace(
",",
".",
$points);
214 $this->points = $new_points;
224 ): array|float|bool|
int|string|null
227 'id' => $transformations->
normalize(
new Id($this->
id,
'answer')),
241 $transformations->
string($normalized[
'answertext']),
242 $transformations->
float($normalized[
'points']),
243 $transformations->
int($normalized[
'order']),
244 $transformations->
denormalize($normalized[
'id'], Id::class)->getId()
Class for simple answers.
setOrder($order=0)
Sets the order.
__construct($answertext="", $points=0.0, $order=0, $id=-1)
ASS_AnswerSimple constructor.
getOrder()
Gets the sort/display order.
getPoints()
Gets the points.
checkPoints($a_points)
Checks, if the point value is numeric.
setId($id=-1)
Sets the answer id.
getId()
Gets the answer id.
fromNormalized(array $normalized, Transformations $transformations)
Restore the object from its normalized representation.
setAnswertext($answertext="")
Sets the answer text.
setPoints($points=0.0)
Sets the points.
toNormalized(Transformations $transformations, array $context=[])
Convert the internal state of the implementing object into a language-neutral array structure.
getAnswertext()
Gets the answer text.
Wrapper object for an object identifier and an optional object type the identifier belongs to.