ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilTestQuestionHeaderBlockBuilder Class Reference
+ Inheritance diagram for ilTestQuestionHeaderBlockBuilder:
+ Collaboration diagram for ilTestQuestionHeaderBlockBuilder:

Public Member Functions

 __construct (ilLanguage $lng)
 getHeaderMode ()
 setHeaderMode ($headerMode)
 getQuestionTitle ()
 setQuestionTitle ($questionTitle)
 getQuestionPoints ()
 setQuestionPoints ($questionPoints)
 getQuestionPosition ()
 setQuestionPosition ($questionPosition)
 getQuestionCount ()
 setQuestionCount ($questionCount)
 isQuestionPostponed ()
 setQuestionPostponed ($questionPostponed)
 isQuestionObligatory ()
 setQuestionObligatory ($questionObligatory)
 getQuestionRelatedObjectives ()
 setQuestionRelatedObjectives ($questionRelatedObjectives)
 getHTML ()
 Get the HTML representation of the header block.

Protected Member Functions

 buildQuestionPositionString ()
 buildQuestionPointsString ()
 buildQuestionPostponedString ()
 buildQuestionObligatoryString ()
 buildQuestionRelatedObjectivesString ()

Protected Attributes

 $lng
 $headerMode
 $questionTitle
 $questionPoints
 $questionPosition
 $questionCount
 $questionPostponed
 $questionObligatory
 $questionRelatedObjectives

Detailed Description

Definition at line 12 of file class.ilTestQuestionHeaderBlockBuilder.php.

Constructor & Destructor Documentation

ilTestQuestionHeaderBlockBuilder::__construct ( ilLanguage  $lng)

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

References $lng.

{
$this->lng = $lng;
$this->headerMode = null;
$this->questionTitle = '';
$this->questionPoints = 0.0;
$this->questionPosition = 0;
$this->questionCount = 0;
$this->questionPostponed = false;
$this->questionObligatory = false;
$this->questionRelatedObjectives = '';
}

Member Function Documentation

ilTestQuestionHeaderBlockBuilder::buildQuestionObligatoryString ( )
protected

Definition at line 231 of file class.ilTestQuestionHeaderBlockBuilder.php.

References isQuestionObligatory().

Referenced by getHTML().

{
if( $this->isQuestionObligatory() )
{
$obligatoryText = $this->lng->txt("tst_you_have_to_answer_this_question");
return '<br /><span class="obligatory" style="font-size:small">'.$obligatoryText.'</span>';
}
return '';
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestQuestionHeaderBlockBuilder::buildQuestionPointsString ( )
protected

Definition at line 211 of file class.ilTestQuestionHeaderBlockBuilder.php.

References getQuestionPoints().

Referenced by getHTML().

{
if( $this->getQuestionPoints() == 1 )
{
return " ({$this->getQuestionPoints()} {$this->lng->txt('point')})";
}
return " ({$this->getQuestionPoints()} {$this->lng->txt('points')})";
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestQuestionHeaderBlockBuilder::buildQuestionPositionString ( )
protected

Definition at line 201 of file class.ilTestQuestionHeaderBlockBuilder.php.

References getQuestionCount(), and getQuestionPosition().

Referenced by getHTML().

{
if( $this->getQuestionCount() )
{
return sprintf($this->lng->txt("tst_position"), $this->getQuestionPosition(), $this->getQuestionCount());
}
return sprintf($this->lng->txt("tst_position_without_total"), $this->getQuestionPosition());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestQuestionHeaderBlockBuilder::buildQuestionPostponedString ( )
protected

Definition at line 221 of file class.ilTestQuestionHeaderBlockBuilder.php.

References isQuestionPostponed().

Referenced by getHTML().

{
if( $this->isQuestionPostponed() )
{
return " <em>(" . $this->lng->txt("postponed") . ")</em>";
}
return '';
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestQuestionHeaderBlockBuilder::buildQuestionRelatedObjectivesString ( )
protected

Definition at line 242 of file class.ilTestQuestionHeaderBlockBuilder.php.

References getQuestionRelatedObjectives().

Referenced by getHTML().

{
if( strlen($this->getQuestionRelatedObjectives()) )
{
$label = $this->lng->txt('tst_res_lo_objectives_header');
return '<div class="ilTestQuestionRelatedObjectivesInfo">'.$label.': '.$this->getQuestionRelatedObjectives();
}
return '';
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestQuestionHeaderBlockBuilder::getHeaderMode ( )
Returns
int

Definition at line 76 of file class.ilTestQuestionHeaderBlockBuilder.php.

References $headerMode.

Referenced by getHTML().

{
}

+ Here is the caller graph for this function:

ilTestQuestionHeaderBlockBuilder::getHTML ( )

Get the HTML representation of the header block.

Returns
string

Implements ilQuestionHeaderBlockBuilder.

Definition at line 253 of file class.ilTestQuestionHeaderBlockBuilder.php.

References buildQuestionObligatoryString(), buildQuestionPointsString(), buildQuestionPositionString(), buildQuestionPostponedString(), buildQuestionRelatedObjectivesString(), and getHeaderMode().

{
$headerBlock = $this->buildQuestionPositionString();
switch( $this->getHeaderMode() )
{
case 1:
$headerBlock .= " - ".$this->getQuestionTitle();
$headerBlock .= $this->buildQuestionPostponedString();
$headerBlock .= $this->buildQuestionObligatoryString();
break;
case 2:
$headerBlock .= $this->buildQuestionPostponedString();
$headerBlock .= $this->buildQuestionObligatoryString();
break;
case 0:
default:
$headerBlock .= " - ".$this->getQuestionTitle();
$headerBlock .= $this->buildQuestionPostponedString();
$headerBlock .= $this->buildQuestionPointsString();
$headerBlock .= $this->buildQuestionObligatoryString();
}
$headerBlock .= $this->buildQuestionRelatedObjectivesString();
return $headerBlock;
}

+ Here is the call graph for this function:

ilTestQuestionHeaderBlockBuilder::getQuestionCount ( )
Returns
int

Definition at line 140 of file class.ilTestQuestionHeaderBlockBuilder.php.

References $questionCount.

Referenced by buildQuestionPositionString().

{
}

+ Here is the caller graph for this function:

ilTestQuestionHeaderBlockBuilder::getQuestionPoints ( )
Returns
float

Definition at line 108 of file class.ilTestQuestionHeaderBlockBuilder.php.

References $questionPoints.

Referenced by buildQuestionPointsString().

{
}

+ Here is the caller graph for this function:

ilTestQuestionHeaderBlockBuilder::getQuestionPosition ( )
Returns
int

Definition at line 124 of file class.ilTestQuestionHeaderBlockBuilder.php.

References $questionPosition.

Referenced by buildQuestionPositionString().

+ Here is the caller graph for this function:

ilTestQuestionHeaderBlockBuilder::getQuestionRelatedObjectives ( )
Returns
string

Definition at line 188 of file class.ilTestQuestionHeaderBlockBuilder.php.

References $questionRelatedObjectives.

Referenced by buildQuestionRelatedObjectivesString().

+ Here is the caller graph for this function:

ilTestQuestionHeaderBlockBuilder::getQuestionTitle ( )
Returns
string

Definition at line 92 of file class.ilTestQuestionHeaderBlockBuilder.php.

References $questionTitle.

{
}
ilTestQuestionHeaderBlockBuilder::isQuestionObligatory ( )
Returns
boolean

Definition at line 172 of file class.ilTestQuestionHeaderBlockBuilder.php.

References $questionObligatory.

Referenced by buildQuestionObligatoryString().

+ Here is the caller graph for this function:

ilTestQuestionHeaderBlockBuilder::isQuestionPostponed ( )
Returns
boolean

Definition at line 156 of file class.ilTestQuestionHeaderBlockBuilder.php.

References $questionPostponed.

Referenced by buildQuestionPostponedString().

+ Here is the caller graph for this function:

ilTestQuestionHeaderBlockBuilder::setHeaderMode (   $headerMode)
Parameters
int$headerMode

Definition at line 84 of file class.ilTestQuestionHeaderBlockBuilder.php.

References $headerMode.

{
$this->headerMode = $headerMode;
}
ilTestQuestionHeaderBlockBuilder::setQuestionCount (   $questionCount)
Parameters
int$questionCount

Definition at line 148 of file class.ilTestQuestionHeaderBlockBuilder.php.

References $questionCount.

{
$this->questionCount = $questionCount;
}
ilTestQuestionHeaderBlockBuilder::setQuestionObligatory (   $questionObligatory)
Parameters
boolean$questionObligatory

Definition at line 180 of file class.ilTestQuestionHeaderBlockBuilder.php.

References $questionObligatory.

{
$this->questionObligatory = $questionObligatory;
}
ilTestQuestionHeaderBlockBuilder::setQuestionPoints (   $questionPoints)
Parameters
float$questionPoints

Definition at line 116 of file class.ilTestQuestionHeaderBlockBuilder.php.

References $questionPoints.

{
$this->questionPoints = $questionPoints;
}
ilTestQuestionHeaderBlockBuilder::setQuestionPosition (   $questionPosition)
Parameters
int$questionPosition

Definition at line 132 of file class.ilTestQuestionHeaderBlockBuilder.php.

References $questionPosition.

{
$this->questionPosition = $questionPosition;
}
ilTestQuestionHeaderBlockBuilder::setQuestionPostponed (   $questionPostponed)
Parameters
boolean$questionPostponed

Definition at line 164 of file class.ilTestQuestionHeaderBlockBuilder.php.

References $questionPostponed.

{
$this->questionPostponed = $questionPostponed;
}
ilTestQuestionHeaderBlockBuilder::setQuestionRelatedObjectives (   $questionRelatedObjectives)
Parameters
string$questionRelatedObjectives

Definition at line 196 of file class.ilTestQuestionHeaderBlockBuilder.php.

References $questionRelatedObjectives.

{
$this->questionRelatedObjectives = $questionRelatedObjectives;
}
ilTestQuestionHeaderBlockBuilder::setQuestionTitle (   $questionTitle)
Parameters
string$questionTitle

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

References $questionTitle.

{
$this->questionTitle = $questionTitle;
}

Field Documentation

ilTestQuestionHeaderBlockBuilder::$headerMode
protected

Definition at line 22 of file class.ilTestQuestionHeaderBlockBuilder.php.

Referenced by getHeaderMode(), and setHeaderMode().

ilTestQuestionHeaderBlockBuilder::$lng
protected

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

Referenced by __construct().

ilTestQuestionHeaderBlockBuilder::$questionCount
protected
ilTestQuestionHeaderBlockBuilder::$questionObligatory
protected
ilTestQuestionHeaderBlockBuilder::$questionPoints
protected
ilTestQuestionHeaderBlockBuilder::$questionPosition
protected
ilTestQuestionHeaderBlockBuilder::$questionPostponed
protected
ilTestQuestionHeaderBlockBuilder::$questionRelatedObjectives
protected
ilTestQuestionHeaderBlockBuilder::$questionTitle
protected

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