public static function ShortAnswerResponse::fetchAllUnscoredAnswers in Quiz 6.3
Same name and namespace in other branches
- 6.6 question_types/short_answer/short_answer.classes.inc \ShortAnswerResponse::fetchAllUnscoredAnswers()
- 6.4 question_types/short_answer/short_answer.classes.inc \ShortAnswerResponse::fetchAllUnscoredAnswers()
- 6.5 question_types/short_answer/short_answer.classes.inc \ShortAnswerResponse::fetchAllUnscoredAnswers()
- 7.6 question_types/short_answer/short_answer.classes.inc \ShortAnswerResponse::fetchAllUnscoredAnswers()
- 7 question_types/short_answer/short_answer.classes.inc \ShortAnswerResponse::fetchAllUnscoredAnswers()
- 7.4 question_types/short_answer/short_answer.classes.inc \ShortAnswerResponse::fetchAllUnscoredAnswers()
Get all quiz scores that have not yet been evaluated.
Parameters
$count: Number of items to return (default: 50).
$offset: Where in the results we should start (default: 0).
Return value
Array of objects describing unanswered questions. Each object will have result_id, question_nid, and question_vid.
1 call to ShortAnswerResponse::fetchAllUnscoredAnswers()
- short_answer_view_unscored in question_types/
short_answer/ short_answer.admin.inc - Generate a view of all unscored answer questions.
File
- question_types/
short_answer/ short_answer.classes.inc, line 239 - The main classes for the short answer question type.
Class
- ShortAnswerResponse
- The short answer question response class.
Code
public static function fetchAllUnscoredAnswers($count = 50, $offset = 0) {
$sql = 'SELECT a.result_id, a.question_nid, a.question_vid, r.title, n.time_end, n.time_start, n.uid
FROM {quiz_short_answer_user_answers} AS a
INNER JOIN {node_revisions} AS r ON a.question_vid = r.vid
INNER JOIN {quiz_node_results} AS n ON a.result_id = n.result_id
WHERE a.is_evaluated = 0';
$results = db_query_range($sql, $offset, $count);
$unscored = array();
if ($results) {
while ($row = db_fetch_object($results)) {
$unscored[] = $row;
}
}
return $unscored;
}