Constructor instantiates all the neccessary objects for the quiz to function.
Parameters:
API Tags:
Redefined in descendants as:
boolean answerQuestion(
integer
$selectedAnswer
)
|
|
Takes the given option number an 'answers' the question with it.
The QuestionAnswered for the question is updated in the datastore.
Parameters:
integer |
$selectedAnswer: |
Selected Question Option. |
API Tags:
Return: | True on successful answering, false otherwise. |
Access: | public |
Information Tags:
Throws: | Exception 2 if there is no current question. |
Redefined in descendants as:
Returns an array where each element of the array is another hashed array of the format:
API Tags:
Return: | Correct Questions Count |
Access: | public |
string getCurrentQuestionBody(
)
|
|
Returns the body of the current question.
API Tags:
Return: | Question Body |
Access: | public |
Information Tags:
Throws: | Exception 2 if there is no current question. |
integer getCurrentQuestionNumber(
)
|
|
Returns the number of the current question.
That is, if 2 questions have been asked and answered, getCurrentQuestion() will return 3.
API Tags:
Return: | Question Number. |
Access: | public |
string getCurrentQuestionOption(
integer
$optionNumber
)
|
|
Returns the text of the given question option number
Parameters:
integer |
$optionNumber: |
Option Number |
API Tags:
Return: | Option Text |
Access: | public |
Information Tags:
Throws: | Exception 2 if there is no current question. |
Grabs the next question for asking.
API Tags:
Return: | True if successful |
Access: | public |
Information Tags:
Throws: | Exception 3 if there are no more questions. |
Throws: | Exception 1 if the current quesiton has not been answered yet. |
integer getQuestionsCorrectCount(
)
|
|
Returns the number of correctly answered questions for this quiz.
API Tags:
Return: | Correct Questions Count |
Access: | public |
integer getQuestionsCount(
)
|
|
Returns the total number of questions for this quiz.
API Tags:
Return: | Questions Count |
Access: | public |
integer getQuestionsIncorrectCount(
)
|
|
Returns the number of incorrectly answered questions for this quiz.
API Tags:
Return: | Incorrect Questions Count |
Access: | public |
Returns the title of the learning this quiz is part of.
API Tags:
Return: | Learning Title |
Access: | public |
boolean isCurrentQuestionOption(
$optionNumber
)
|
|
Returns true if there is text for the given option number
Parameters:
API Tags:
Return: | True if option is set, false otherwise. |
Access: | public |
Information Tags:
Throws: | Exception 2 if there is no current question. |
Randomizes the order in which the quiz questions are asked.
API Tags:
Return: | True on success, false otherwise. |
Access: | public |
boolean sortByDifficulty(
)
|
|
Randomizes the order in which the quiz questions are asked, but only within sets of difficutly.
API Tags:
Return: | True on success, false otherwise. |
Access: | public |