private function MatchingQuestion::getSubquestions in Quiz 7.4
Same name and namespace in other branches
- 6.4 question_types/matching/matching.classes.inc \MatchingQuestion::getSubquestions()
- 7.6 question_types/matching/matching.classes.inc \MatchingQuestion::getSubquestions()
- 7 question_types/matching/matching.classes.inc \MatchingQuestion::getSubquestions()
- 7.5 question_types/matching/matching.classes.inc \MatchingQuestion::getSubquestions()
Helper function to fetch subquestions
Return value
Array with two arrays, matches and selected options
2 calls to MatchingQuestion::getSubquestions()
- MatchingQuestion::getAnsweringForm in question_types/
matching/ matching.classes.inc - Implementation of getAnsweringForm
- MatchingQuestion::getNodeView in question_types/
matching/ matching.classes.inc - Implementation of getNodeView
File
- question_types/
matching/ matching.classes.inc, line 283 - matching.classes
Class
- MatchingQuestion
- Extension of QuizQuestion.
Code
private function getSubquestions() {
$matches = $select_option = array();
//$sql = "SELECT match_id, question, answer, feedback FROM {quiz_matching_node} WHERE nid = %d AND vid = %d";
$query = db_query('SELECT match_id, question, answer, feedback FROM {quiz_matching_node} WHERE nid = :nid AND vid = :vid', array(
':nid' => $this->node->nid,
':vid' => $this->node->vid,
));
while ($result = $query
->fetch()) {
$matches[] = array(
'match_id' => $result->match_id,
'question' => $result->question,
'answer' => $result->answer,
'feedback' => $result->feedback,
);
$select_option[$result->match_id] = $result->answer;
}
return array(
$matches,
$select_option,
);
}