function long_answer_questions_list in Quiz 6.4
Same name and namespace in other branches
- 8.4 question_types/long_answer/long_answer.module \long_answer_questions_list()
- 6.6 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
1 call to long_answer_questions_list()
- LongAnswerUnitTest::unitTestListQuestions in question_types/
long_answer/ long_answer.test - Check that question exists in DB.
File
- question_types/
long_answer/ long_answer.module, line 293 - This module defines a long answer question type for quizzes.
Code
function long_answer_questions_list() {
$questions = array();
$type = 'long_answer';
$sql = "SELECT nid, title FROM {node} WHERE type = '%s'";
$results = db_query($sql, $type);
while ($result = db_fetch_object($results)) {
$questions[$result->nid] = check_plain($result->title);
}
return $questions;
}