Public Member Functions | Data Fields

ASS_AnswerMultipleResponse Class Reference
[Modules/TestQuestionPool]

Class for true/false or yes/no answers. More...

Inheritance diagram for ASS_AnswerMultipleResponse:
Collaboration diagram for ASS_AnswerMultipleResponse:

Public Member Functions

 ASS_AnswerMultipleResponse ($answertext="", $points_checked=0.0, $order=0, $points_unchecked=0, $id=-1)
 ASS_AnswerMultipleResponse constructor.
 getPointsUnchecked ()
 Returns the points for an unchecked answer.
 setPointsUnchecked ($points_unchecked=0.0)
 Sets the points for an unchecked answer.
 setPointsChecked ($points_checked)
 getPointsChecked ()

Data Fields

 $points_unchecked

Detailed Description

Class for true/false or yes/no answers.

ASS_AnswerMultipleResponse is a class for answers with a binary state indicator (checked/unchecked, set/unset)

Author:
Helmut Schottmüller <helmut.schottmueller@mac.com>
Version:
Id:
class.assAnswerMultipleResponse.php 15412 2007-11-25 23:04:39Z hschottm
See also:
ASS_AnswerSimple

Definition at line 37 of file class.assAnswerMultipleResponse.php.


Member Function Documentation

ASS_AnswerMultipleResponse::ASS_AnswerMultipleResponse ( answertext = "",
points_checked = 0.0,
order = 0,
points_unchecked = 0,
id = -1 
)

ASS_AnswerMultipleResponse constructor.

The constructor takes possible arguments an creates an instance of the ASS_AnswerMultipleResponse object.

Parameters:
string $answertext A string defining the answer text
double $points The number of points given for the selected answer
double $points_unchecked The points when the answer is not checked
integer $order A nonnegative value representing a possible display or sort order public

Definition at line 58 of file class.assAnswerMultipleResponse.php.

References ASS_AnswerSimple::$answertext, ASS_AnswerSimple::$id, ASS_AnswerSimple::$order, $points_unchecked, and ASS_AnswerSimple::ASS_AnswerSimple().

Referenced by ASS_AnswerMultipleResponseImage::ASS_AnswerMultipleResponseImage().

  {
    $this->ASS_AnswerSimple($answertext, $points_checked, $order, $id);
    $this->points_unchecked = $points_unchecked;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

ASS_AnswerMultipleResponse::getPointsChecked (  ) 

Definition at line 118 of file class.assAnswerMultipleResponse.php.

References ASS_AnswerSimple::getPoints().

        {
                return $this->getPoints();
        }

Here is the call graph for this function:

ASS_AnswerMultipleResponse::getPointsUnchecked (  ) 

Returns the points for an unchecked answer.

Returns the points for an unchecked answer

Returns:
double The points for an unchecked answer public
See also:
$points_unchecked

Definition at line 80 of file class.assAnswerMultipleResponse.php.

                                {
                if (round($this->points_unchecked) == $this->points_unchecked)
                {
                        return sprintf("%d", $this->points_unchecked);
                }
                else
                {
                        return $this->points_unchecked;
                }
  }

ASS_AnswerMultipleResponse::setPointsChecked ( points_checked  ) 

Definition at line 113 of file class.assAnswerMultipleResponse.php.

References ASS_AnswerSimple::setPoints().

        {
                $this->setPoints($points_checked);
        }

Here is the call graph for this function:

ASS_AnswerMultipleResponse::setPointsUnchecked ( points_unchecked = 0.0  ) 

Sets the points for an unchecked answer.

Sets the points for an unchecked answer

Parameters:
double $points_unchecked The points for an unchecked answer public
See also:
$state

Definition at line 100 of file class.assAnswerMultipleResponse.php.

References $points_unchecked, and ASS_AnswerSimple::checkPoints().

  {
                $new_points = str_replace(",", ".", $points_unchecked);
                if ($this->checkPoints($new_points))
                {
                        $this->points_unchecked = $new_points;
                }
                else
                {
                        $this->points_unchecked = 0.0;
                }
  }

Here is the call graph for this function:


Field Documentation

ASS_AnswerMultipleResponse::$points_unchecked

The documentation for this class was generated from the following file: