Public Member Functions | Data Fields

ASS_AnswerTrueFalse Class Reference

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

Inheritance diagram for ASS_AnswerTrueFalse:
Collaboration diagram for ASS_AnswerTrueFalse:

Public Member Functions

 ASS_AnswerTrueFalse ($answertext="", $points=0.0, $order=0, $correctness=FALSE)
 ASS_AnswerTrueFalse constructor.
 getCorrectness ()
 Gets the correctness.
 isCorrect ()
 Gets the correctness.
 isTrue ()
 Gets the correctness.
 isIncorrect ()
 Gets the correctness.
 isFalse ()
 Gets the correctness.
 setCorrectness ($correctness=FALSE)
 Sets the correctness.
 setTrue ()
 Sets the answer as a correct answer.
 setFalse ()
 Sets the answer as a incorrect answer.

Data Fields

 $correctness

Detailed Description

Class for true/false or yes/no answers.

ASS_AnswerTrueFalse is a class for true/false or yes/no answers used for example in multiple choice tests.

Author:
Helmut Schottmüller <helmut.schottmueller@mac.com>
Version:
Id:
class.assAnswerTrueFalse.php 10512 2006-04-11 16:08:35Z hschottm

class.assAnswerTrueFalse.php Assessment

See also:
ASS_AnswerSimple

Definition at line 38 of file class.assAnswerTrueFalse.php.


Member Function Documentation

ASS_AnswerTrueFalse::ASS_AnswerTrueFalse ( answertext = "",
points = 0.0,
order = 0,
correctness = FALSE 
)

ASS_AnswerTrueFalse constructor.

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

Parameters:
string $answertext A string defining the answer text
double $points The number of points given for the selected answer
boolean $correctness A boolean value indicating the correctness of the answer
integer $order A nonnegative value representing a possible display or sort order public

Definition at line 59 of file class.assAnswerTrueFalse.php.

References ASS_AnswerSimple::$answertext, $correctness, ASS_AnswerSimple::$order, ASS_AnswerSimple::$points, and ASS_AnswerSimple::ASS_AnswerSimple().

  {
    $this->ASS_AnswerSimple($answertext, $points, $order);
        // force $this->correctness to be a string
        // ilDB->quote makes 1 from true and saving it to ENUM('1','0') makes that '0'!!!
        // (maybe that only happens for certain mysql versions)
    $this->correctness = $correctness."";
  }

Here is the call graph for this function:

ASS_AnswerTrueFalse::getCorrectness (  ) 

Gets the correctness.

Returns the correctness of the answer

Returns:
boolean correctness public
See also:
$correctness

Definition at line 83 of file class.assAnswerTrueFalse.php.

                            {
    return $this->correctness;
  }

ASS_AnswerTrueFalse::isCorrect (  ) 

Gets the correctness.

Returns TRUE if the answer is correct

Returns:
boolean correctness public
See also:
$correctness

Definition at line 96 of file class.assAnswerTrueFalse.php.

                       {
    return $this->correctness;
  }

ASS_AnswerTrueFalse::isFalse (  ) 

Gets the correctness.

Returns TRUE if the answer is incorrect

Returns:
boolean correctness public
See also:
$correctness

Definition at line 135 of file class.assAnswerTrueFalse.php.

                     {
    return !$this->correctness;
  }

ASS_AnswerTrueFalse::isIncorrect (  ) 

Gets the correctness.

Returns TRUE if the answer is incorrect

Returns:
boolean correctness public
See also:
$correctness

Definition at line 122 of file class.assAnswerTrueFalse.php.

                         {
    return !$this->correctness;
  }

ASS_AnswerTrueFalse::isTrue (  ) 

Gets the correctness.

Returns TRUE if the answer is correct

Returns:
boolean correctness public
See also:
$correctness

Definition at line 109 of file class.assAnswerTrueFalse.php.

                    {
    return $this->correctness;
  }

ASS_AnswerTrueFalse::setCorrectness ( correctness = FALSE  ) 

Sets the correctness.

Sets the correctness of the answer using TRUE or FALSE values to indicate that the answer is correct or incorrect.

Parameters:
boolean $correctness A boolean value indicating the correctness of the answer public
See also:
$correctness

Definition at line 149 of file class.assAnswerTrueFalse.php.

References $correctness.

  {
        // force $this->correctness to be a string
        // ilDB->quote makes 1 from true and saving it to ENUM('1','0') makes that '0'!!!
        // (maybe that only happens for certain mysql versions)
    $this->correctness = $correctness."";
  }

ASS_AnswerTrueFalse::setFalse (  ) 

Sets the answer as a incorrect answer.

Sets the correctness value of the answer to FALSE

public

See also:
$correctness

Definition at line 177 of file class.assAnswerTrueFalse.php.

                      {
    $this->correctness = "0";
  }

ASS_AnswerTrueFalse::setTrue (  ) 

Sets the answer as a correct answer.

Sets the correctness value of the answer to TRUE

public

See also:
$correctness

Definition at line 165 of file class.assAnswerTrueFalse.php.

                     {
    $this->correctness = "1";
  }


Field Documentation

ASS_AnswerTrueFalse::$correctness

Definition at line 46 of file class.assAnswerTrueFalse.php.

Referenced by ASS_AnswerTrueFalse(), and setCorrectness().


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