function Quiz::getNumberOfRequiredQuestions in Quiz 8.5
Same name and namespace in other branches
- 8.6 src/Entity/Quiz.php \Drupal\quiz\Entity\Quiz::getNumberOfRequiredQuestions()
- 6.x src/Entity/Quiz.php \Drupal\quiz\Entity\Quiz::getNumberOfRequiredQuestions()
Get the number of required questions for a quiz.
Return value
int Number of required questions.
1 call to Quiz::getNumberOfRequiredQuestions()
- Quiz::getNumberOfQuestions in src/
Entity/ Quiz.php - Finds out the number of configured questions for the quiz, taking into account random questions pulled from a pool
File
- src/
Entity/ Quiz.php, line 674
Class
- Quiz
- Defines the Quiz entity class.
Namespace
Drupal\quiz\EntityCode
function getNumberOfRequiredQuestions() {
$query = Drupal::entityQuery('quiz_question_relationship');
$query
->condition('quiz_vid', $this
->getRevisionId());
$query
->condition('question_status', QUIZ_QUESTION_ALWAYS);
$result = $query
->execute();
return count($result);
}