public function QuizTestBase::createQuestion in Quiz 8.5
Same name and namespace in other branches
- 8.6 tests/src/Functional/QuizTestBase.php \Drupal\Tests\quiz\Functional\QuizTestBase::createQuestion()
- 6.x tests/src/Functional/QuizTestBase.php \Drupal\Tests\quiz\Functional\QuizTestBase::createQuestion()
Return value
44 calls to QuizTestBase::createQuestion()
- MatchingTestCase::testCreateQuizQuestion in question_types/
quiz_matching/ tests/ src/ Functional/ MatchingTestCase.php - Test adding and taking a matching question.
- QuizAccessTest::testQuizOwnerResultEdit in tests/
src/ Functional/ QuizAccessTest.php - Test quiz authors being able to score results for own quiz.
- QuizAccessTest::testQuizTakerAnswerScore in tests/
src/ Functional/ QuizAccessTest.php - Test quiz takers being able to grade their own results.
- QuizBuildOnLastTest::testBuildOnLastAttempt in tests/
src/ Functional/ QuizBuildOnLastTest.php - Test the build on last attempt functionality.
- QuizCreationTest::testCloneQuiz in tests/
src/ Functional/ QuizCreationTest.php - Test cloning quizzes with questions.
File
- tests/
src/ Functional/ QuizTestBase.php, line 102
Class
- QuizTestBase
- Base test class for Quiz questions.
Namespace
Drupal\Tests\quiz\FunctionalCode
public function createQuestion($settings = array()) {
$question = QuizQuestion::create($settings);
$question
->save();
return $question;
}