You are here

public function UserModuleStatus::getAnswers in Opigno module 3.x

Same name and namespace in other branches
  1. 8 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 342

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();
  return $answer_storage
    ->loadMultiple($aids);
}