function long_answer_questions_list in Quiz 8.4
Same name and namespace in other branches
- 6.6 question_types/long_answer/long_answer.module \long_answer_questions_list()
- 6.4 question_types/long_answer/long_answer.module \long_answer_questions_list()
- 7.6 question_types/long_answer/long_answer.module \long_answer_questions_list()
- 7 question_types/long_answer/long_answer.module \long_answer_questions_list()
- 7.4 question_types/long_answer/long_answer.module \long_answer_questions_list()
Generate a list of long answer questions
Return value
array containing nid as key and title as value
File
- question_types/
long_answer/ long_answer.module, line 276 - This module defines a long answer question type for quizzes.
Code
function long_answer_questions_list() {
$questions = array();
$results = db_query('SELECT nid, title FROM {node} WHERE type = :type', array(
':type' => 'long_answer',
));
foreach ($results as $result) {
$questions[$result->nid] = check_plain($result->title);
}
return $questions;
}