You are here

public static function ShortAnswerResponse::fetchUnscoredAnswersByQuestion in Quiz 8.4

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

Parameters

$nid: Node ID for the question to check.

$vid: Version ID for the question 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/lib/Drupal/short_answer/ShortAnswerResponse.php, line 74
The main classes for the short answer response.

Class

ShortAnswerResponse
Extension of QuizQuestionResponse

Namespace

Drupal\short_answer

Code

public static function fetchUnscoredAnswersByQuestion($nid, $vid, $count = 50, $offset = 0) {
  return db_query('SELECT result_id FROM {quiz_short_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,
  ))
    ->fetchCol();
}