public function QuizTestCase::linkQuestionToQuiz in Quiz 7.5
Same name and namespace in other branches
- 7.6 tests/QuizTestCase.test \QuizTestCase::linkQuestionToQuiz()
Link a question to a new or provided quiz.
67 calls to QuizTestCase::linkQuestionToQuiz()
- LongAnswerTestCase::testEditQuestionResponse in question_types/
long_answer/ long_answer.test - Test that the question response can be edited.
- LongAnswerTestCase::testFilterFormats in question_types/
long_answer/ long_answer.test - Test that rubric and answer filter settings are respected.
- LongAnswerTestCase::testGradeAnswerManualFeedback in question_types/
long_answer/ long_answer.test - Test manually graded questions.
- MatchingTestCase::testChoicePenalty in question_types/
matching/ matching.test - Test if the penalty system for guessing wrong work.
- MatchingTestCase::testEditQuestionResponse in question_types/
matching/ matching.test - Test that the question response can be edited.
File
- tests/
QuizTestCase.test, line 105 - Unit tests for the quiz question Module.
Class
- QuizTestCase
- Base test class for Quiz questions.
Code
public function linkQuestionToQuiz($question_node, $quiz_node = NULL) {
if (!$quiz_node) {
// Create a new quiz with defaults.
$quiz_node = $this
->drupalCreateQuiz();
}
_quiz_question_get_instance($question_node)
->saveRelationships($quiz_node->nid, $quiz_node->vid);
return $quiz_node;
}