You are here

public static function LongAnswerResponse::fetchUnscoredAnswersByQuestion in Quiz 7.4

Same name and namespace in other branches
  1. 6.6 question_types/long_answer/long_answer.classes.inc \LongAnswerResponse::fetchUnscoredAnswersByQuestion()
  2. 6.3 question_types/long_answer/long_answer.classes.inc \LongAnswerResponse::fetchUnscoredAnswersByQuestion()
  3. 6.4 question_types/long_answer/long_answer.classes.inc \LongAnswerResponse::fetchUnscoredAnswersByQuestion()
  4. 6.5 question_types/long_answer/long_answer.classes.inc \LongAnswerResponse::fetchUnscoredAnswersByQuestion()
  5. 7.6 question_types/long_answer/long_answer.classes.inc \LongAnswerResponse::fetchUnscoredAnswersByQuestion()
  6. 7 question_types/long_answer/long_answer.classes.inc \LongAnswerResponse::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/long_answer/long_answer.classes.inc, line 232
Long answer classes.

Class

LongAnswerResponse
Extension of QuizQuestionResponse

Code

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