ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
ASS_AnswerOrdering Class Reference

Class for ordering question answers. More...

+ Inheritance diagram for ASS_AnswerOrdering:
+ Collaboration diagram for ASS_AnswerOrdering:

Public Member Functions

 ASS_AnswerOrdering ( $answertext="", $random_id=0, $depth=0)
 ASS_AnswerOrdering constructor. More...
 
 getRandomID ()
 Returns the random ID of the answer. More...
 
 setRandomID ($random_id=0)
 Sets the random ID of the answer. More...
 
 getAdditionalOrderingFieldsByRandomId ($a_random_id)
 
 setAnswerId ($a_answer_id)
 
 getAnswerId ()
 
 setOrderingDepth ($a_ordering_depth)
 
 getOrderingDepth ()
 
- Public Member Functions inherited from ASS_AnswerSimple
 __construct ( $answertext="", $points=0.0, $order=0, $id=-1)
 ASS_AnswerSimple constructor. More...
 
 getId ()
 Gets the answer id. More...
 
 getAnswertext ()
 Gets the answer text. More...
 
 getPoints ()
 Gets the points. More...
 
 checkPoints ($a_points)
 Checks, if the point value is numeric. More...
 
 getOrder ()
 Gets the sort/display order. More...
 
 setOrder ($order=0)
 Sets the order. More...
 
 setId ($id=-1)
 Sets the answer id. More...
 
 setAnswertext ($answertext="")
 Sets the answer text. More...
 
 setPoints ($points=0.0)
 Sets the points. More...
 

Data Fields

 $answer_id = 0
 
 $ordering_depth = 0
 

Protected Attributes

 $random_id
 
- Protected Attributes inherited from ASS_AnswerSimple
 $answertext
 
 $points
 
 $order
 
 $id
 

Detailed Description

Class for ordering question answers.

ASS_AnswerOrdering is a class for ordering question answers used in ordering questions.

Author
Helmut Schottmüller helmu.nosp@m.t.sc.nosp@m.hottm.nosp@m.uell.nosp@m.er@ma.nosp@m.c.co.nosp@m.m
Version
$Id$
See also
ASS_AnswerSimple

Definition at line 17 of file class.assAnswerOrdering.php.

Member Function Documentation

◆ ASS_AnswerOrdering()

ASS_AnswerOrdering::ASS_AnswerOrdering (   $answertext = "",
  $random_id = 0,
  $depth = 0 
)

ASS_AnswerOrdering constructor.

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

Parameters
string$answertextA string defining the answer text
integer$random_idA random ID public

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

References ASS_AnswerSimple\$answertext, $random_id, setOrderingDepth(), and setRandomID().

42  {
43  parent::__construct($answertext, 0, 0);
44  $this->setRandomID($random_id);
45  $this->setOrderingDepth($depth);
46  }
setRandomID($random_id=0)
Sets the random ID of the answer.
setOrderingDepth($a_ordering_depth)
+ Here is the call graph for this function:

◆ getAdditionalOrderingFieldsByRandomId()

ASS_AnswerOrdering::getAdditionalOrderingFieldsByRandomId (   $a_random_id)

Definition at line 71 of file class.assAnswerOrdering.php.

References $ilDB, $res, $row, setAnswerId(), and setOrderingDepth().

72  {
73  global $ilDB;
74 
75  $res = $ilDB->queryF('SELECT * FROM qpl_a_ordering WHERE random_id = %s',
76  array('integer'), array($a_random_id));
77 
78  while($row = $ilDB->fetchAssoc($res))
79  {
80  $this->setAnswerId($row['answer_id']);
81  $this->setOrderingDepth($row['depth']);
82 }
83  }
setOrderingDepth($a_ordering_depth)
global $ilDB
+ Here is the call graph for this function:

◆ getAnswerId()

ASS_AnswerOrdering::getAnswerId ( )

Definition at line 89 of file class.assAnswerOrdering.php.

References $answer_id.

90  {
91  return $this->answer_id;
92  }

◆ getOrderingDepth()

ASS_AnswerOrdering::getOrderingDepth ( )

Definition at line 98 of file class.assAnswerOrdering.php.

References $ordering_depth.

99  {
100  return $this->ordering_depth;
101  }

◆ getRandomID()

ASS_AnswerOrdering::getRandomID ( )

Returns the random ID of the answer.

Returns
integer Random ID
See also
$random_id

Definition at line 55 of file class.assAnswerOrdering.php.

References $random_id.

56  {
57  return $this->random_id;
58  }

◆ setAnswerId()

ASS_AnswerOrdering::setAnswerId (   $a_answer_id)

Definition at line 85 of file class.assAnswerOrdering.php.

Referenced by getAdditionalOrderingFieldsByRandomId().

86  {
87  $this->answer_id = $a_answer_id;
88  }
+ Here is the caller graph for this function:

◆ setOrderingDepth()

ASS_AnswerOrdering::setOrderingDepth (   $a_ordering_depth)

Definition at line 94 of file class.assAnswerOrdering.php.

Referenced by ASS_AnswerOrdering(), and getAdditionalOrderingFieldsByRandomId().

95  {
96  $this->ordering_depth = (int)$a_ordering_depth;
97  }
+ Here is the caller graph for this function:

◆ setRandomID()

ASS_AnswerOrdering::setRandomID (   $random_id = 0)

Sets the random ID of the answer.

Parameters
integer$random_idA random integer value
See also
$random_id

Definition at line 66 of file class.assAnswerOrdering.php.

References $random_id.

Referenced by ASS_AnswerOrdering().

67  {
68  $this->random_id = $random_id;
69  }
+ Here is the caller graph for this function:

Field Documentation

◆ $answer_id

ASS_AnswerOrdering::$answer_id = 0

Definition at line 25 of file class.assAnswerOrdering.php.

Referenced by getAnswerId().

◆ $ordering_depth

ASS_AnswerOrdering::$ordering_depth = 0

Definition at line 26 of file class.assAnswerOrdering.php.

Referenced by getOrderingDepth().

◆ $random_id

ASS_AnswerOrdering::$random_id
protected

Definition at line 23 of file class.assAnswerOrdering.php.

Referenced by ASS_AnswerOrdering(), getRandomID(), and setRandomID().


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