You are here

public function MatchingQuestion::getQuestion in Quiz 6.5

Same name and namespace in other branches
  1. 6.6 question_types/matching/matching.classes.inc \MatchingQuestion::getQuestion()
  2. 6.3 question_types/matching/matching.classes.inc \MatchingQuestion::getQuestion()
1 call to MatchingQuestion::getQuestion()
MatchingQuestion::getQuestionForm in question_types/matching/matching.classes.inc
Get the form that will be displayed to the test-taking user.

File

question_types/matching/matching.classes.inc, line 112
quiz_directions.classes

Class

MatchingQuestion
Implementation of Matching.

Code

public function getQuestion($node) {
  $questions = $select_option = array();
  $sql = "SELECT match_id, question, answer, feedback FROM {quiz_matching_node} WHERE nid = %d AND vid = %d";
  $results = db_query($sql, $node->nid, $node->vid);
  while ($result = db_fetch_object($results)) {
    $questions[] = array(
      'match_id' => $result->match_id,
      'question' => $result->question,
      'answer' => $result->answer,
      'feedback' => $result->feedback,
    );
    $select_option[$result->match_id] = $result->answer;
  }
  return array(
    $questions,
    $select_option,
  );
}