phpDocumentor KuoteObjects
Question
[ class tree: KuoteObjects ] [ index: KuoteObjects ] [ all elements ]

Class: KuoteObjects_Question

Source Location: /classes/KuoteObjects/Question.php

Class KuoteObjects_Question

Class Overview

Implements interfaces:

KuoteObjects Question

The KuoteObjects Question represents a single question that is part of a Learning's quiz in the Kuote system. It must implement the interfaces KuoteInterfaces_Object, and KuoteInterfaces_Question

Located in /classes/KuoteObjects/Question.php [line 20]



		
				Author(s):
		
  • Kyle Hall
Information Tags:
Copyright:  2006

Properties

Methods

[ Top ]
Property Summary
mixed   $question   Private variable to contain a DB_DataObjects object derived from MySQL or another DB.

[ Top ]
Method Summary
static integer   getNextQuestionNumber()   Returns the question number that should be used for a new question for the given learning.
KuoteObjects_Question   __construct()   Constructor instantiates $enrollment as a DataObjects_Enrollment object.
boolean   delete()   Removes the object from the datastore based on it's Id
boolean   get()   Loads the object from the data store by its unique identifier.
integer   getAnswer()   Returns the option number of the correct question option.
string   getBody()   Returns the "question" for this question.
integer   getDifficulty()   Returns the difficulty of the question. 1 is easiest, 5 is hardest.
integer   getId()   Returns the unique id of the object
integer   getLearningId()   Returns the Id of the learning under which this question exists.
string   getOption()   Returns the "answer" for the given Option Number
string   getOption1()   Returns the text of the questions first option.
string   getOption2()   Returns the text of the questions second option.
string   getOption3()   Returns the text of the questions third option.
string   getOption4()   Returns the text of the questions fourth option.
string   getOption5()   Returns the text of the questions fifth option.
integer   getQuestionNumber()   Returns the order number of the question. First question is 1, second question is 2, etc.
integer   getTime()   Returns the amount of time given in seconds to answer this question. 0 is unlimited.
boolean   insert()   Takes the currently set properties of the object and inserts them into the data store as a new instance with its own unique id.
boolean   setAnswer()   Sets the option number of the correct question option.
boolean   setBody()   Sets the "question" for this question.
boolean   setDifficulty()   Sets the difficulty of the question. 1 is easiest, 5 is hardest.
boolean   setLearningId()   Sets the Id of the learning under which this question exists.
boolean   setOption()   Sets the "answer" for the given option number to the given string.
boolean   setOption1()   Sets the text of the questions first option.
boolean   setOption2()   Sets the text of the questions second option.
boolean   setOption3()   Sets the text of the questions third option.
boolean   setOption4()   Sets the text of the questions forth option.
boolean   setOption5()   Sets the text of the questions fifth option.
boolean   setQuestionNumber()   Sets the order number of the question. First question is 1, second question is 2, etc.
boolean   setTime()   Sets the amount of time given in seconds to answer this question. 0 is unlimited.
boolean   update()   Updates the datastore to reflect the currently set properties of the object.

[ Top ]
Properties
mixed   $question [line 25]

Private variable to contain a DB_DataObjects object derived from MySQL or another DB.

API Tags:
Access:  protected


[ Top ]
Methods
static method getNextQuestionNumber  [line 366]

  static integer getNextQuestionNumber( integer $learningId  )

Returns the question number that should be used for a new question for the given learning.

i.e. If there are five question, getNextQuestionNumber() will return an integer 6.

Parameters:
integer   $learningId:  Learning Id

API Tags:
Return:  Question Number
Access:  public


[ Top ]
Constructor __construct  [line 31]

  KuoteObjects_Question __construct( )

Constructor instantiates $enrollment as a DataObjects_Enrollment object.


API Tags:
Access:  public

Information Tags:
Link:  http://pear.php.net/package/DB_DataObject/

[ Top ]
delete  [line 70]

  boolean delete( )

Removes the object from the datastore based on it's Id


API Tags:
Return:  True on success, false otherwise.
Access:  public


[ Top ]
get  [line 41]

  boolean get( integer $id  )

Loads the object from the data store by its unique identifier.

Parameters:
integer   $id:  Unique identifier of a course in the data store.

API Tags:
Return:  True on success, false otherwise.
Access:  public


[ Top ]
getAnswer  [line 193]

  integer getAnswer( )

Returns the option number of the correct question option.


API Tags:
Return:  Option number.
Access:  public


[ Top ]
getBody  [line 155]

  string getBody( )

Returns the "question" for this question.


API Tags:
Return:  Question Body.
Access:  public


[ Top ]
getDifficulty  [line 250]

  integer getDifficulty( )

Returns the difficulty of the question. 1 is easiest, 5 is hardest.


API Tags:
Return:  Question Difficulty
Access:  public


[ Top ]
getId  [line 79]

  integer getId( )

Returns the unique id of the object


API Tags:
Return:  The objects's unique id
Access:  public


[ Top ]
getLearningId  [line 212]

  integer getLearningId( )

Returns the Id of the learning under which this question exists.


API Tags:
Return:  Learning Id
Access:  public


[ Top ]
getOption  [line 90]

  string getOption( integer $optionNumber  )

Returns the "answer" for the given Option Number

Parameters:
integer   $optionNumber:  The number of the option to return, 1 through 5 are valid.

API Tags:
Return:  The "answer" for the given Option Number.
Access:  public

Information Tags:
Throws:  Exception 1 if $optionNumber is out of bounds.

[ Top ]
getOption1  [line 269]

  string getOption1( )

Returns the text of the questions first option.


API Tags:
Return:  Question Option
Access:  public


[ Top ]
getOption2  [line 288]

  string getOption2( )

Returns the text of the questions second option.


API Tags:
Return:  Question Option
Access:  public


[ Top ]
getOption3  [line 307]

  string getOption3( )

Returns the text of the questions third option.


API Tags:
Return:  Question Option
Access:  public


[ Top ]
getOption4  [line 326]

  string getOption4( )

Returns the text of the questions fourth option.


API Tags:
Return:  Question Option
Access:  public


[ Top ]
getOption5  [line 345]

  string getOption5( )

Returns the text of the questions fifth option.


API Tags:
Return:  Question Option
Access:  public


[ Top ]
getQuestionNumber  [line 231]

  integer getQuestionNumber( )

Returns the order number of the question. First question is 1, second question is 2, etc.


API Tags:
Return:  Question Number
Access:  public


[ Top ]
getTime  [line 174]

  integer getTime( )

Returns the amount of time given in seconds to answer this question. 0 is unlimited.


API Tags:
Return:  Time in seconds.
Access:  public


[ Top ]
insert  [line 51]

  boolean insert( )

Takes the currently set properties of the object and inserts them into the data store as a new instance with its own unique id.


API Tags:
Return:  True on success, false otherwise.
Access:  public


[ Top ]
setAnswer  [line 203]

  boolean setAnswer( integer $answer  )

Sets the option number of the correct question option.

Parameters:
integer   $answer:  Correct Option Number

API Tags:
Return:  True on successful set, false otherwise.
Access:  public


[ Top ]
setBody  [line 165]

  boolean setBody( string $body  )

Sets the "question" for this question.

Parameters:
string   $body:  Question Body.

API Tags:
Return:  True on successful set, false otherwise.
Access:  public


[ Top ]
setDifficulty  [line 260]

  boolean setDifficulty( $difficulty, integer $difficutly  )

Sets the difficulty of the question. 1 is easiest, 5 is hardest.

Parameters:
integer   $difficutly:  Question Difficutly
   $difficulty: 

API Tags:
Return:  True on successful set, false otherwise.
Access:  public


[ Top ]
setLearningId  [line 222]

  boolean setLearningId( integer $id  )

Sets the Id of the learning under which this question exists.

Parameters:
integer   $id:  Learning Id

API Tags:
Return:  True on successful set, false otherwise.
Access:  public


[ Top ]
setOption  [line 126]

  boolean setOption( integer $optionNumber, string $string  )

Sets the "answer" for the given option number to the given string.

Parameters:
integer   $optionNumber:  The number of the option to set, 1 through 5 are valid.
string   $string:  The string which is to be the "answer".

API Tags:
Return:  True on success, false otherwise.
Access:  public

Information Tags:
Throws:  Exception 1 if optionNumber is out of bounds.

[ Top ]
setOption1  [line 279]

  boolean setOption1( string $string  )

Sets the text of the questions first option.

Parameters:
string   $string:  Question Option

API Tags:
Return:  True on successful set, false otherwise.
Access:  public


[ Top ]
setOption2  [line 298]

  boolean setOption2( string $string  )

Sets the text of the questions second option.

Parameters:
string   $string:  Question Option

API Tags:
Return:  True on successful set, false otherwise.
Access:  public


[ Top ]
setOption3  [line 317]

  boolean setOption3( string $string  )

Sets the text of the questions third option.

Parameters:
string   $string:  Question Option

API Tags:
Return:  True on successful set, false otherwise.
Access:  public


[ Top ]
setOption4  [line 336]

  boolean setOption4( string $string  )

Sets the text of the questions forth option.

Parameters:
string   $string:  Question Option

API Tags:
Return:  True on successful set, false otherwise.
Access:  public


[ Top ]
setOption5  [line 355]

  boolean setOption5( string $string  )

Sets the text of the questions fifth option.

Parameters:
string   $string:  Question Option

API Tags:
Return:  True on successful set, false otherwise.
Access:  public


[ Top ]
setQuestionNumber  [line 241]

  boolean setQuestionNumber( $number, integer $id  )

Sets the order number of the question. First question is 1, second question is 2, etc.

Parameters:
integer   $id:  Learning Id
   $number: 

API Tags:
Return:  True on successful set, false otherwise.
Access:  public


[ Top ]
setTime  [line 184]

  boolean setTime( integer $time  )

Sets the amount of time given in seconds to answer this question. 0 is unlimited.

Parameters:
integer   $time:  Time in seconds.

API Tags:
Return:  True on successful set, false otherwise.
Access:  public


[ Top ]
update  [line 61]

  boolean update( )

Updates the datastore to reflect the currently set properties of the object.

Updates by the current Id.


API Tags:
Return:  True on success, false otherwise.
Access:  public


[ Top ]

Documentation generated on Fri, 15 Dec 2006 11:18:19 -0500 by phpDocumentor 1.3.0