class QuizDirectionsResponse in Quiz 7.6
Same name and namespace in other branches
- 6.6 question_types/quiz_directions/quiz_directions.classes.inc \QuizDirectionsResponse
- 6.3 question_types/quiz_directions/quiz_directions.classes.inc \QuizDirectionsResponse
- 6.4 question_types/quiz_directions/quiz_directions.classes.inc \QuizDirectionsResponse
- 6.5 question_types/quiz_directions/quiz_directions.classes.inc \QuizDirectionsResponse
- 7 question_types/quiz_directions/quiz_directions.classes.inc \QuizDirectionsResponse
- 7.4 question_types/quiz_directions/quiz_directions.classes.inc \QuizDirectionsResponse
- 7.5 question_types/quiz_directions/quiz_directions.classes.inc \QuizDirectionsResponse
Extension of QuizQuestionResponse
Hierarchy
- class \QuizQuestionResponse
- class \QuizDirectionsResponse
Expanded class hierarchy of QuizDirectionsResponse
1 string reference to 'QuizDirectionsResponse'
- quiz_directions_quiz_question_info in question_types/
quiz_directions/ quiz_directions.module - Implements hook_quiz_question_info().
File
- question_types/
quiz_directions/ quiz_directions.classes.inc, line 95 - quiz_directions.classes
View source
class QuizDirectionsResponse extends QuizQuestionResponse {
/**
* Implementation of save
*
* @see QuizQuestionResponse#save()
*/
public function save() {
}
/**
* Implementation of delete
*
* @see QuizQuestionResponse#delete()
*/
public function delete() {
}
/**
* Implementation of score
*
* @see QuizQuestionResponse#score()
*/
public function score() {
// First, due to popular demand, if the directions are at the beginning of
// the quiz, we restart the timer after the user has read the question.
$quiz_nid = arg(1);
$quiz_key = 'quiz_' . $quiz_nid;
if (isset($_SESSION[$quiz_key]['previous_quiz_questions']) && count($_SESSION[$quiz_key]['previous_quiz_questions']) === 1) {
// reset the timer.
$sql = 'UPDATE {quiz_node_results} SET time_start=%d WHERE result_id = %d';
// TODO Please review the conversion of this statement to the D7 database API syntax.
/* db_query($sql, REQUEST_TIME, $this->result_id) */
db_update('quiz_node_results')
->fields(array(
'time_start' => REQUEST_TIME,
))
->condition('result_id', $this->result_id)
->execute();
}
// Set the score
$this->score = 0;
return 0;
}
/**
* Implementation of isCorrect
*
* @see QuizQuestionResponse#isCorrect()
*/
public function isCorrect() {
return TRUE;
}
/**
* Implementation of getResponse
*
* @see QuizQuestionResponse#getResponse()
*/
public function getResponse() {
return $this->answer;
}
/**
* Implementation of getReportForm
*
* @see QuizQuestionResponse#getReportForm()
*/
public function getReportForm() {
return array(
'#no_report' => TRUE,
);
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
QuizDirectionsResponse:: |
public | function |
Implementation of delete Overrides QuizQuestionResponse:: |
|
QuizDirectionsResponse:: |
public | function |
Implementation of getReportForm Overrides QuizQuestionResponse:: |
|
QuizDirectionsResponse:: |
public | function |
Implementation of getResponse Overrides QuizQuestionResponse:: |
|
QuizDirectionsResponse:: |
public | function |
Implementation of isCorrect Overrides QuizQuestionResponse:: |
|
QuizDirectionsResponse:: |
public | function |
Implementation of save Overrides QuizQuestionResponse:: |
|
QuizDirectionsResponse:: |
public | function |
Implementation of score Overrides QuizQuestionResponse:: |
|
QuizQuestionResponse:: |
protected | property | ||
QuizQuestionResponse:: |
protected | property | ||
QuizQuestionResponse:: |
protected | property | ||
QuizQuestionResponse:: |
public | property | ||
QuizQuestionResponse:: |
public | property | ||
QuizQuestionResponse:: |
public | property | ||
QuizQuestionResponse:: |
public | property | ||
QuizQuestionResponse:: |
protected | property | ||
QuizQuestionResponse:: |
protected | property | 8 | |
QuizQuestionResponse:: |
public | function | Can the quiz taker view the requested review? | |
QuizQuestionResponse:: |
public | function | Returns a renderable array of question feedback. | |
QuizQuestionResponse:: |
public | function | Get the response part of the report form | 6 |
QuizQuestionResponse:: |
protected | function | Utility function that returns the format of the node body | |
QuizQuestionResponse:: |
public | function | Returns stored max score if it exists, if not the max score is calculated and returned. | |
QuizQuestionResponse:: |
function | |||
QuizQuestionResponse:: |
public | function | Get data suitable for reporting a user's score on the question. This expects an object with the following attributes: | |
QuizQuestionResponse:: |
public | function | 2 | |
QuizQuestionResponse:: |
public | function | Implementation of getReportFormScore | |
QuizQuestionResponse:: |
public | function | Get the submit function for the reportForm | 2 |
QuizQuestionResponse:: |
public | function | Get the validate function for the reportForm | 2 |
QuizQuestionResponse:: |
function | Returns stored score if it exists, if not the score is calculated and returned. | ||
QuizQuestionResponse:: |
public | function | Indicate whether the response has been evaluated (scored) yet. Questions that require human scoring (e.g. essays) may need to manually toggle this. | |
QuizQuestionResponse:: |
public | function | Validates response from a quiz taker. If the response isn't valid the quiz taker won't be allowed to proceed. | |
QuizQuestionResponse:: |
public | function | Used to refresh this instances question node in case drupal has changed it. | |
QuizQuestionResponse:: |
public | function | Set the target result ID for this Question response. | |
QuizQuestionResponse:: |
function | Represent the response as a stdClass object. | ||
QuizQuestionResponse:: |
public | function | Create a new user response. | 6 |