You are here

public static function ShortAnswerResponse::fetchUnscoredAnswersByQuestion in Quiz 6.3

Same name and namespace in other branches
  1. 6.6 question_types/short_answer/short_answer.classes.inc \ShortAnswerResponse::fetchUnscoredAnswersByQuestion()
  2. 6.4 question_types/short_answer/short_answer.classes.inc \ShortAnswerResponse::fetchUnscoredAnswersByQuestion()
  3. 6.5 question_types/short_answer/short_answer.classes.inc \ShortAnswerResponse::fetchUnscoredAnswersByQuestion()
  4. 7.6 question_types/short_answer/short_answer.classes.inc \ShortAnswerResponse::fetchUnscoredAnswersByQuestion()
  5. 7 question_types/short_answer/short_answer.classes.inc \ShortAnswerResponse::fetchUnscoredAnswersByQuestion()
  6. 7.4 question_types/short_answer/short_answer.classes.inc \ShortAnswerResponse::fetchUnscoredAnswersByQuestion()

Given a quiz, return a list of all of the unscored answers.

Parameters

$nid: Node ID for the quiz to check.

$vid: Version ID for the quiz to check.

$count: Number of items to return (default: 50).

$offset: Where in the results we should start (default: 0).

Return value

Indexed array of result IDs that need to be scored.

File

question_types/short_answer/short_answer.classes.inc, line 271
The main classes for the short answer question type.

Class

ShortAnswerResponse
The short answer question response class.

Code

public static function fetchUnscoredAnswersByQuestion($nid, $vid, $count = 50, $offset = 0) {
  $results = db_query_range('SELECT result_id FROM {quiz_short_answer_user_answers} WHERE is_evaluated = 0 AND question_nid = %d AND question_vid = %d', $nid, $vid, $offset, $count);
  $unscored = array();
  foreach (db_fetch_object($results) as $row) {
    $unscored[] = $row->result_id;
  }
  return $unscored;
}