You are here

public function LongAnswerActivityAnswer::evaluatedOnSave in Opigno module 8

Same name and namespace in other branches
  1. 3.x ActivityTypes/opigno_long_answer/src/Plugin/ActivityAnswer/LongAnswerActivityAnswer.php \Drupal\opigno_long_answer\Plugin\ActivityAnswer\LongAnswerActivityAnswer::evaluatedOnSave()

Indicates if answer should me evaluated on save or not.

Overrides ActivityAnswerPluginBase::evaluatedOnSave

File

ActivityTypes/opigno_long_answer/src/Plugin/ActivityAnswer/LongAnswerActivityAnswer.php, line 21

Class

LongAnswerActivityAnswer
Class LongAnswerActivityAnswer.

Namespace

Drupal\opigno_long_answer\Plugin\ActivityAnswer

Code

public function evaluatedOnSave(OpignoActivityInterface $activity) {

  // Check evaluation method field.
  $method = $activity
    ->get('opigno_evaluation_method')->value;
  if ($method == 0) {

    // Automatic evaluation.
    return TRUE;
  }
  else {

    // Manual evaluation.
    return FALSE;
  }
}