public function QuizFeedbackType::getComponent in Quiz 6.x        
                          
                  
                        Same name and namespace in other branches
- 8.6 src/Entity/QuizFeedbackType.php \Drupal\quiz\Entity\QuizFeedbackType::getComponent()
- 8.5 src/Entity/QuizFeedbackType.php \Drupal\quiz\Entity\QuizFeedbackType::getComponent()
File
 
   - src/Entity/QuizFeedbackType.php, line 57
Class
  
  - QuizFeedbackType 
- Defines the quiz type entity class.
Namespace
  Drupal\quiz\Entity
Code
public function getComponent() {
  if (empty($this->component)) {
    
    $this->component = [
      'expression' => [
        'id' => 'rules_and',
      ],
      'context_definitions' => [
        'quiz_result' => [
          'type' => 'entity:quiz_result',
          'label' => 'Quiz result',
          'description' => 'Quiz result to evaluate feedback',
        ],
      ],
    ];
  }
  if (!isset($this->componentObject)) {
    $this->componentObject = RulesComponent::createFromConfiguration($this->component);
  }
  return $this->componentObject;
}