You are here

public function UserModuleStatus::getAnswers in Opigno module 8

Same name and namespace in other branches
  1. 3.x src/Entity/UserModuleStatus.php \Drupal\opigno_module\Entity\UserModuleStatus::getAnswers()
2 calls to UserModuleStatus::getAnswers()
UserModuleStatus::calculateScore in src/Entity/UserModuleStatus.php
UserModuleStatus::finishAttempt in src/Entity/UserModuleStatus.php
Finish user attempt.

File

src/Entity/UserModuleStatus.php, line 319

Class

UserModuleStatus
Defines the User module status entity.

Namespace

Drupal\opigno_module\Entity

Code

public function getAnswers() {
  $answer_storage = static::entityTypeManager()
    ->getStorage('opigno_answer');
  $query = $answer_storage
    ->getQuery();
  $aids = $query
    ->condition('user_id', $this
    ->getOwnerId())
    ->condition('user_module_status', $this
    ->id())
    ->execute();
  $answers = $answer_storage
    ->loadMultiple($aids);
  return $answers;
}