dokeos-exercise
[ class tree: dokeos-exercise ] [ index: dokeos-exercise ] [ all elements ]

Class: Answer

Source Location: /main/exercice/answer.class.php

Class Overview


This class allows to instantiate an object of type Answer


Author(s):

  • Olivier Brouckaert

Version:

  • $Id: answer.class.php 13732 2007-11-21 15:19:33Z yannoo $

Variables

Methods


Child classes:

ImsAnswerMultipleChoice
This class allows to instantiate an object of type Answer
ImsAnswerFillInBlanks
This class allows to instantiate an object of type Answer
ImsAnswerMatching
This class allows to instantiate an object of type Answer
ImsAnswerHotspot
This class allows to instantiate an object of type Answer
ImsAnswerFree
This class allows to instantiate an object of type Answer
ScormAnswerMultipleChoice
This class handles the export to SCORM of a multiple choice question
ScormAnswerTrueFalse
This class handles the SCORM export of true/false questions
ScormAnswerFillInBlanks
This class handles the SCORM export of fill-in-the-blanks questions
ScormAnswerMatching
This class handles the SCORM export of matching questions
ScormAnswerFree
This class handles the SCORM export of free-answer questions
ScormAnswerHotspot
This class handles the SCORM export of hotpot questions

Class Details

[line 33]
This class allows to instantiate an object of type Answer

5 arrays are created to receive the attributes of each answer belonging to a specified question




Tags:

author:  Olivier Brouckaert
version:  $Id: answer.class.php 13732 2007-11-21 15:19:33Z yannoo $
filesource:  Source Code for this file


[ Top ]


Class Variables

$answer =

[line 38]


Type:   mixed


[ Top ]

$comment =

[line 40]


Type:   mixed


[ Top ]

$correct =

[line 39]


Type:   mixed


[ Top ]

$hotspot_coordinates =

[line 43]


Type:   mixed


[ Top ]

$hotspot_type =

[line 44]


Type:   mixed


[ Top ]

$nbrAnswers =

[line 56]


Type:   mixed


[ Top ]

$new_answer =

[line 48]


Type:   mixed


[ Top ]

$new_comment =

[line 50]


Type:   mixed


[ Top ]

$new_correct =

[line 49]


Type:   mixed


[ Top ]

$new_hotspot_coordinates =

[line 53]


Type:   mixed


[ Top ]

$new_hotspot_type =

[line 54]


Type:   mixed


[ Top ]

$new_nbrAnswers =

[line 57]


Type:   mixed


[ Top ]

$new_position =

[line 52]


Type:   mixed


[ Top ]

$new_weighting =

[line 51]


Type:   mixed


[ Top ]

$position =

[line 42]


Type:   mixed


[ Top ]

$questionId =

[line 35]


Type:   mixed


[ Top ]

$weighting =

[line 41]


Type:   mixed


[ Top ]



Class Methods


constructor Answer [line 65]

Answer Answer( integer $questionId)

constructor of the class



Tags:

author:  Olivier Brouckaert


Parameters:

integer   $questionId   Question ID that answers belong to

[ Top ]

method cancel [line 89]

void cancel( )

clears $new_* arrays



Tags:

author:  - Olivier Brouckaert


[ Top ]

method createAnswer [line 357]

void createAnswer( string $answer, integer $correct, string $comment, integer $weighting, integer $position, [coordinates $new_hotspot_coordinates = NULL], [integer $new_hotspot_type = NULL])

creates a new answer



Tags:

author:  Olivier Brouckaert


Parameters:

string   $answer   answer title
integer   $correct   0 if bad answer, not 0 if good answer
string   $comment   answer comment
integer   $weighting   answer weighting
integer   $position   answer position
coordinates   $new_hotspot_coordinates   Coordinates for hotspot exercises (optional)
integer   $new_hotspot_type   Type for hotspot exercises (optional)

[ Top ]

method duplicate [line 457]

void duplicate( - $newQuestionId)

duplicates answers by copying them into another question



Tags:

author:  - Olivier Brouckaert


Parameters:

-   $newQuestionId   integer $newQuestionId - ID of the new question

[ Top ]

method getAnswersList [line 221]

array getAnswersList( )

Returns a list of answers



Tags:

return:  List of answers where each answer is an array of (id, answer, comment, grade) and grade=weighting
author:  Yannick Warnier <ywarnier@beeznest.org>


[ Top ]

method getGradesList [line 244]

array getGradesList( )

Returns a list of grades



Tags:

return:  List of grades where grade=weighting (?)
author:  Yannick Warnier <ywarnier@beeznest.org>


[ Top ]

method getQuestionType [line 260]

integer getQuestionType( )

Returns the question type



Tags:

return:  The type of the question this answer is bound to
author:  Yannick Warnier <ywarnier@beeznest.org>


[ Top ]

method isCorrect [line 280]

- isCorrect( - $id)

tells if answer is correct or not



Tags:

return:  integer - 0 if bad answer, not 0 if good answer
author:  - Olivier Brouckaert


Parameters:

-   $id   integer $id - answer ID

[ Top ]

method read [line 107]

void read( )

reads answer informations from the data base



Tags:

author:  - Olivier Brouckaert


[ Top ]

method readOrderedBy [line 143]

void readOrderedBy( string $field, [string $order = ASC])

reads answer informations from the data base ordered by parameter



Tags:

author:  Frederic Vauthier


Parameters:

string   $field   Field we want to order by
string   $order   DESC or ASC

[ Top ]

method save [line 403]

void save( )

records answers into the data base



Tags:

author:  - Olivier Brouckaert


[ Top ]

method selectAnswer [line 211]

- selectAnswer( - $id)

returns the answer title



Tags:

return:  string - answer title
author:  - Olivier Brouckaert


Parameters:

-   $id   integer $id - answer ID

[ Top ]

method selectComment [line 292]

- selectComment( - $id)

returns answer comment



Tags:

return:  string - answer comment
author:  - Olivier Brouckaert


Parameters:

-   $id   integer $id - answer ID

[ Top ]

method selectHotspotCoordinates [line 328]

integer selectHotspotCoordinates( integer $id)

returns answer hotspot coordinates



Tags:

return:  Answer position
author:  Olivier Brouckaert


Parameters:

integer   $id   Answer ID

[ Top ]

method selectHotspotType [line 340]

integer selectHotspotType( integer $id)

returns answer hotspot type



Tags:

return:  Answer position
author:  Toon Keppens


Parameters:

integer   $id   Answer ID

[ Top ]

method selectNbrAnswers [line 188]

- selectNbrAnswers( )

returns the number of answers in this question



Tags:

return:  integer - number of answers
author:  - Olivier Brouckaert


[ Top ]

method selectPosition [line 316]

- selectPosition( - $id)

returns answer position



Tags:

return:  integer - answer position
author:  - Olivier Brouckaert


Parameters:

-   $id   integer $id - answer ID

[ Top ]

method selectQuestionId [line 199]

- selectQuestionId( )

returns the question ID which the answers belong to



Tags:

return:  integer - the question ID
author:  - Olivier Brouckaert


[ Top ]

method selectWeighting [line 304]

- selectWeighting( - $id)

returns answer weighting



Tags:

return:  integer - answer weighting
author:  - Olivier Brouckaert


Parameters:

-   $id   integer $id - answer ID

[ Top ]

method updateAnswers [line 381]

void updateAnswers( string $answer, string $comment, integer $weighting, integer $position)

updates an answer



Tags:

author:  Toon Keppens


Parameters:

string   $answer   Answer title
string   $comment   Answer comment
integer   $weighting   Answer weighting
integer   $position   Answer position

[ Top ]


Documentation generated on Thu, 12 Jun 2008 12:58:29 -0500 by phpDocumentor 1.4.1