You are here

abstract class ActivityAnswerPluginBase in Opigno module 3.x

Same name and namespace in other branches
  1. 8 src/ActivityAnswerPluginBase.php \Drupal\opigno_module\ActivityAnswerPluginBase

Class ActivityAnswerPluginBase.

Hierarchy

Expanded class hierarchy of ActivityAnswerPluginBase

8 files declare their use of ActivityAnswerPluginBase
FileUploadActivityAnswer.php in ActivityTypes/opigno_file_upload/src/Plugin/ActivityAnswer/FileUploadActivityAnswer.php
H5pActivityAnswer.php in ActivityTypes/opigno_h5p/src/Plugin/ActivityAnswer/H5pActivityAnswer.php
LongAnswerActivityAnswer.php in ActivityTypes/opigno_long_answer/src/Plugin/ActivityAnswer/LongAnswerActivityAnswer.php
ScormActivityAnswer.php in ActivityTypes/opigno_scorm_activity/src/Plugin/ActivityAnswer/ScormActivityAnswer.php
SlideActivityAnswer.php in src/Plugin/ActivityAnswer/SlideActivityAnswer.php

... See full list

File

src/ActivityAnswerPluginBase.php, line 12

Namespace

Drupal\opigno_module
View source
abstract class ActivityAnswerPluginBase extends PluginBase implements ActivityAnswerPluginInterface {

  /**
   * ActivityAnswerPluginBase constructor.
   */
  public function __construct(array $configuration, $plugin_id, $plugin_definition) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
  }

  /**
   * {@inheritdoc}
   */
  public function getId() {
    return $this->pluginDefinition['id'];
  }

  /**
   * {@inheritdoc}
   */
  public function getActivityType() {
    return $this->pluginDefinition['activityTypeBundle'];
  }

  /**
   * {@inheritdoc}
   */
  public function evaluatedOnSave(OpignoActivityInterface $activity) {
    return TRUE;
  }

  /**
   * {@inheritdoc}
   */
  public function getScore(OpignoAnswerInterface $answer) {
    return 0;
  }

  /**
   * {@inheritdoc}
   */
  public function answeringForm(array &$form) {
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ActivityAnswerPluginBase::answeringForm public function Modify answering form. Overrides ActivityAnswerPluginInterface::answeringForm 1
ActivityAnswerPluginBase::evaluatedOnSave public function Indicates if answer should me evaluated on save or not. Overrides ActivityAnswerPluginInterface::evaluatedOnSave 8
ActivityAnswerPluginBase::getActivityType public function Get plugin activity type. Overrides ActivityAnswerPluginInterface::getActivityType
ActivityAnswerPluginBase::getId public function Get plugin id. Overrides ActivityAnswerPluginInterface::getId
ActivityAnswerPluginBase::getScore public function Score logic for specified activity. Overrides ActivityAnswerPluginInterface::getScore 8
ActivityAnswerPluginBase::__construct public function ActivityAnswerPluginBase constructor. Overrides PluginBase::__construct
DependencySerializationTrait::$_entityStorages protected property
DependencySerializationTrait::$_serviceIds protected property
DependencySerializationTrait::__sleep public function 2
DependencySerializationTrait::__wakeup public function 2
MessengerTrait::$messenger protected property The messenger. 27
MessengerTrait::messenger public function Gets the messenger. 27
MessengerTrait::setMessenger public function Sets the messenger.
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 2
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::isConfigurable public function Determines if the plugin is configurable.
StringTranslationTrait::$stringTranslation protected property The string translation service. 4
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.