Commit 58c5265c authored by mathieso's avatar mathieso

First cut at class refactor. Blagh.

parent 4c3d7742
......@@ -16,7 +16,7 @@ use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\file\Entity\File;
use Drupal\node\NodeInterface;
use Drupal\paragraphs\ParagraphInterface;
use Drupal\skilling\CurrentClass;
use Drupal\skilling\CurrentClassOld;
use Drupal\skilling\Exception\SkillingException;
use Drupal\skilling\Exception\SkillingInvalidValueException;
use Drupal\skilling\Exception\SkillingNotFoundException;
......@@ -57,7 +57,7 @@ class SkillingAccessChecker {
* If the current user is enrolled in more than one class, s/he chooses
* one of them to be the context for the site.
*
* @var \Drupal\skilling\CurrentClass
* @var \Drupal\skilling\CurrentClassOld
*/
protected $currentClass;
......@@ -117,7 +117,7 @@ class SkillingAccessChecker {
* The entity type manager service.
* @param \Drupal\skilling\SkillingCurrentUser $currentUser
* The current user service.
* @param \Drupal\skilling\CurrentClass $currentClass
* @param \Drupal\skilling\CurrentClassOld $currentClass
* The current class service.
* @param \Drupal\skilling\Access\SkillingCheckUserRelationships $checkUserRelationshipsService
* Service to check relationships between users.
......@@ -140,7 +140,7 @@ class SkillingAccessChecker {
public function __construct(
EntityTypeManagerInterface $entityTypeTanager,
SkillingCurrentUser $currentUser,
CurrentClass $currentClass,
CurrentClassOld $currentClass,
SkillingCheckUserRelationships $checkUserRelationshipsService,
ConfigFactory $configFactory,
SkillingUserFactory $skillingUserFactory,
......
......@@ -80,7 +80,7 @@ class CompletionScore {
/**
* The current class service.
*
* @var \Drupal\skilling\CurrentClass
* @var \Drupal\skilling\CurrentClassOld
*/
protected $currentClass;
......@@ -109,7 +109,7 @@ class CompletionScore {
* User factory service.
* @param \Drupal\skilling\SkillingCurrentUser $skilling_current_user
* The Skilling current user service.
* @param \Drupal\Skilling\CurrentClass $current_class
* @param \Drupal\Skilling\CurrentClassOld $current_class
* The current class service.
* @param \Drupal\skilling\Enrollment $enrollmentService
* The enrollment service.
......@@ -121,7 +121,7 @@ class CompletionScore {
SkillingUtilities $skillingUtilities,
SkillingUserFactory $skillingUserFactory,
SkillingCurrentUser $skilling_current_user,
CurrentClass $current_class,
CurrentClassOld $current_class,
Enrollment $enrollmentService,
MessengerInterface $messenger
) {
......
......@@ -3,7 +3,7 @@
namespace Drupal\skilling\Controller;
use Drupal\Core\Controller\ControllerBase;
use Drupal\skilling\CurrentClass;
use Drupal\skilling\CurrentClassOld;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
......@@ -31,12 +31,12 @@ class ClassSelectionController extends ControllerBase {
/**
* Constructs a new ClassSelectionController object.
*
* @param \Drupal\skilling\CurrentClass $currentClass
* @param \Drupal\skilling\CurrentClassOld $currentClass
* The current class service.
* @param \Drupal\Core\Messenger\MessengerInterface $messenger
* The messenger service.
*/
public function __construct(CurrentClass $currentClass, MessengerInterface $messenger) {
public function __construct(CurrentClassOld $currentClass, MessengerInterface $messenger) {
$this->currentClass = $currentClass;
$this->messenger = $messenger;
}
......
......@@ -4,7 +4,7 @@ namespace Drupal\skilling\Controller;
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Link;
use Drupal\skilling\CurrentClass;
use Drupal\skilling\CurrentClassOld;
use Drupal\views\Views;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Menu\MenuLinkTreeInterface;
......@@ -24,7 +24,7 @@ class ListsController extends ControllerBase {
/**
* Current class service.
*
* @var \Drupal\skilling\CurrentClass
* @var \Drupal\skilling\CurrentClassOld
*/
protected $currentClass;
......@@ -33,7 +33,7 @@ class ListsController extends ControllerBase {
*/
public function __construct(
MenuLinkTreeInterface $menuLinkTree,
CurrentClass $currentClass
CurrentClassOld $currentClass
) {
$this->menuLinkTree = $menuLinkTree;
$this->currentClass = $currentClass;
......
......@@ -6,7 +6,7 @@ use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\skilling\Access\FilterUserInputInterface;
use Drupal\skilling\Access\SkillingAjaxSecurityInterface;
use Drupal\skilling\CurrentClass;
use Drupal\skilling\CurrentClassOld;
use Drupal\skilling\SkillingCurrentUser;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\views\Views;
......@@ -61,7 +61,7 @@ class ProgressBasedOnRequiredController extends ControllerBase {
/**
* The current class service.
*
* @var \Drupal\skilling\CurrentClass
* @var \Drupal\skilling\CurrentClassOld
*/
protected $currentClass;
......@@ -85,7 +85,7 @@ class ProgressBasedOnRequiredController extends ControllerBase {
History $historyService,
SkillingUtilities $skillingUtilities,
SkillingAjaxSecurityInterface $ajaxSecurityService,
CurrentClass $currentClass
CurrentClassOld $currentClass
) {
$this->entityTypeManager = $entityTypeManager;
$this->skillingCurrentUser = $skilling_current_user;
......
......@@ -9,7 +9,7 @@ use Drupal\Core\Entity\EntityStorageException;
use Drupal\Core\Link;
use Drupal\Core\Url;
use Drupal\skilling\CompletionScore;
use Drupal\skilling\CurrentClass;
use Drupal\skilling\CurrentClassOld;
use Drupal\skilling\Exception\SkillingException;
use Drupal\skilling\Exception\SkillingValueMissingException;
use Drupal\skilling\Exception\SkillingWrongTypeException;
......@@ -87,7 +87,7 @@ class SubmissionController extends ControllerBase {
/**
* The current class service.
*
* @var \Drupal\skilling\CurrentClass
* @var \Drupal\skilling\CurrentClassOld
*/
protected $currentClass;
......@@ -114,7 +114,7 @@ class SubmissionController extends ControllerBase {
// History $historyService,
CompletionScore $completionScoreService,
Exercises $exercisesService,
CurrentClass $currentClass
CurrentClassOld $currentClass
) {
$this->entityTypeManager = $entityTypeManager;
$this->skillingUtilities = $skillingUtilities;
......
......@@ -11,7 +11,7 @@ use Drupal\skilling\SkillingConstants;
use Drupal\skilling_history\History;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\skilling\CurrentClass;
use Drupal\skilling\CurrentClassOld;
use Drupal\skilling\SkillingCurrentUser;
use Drupal\skilling\Utilities;
......@@ -30,7 +30,7 @@ class YourClassController extends ControllerBase {
/**
* The Skilling current class service.
*
* @var \Drupal\skilling\CurrentClass
* @var \Drupal\skilling\CurrentClassOld
*/
protected $skillingCurrentClass;
......@@ -88,7 +88,7 @@ class YourClassController extends ControllerBase {
*
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager service.
* @param \Drupal\skilling\CurrentClass $skilling_current_class
* @param \Drupal\skilling\CurrentClassOld $skilling_current_class
* The Skilling current class service.
* @param \Drupal\skilling\SkillingCurrentUser $skilling_current_user
* The Skilling current user service.
......@@ -104,7 +104,7 @@ class YourClassController extends ControllerBase {
*/
public function __construct(
EntityTypeManagerInterface $entity_type_manager,
CurrentClass $skilling_current_class,
CurrentClassOld $skilling_current_class,
SkillingCurrentUser $skilling_current_user,
Utilities $skilling_utilities,
History $historyService,
......
......@@ -43,7 +43,7 @@ class SkillingSubscriber implements EventSubscriberInterface {
/** @var \Drupal\skilling\SkillingCurrentUser $currentUser */
$currentUser = \Drupal::service('skilling.skilling_current_user');
if ($currentUser->isStudent()) {
/** @var \Drupal\skilling\CurrentClass $currentClass */
/** @var \Drupal\skilling\CurrentClassOld $currentClass */
$currentClass = \Drupal::service('skilling.current_class');
if ($currentClass) {
/** @var \Drupal\skilling\CompletionScore $completionScoreService */
......
<?php
namespace src;
use Drupal;
use Drupal\Core\Entity\EntityTypeManager;
use Drupal\skilling\Exception\SkillingInvalidValueException;
use Drupal\skilling\Exception\SkillingValueMissingException;
class ExerciseDueRecord {
/**
* Exercise that is due.
*
* @var integer
*/
protected $exerciseId;
/**
* Day the exercise is due, from the course start date.
* First day of class is day 1, not day 0.
*
* @var integer
*/
protected $day;
/**
* Is the exercise required?
*
* @var boolean
*/
protected $required;
/**
* Maximum number of submissions allowed for the exercise.
*
* @var integer
*/
protected $maximumSubmissions;
/**
* Exercise.
*
* @var \Drupal\node\NodeInterface
*/
protected $exercise;
/**
* @var \Drupal\Core\Entity\EntityTypeManager
*/
protected $entityTypeManager;
/**
* ExerciseDueRecord constructor.
*
* @param integer $exerciseIdIn
* Exercise id.
* @param integer $dayIn
* Day exercise is due from start of a class.
* First day of class is day 1, not day 0.
* @param boolean $requiredIn
* Is the exercise required?
* @param integer $maxSubsIn
* Maximum submissions allowed.
* @param \Drupal\Core\Entity\EntityTypeManager|null $entityTypeManagerIn
* Entity type manager service.
* Having it as an optional parameter makes unit testing easier.
*
* @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
* @throws \Drupal\skilling\Exception\SkillingInvalidValueException
* @throws \Drupal\skilling\Exception\SkillingNotFoundException
* @throws \Drupal\skilling\Exception\SkillingValueMissingException
*/
public function __construct(
$exerciseIdIn,
$dayIn,
$requiredIn,
$maxSubsIn,
EntityTypeManager $entityTypeManagerIn = NULL
) {
// Validate the exercise id.
if (!$exerciseIdIn || !is_numeric($exerciseIdIn) || $exerciseIdIn < 1) {
throw new SkillingValueMissingException(
'Expected class id, got ' . $exerciseIdIn,
__FILE__, __LINE__
);
}
if (is_null($entityTypeManagerIn)) {
$this->entityTypeManager = Drupal::entityTypeManager();
} else {
$this->entityTypeManager = $entityTypeManagerIn;
}
$exercise = $this->entityTypeManager->getStorage('node')
->load($exerciseIdIn);
if (!$exercise) {
throw new Drupal\skilling\Exception\SkillingNotFoundException(
'Class with id not found. Id: ' . $exerciseIdIn,
__FILE__, __LINE__
);
}
$this->exerciseId = (integer)$exerciseIdIn;
$this->exercise = $exercise;
// Check day.
if (!$dayIn || !is_numeric($dayIn) || $dayIn < 1) {
throw new SkillingInvalidValueException(
'Invalid day:' . $dayIn,
__FILE__, __LINE__
);
}
$this->day = (integer)$dayIn;
// Required.
// Convert truthy to strict boolean.
$this->required = $requiredIn ? TRUE : FALSE;
// Validate max subs.
if (!$maxSubsIn || !is_numeric($maxSubsIn) || $maxSubsIn < 1) {
throw new SkillingInvalidValueException(
'Invalid max subs:' . $dayIn,
__FILE__, __LINE__
);
}
$this->maximumSubmissions = (integer)$maxSubsIn;
}
/**
* Get the exercise id.
*
* @return int
* Exercise id
*/
public function getExerciseId() {
return $this->exerciseId;
}
/**
* Get the exercise.
*
* @return \Drupal\node\NodeInterface
* Exercise
*/
public function getExercise() {
return $this->exercise;
}
/**
* Get the day from the start of the class the exercise is due.
* First day of class is day 1, not day 0.
*
* @return int
* Exercise id
*/
public function getDay() {
return $this->day;
}
/**
* Is the exercise required?
*
* @return boolean
* True if required, else false.
*/
public function getRequired() {
return $this->required;
}
/**
* Get the maximum number of submissions allowed for the exercise.
*
* @return int
* Maximum number of submissions
*/
public function getMaximumSubmissions() {
return $this->maximumSubmissions;
}
}
......@@ -27,7 +27,7 @@ class Exercises {
/**
* Current class service.
*
* @var \Drupal\skilling\CurrentClass
* @var \Drupal\skilling\CurrentClassOld
*/
protected $currentClass;
......@@ -55,7 +55,7 @@ class Exercises {
*
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* Entity type manager service.
* @param \Drupal\skilling\CurrentClass $skilling_current_class
* @param \Drupal\skilling\CurrentClassOld $skilling_current_class
* Current class service.
* @param \Drupal\skilling\SkillingCurrentUser $skilling_skilling_current_user
* Skilling current user service.
......@@ -65,7 +65,7 @@ class Exercises {
*/
public function __construct(
EntityTypeManagerInterface $entity_type_manager,
CurrentClass $skilling_current_class,
CurrentClassOld $skilling_current_class,
SkillingCurrentUser $skilling_skilling_current_user,
Submissions $submissionsService,
Timeline $timelineService
......
......@@ -4,7 +4,7 @@ namespace Drupal\skilling\Plugin\Block;
use Drupal\Core\Block\BlockBase;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\skilling\CurrentClass;
use Drupal\skilling\CurrentClassOld;
use Drupal\skilling\SkillingConstants;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\skilling\Utilities;
......@@ -37,7 +37,7 @@ class ClassSelector extends BlockBase implements ContainerFactoryPluginInterface
/**
* Current class service.
*
* @var \Drupal\skilling\CurrentClass
* @var \Drupal\skilling\CurrentClassOld
*/
protected $currentClass;
......@@ -53,10 +53,10 @@ class ClassSelector extends BlockBase implements ContainerFactoryPluginInterface
* @param \Drupal\skilling\Utilities $skilling_utilities
* The Skilling utilities service
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* @param \Drupal\skilling\CurrentClass $current_class
* @param \Drupal\skilling\CurrentClassOld $current_class
* Current class service.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, Utilities $skilling_utilities, EntityTypeManagerInterface $entity_type_manager, CurrentClass $current_class) {
public function __construct(array $configuration, $plugin_id, $plugin_definition, Utilities $skilling_utilities, EntityTypeManagerInterface $entity_type_manager, CurrentClassOld $current_class) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->skillingUtilities = $skilling_utilities;
$this->entityTypeManager = $entity_type_manager;
......
......@@ -5,7 +5,7 @@ namespace Drupal\skilling\Plugin\Block;
use Drupal\Core\Block\BlockBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\skilling\CurrentClass;
use Drupal\skilling\CurrentClassOld;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\skilling\SkillingCurrentUser;
......@@ -29,7 +29,7 @@ class SidebarHiderBlock extends BlockBase implements ContainerFactoryPluginInter
/**
* The current class service.
*
* @var \Drupal\skilling\CurrentClass
* @var \Drupal\skilling\CurrentClassOld
*/
protected $currentClass;
......@@ -44,7 +44,7 @@ class SidebarHiderBlock extends BlockBase implements ContainerFactoryPluginInter
* The plugin implementation definition.
* @param \Drupal\skilling\SkillingCurrentUser $skillingCurrentUser
* The current user service.
* @param \Drupal\skilling\CurrentClass $currentClass
* @param \Drupal\skilling\CurrentClassOld $currentClass
* The current class service.
*/
public function __construct(
......@@ -52,7 +52,7 @@ class SidebarHiderBlock extends BlockBase implements ContainerFactoryPluginInter
$plugin_id,
$plugin_definition,
SkillingCurrentUser $skillingCurrentUser,
CurrentClass $currentClass
CurrentClassOld $currentClass
) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->skillingCurrentUser = $skillingCurrentUser;
......
......@@ -7,7 +7,7 @@ use Drupal\Core\Block\BlockBase;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Render\Renderer;
use Drupal\Core\Session\AccountInterface;
use Drupal\skilling\CurrentClass;
use Drupal\skilling\CurrentClassOld;
use Drupal\skilling\SkillingCurrentUser;
use Drupal\skilling\SkillingUserFactory;
use Drupal\skilling\Timeline;
......@@ -58,7 +58,7 @@ class TimelineBlock extends BlockBase implements ContainerFactoryPluginInterface
/**
* The current class service.
*
* @var \Drupal\skilling\CurrentClass
* @var \Drupal\skilling\CurrentClassOld
*/
protected $currentClass;
......@@ -76,17 +76,17 @@ class TimelineBlock extends BlockBase implements ContainerFactoryPluginInterface
* @param \Drupal\skilling\Timeline $timelineService
* Timeline service.
* @param \Drupal\skilling\Utilities $utilities
* @param \Drupal\skilling\CurrentClass $current_class
* @param \Drupal\skilling\CurrentClassOld $current_class
* @param \Drupal\skilling\SkillingUserFactory $userFactory
* @param \Drupal\skilling\SkillingCurrentUser $skillingCurrentUser
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition,
Renderer $renderer,
Timeline $timelineService,
Utilities $utilities,
CurrentClass $current_class,
SkillingUserFactory $userFactory,
SkillingCurrentUser $skillingCurrentUser) {
Renderer $renderer,
Timeline $timelineService,
Utilities $utilities,
CurrentClassOld $current_class,
SkillingUserFactory $userFactory,
SkillingCurrentUser $skillingCurrentUser) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->renderer = $renderer;
$this->timelineService = $timelineService;
......
......@@ -79,7 +79,7 @@ class ExerciseTag extends SkillingCustomTagBase {
/**
* Current class service.
*
* @var \Drupal\skilling\CurrentClass
* @var \Drupal\skilling\CurrentClassOld
*/
protected $currentClass;
......
......@@ -46,7 +46,7 @@ class ExerciseDueDate extends Drupal\views\Plugin\views\field\Date { //FieldPlu
$exercise = $row->_entity;
// Is it an exercise?
if ($exercise->bundle() === SkillingConstants::EXERCISE_CONTENT_TYPE) {
/** @var Drupal\skilling\CurrentClass $currentClass */
/** @var Drupal\skilling\CurrentClassOld $currentClass */
$currentClass = Drupal::service('skilling.current_class');
if (!is_null($currentClass->getWrappedDrupalClassNode())) {
$exerciseDueData
......
......@@ -6,7 +6,7 @@ use DateInterval;
use DateTime;
use Drupal\Component\Utility\Html;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\skilling\CurrentClass;
use Drupal\skilling\CurrentClassOld;
use Drupal\skilling\Exception\SkillingException;
use Drupal\skilling\SkillingConstants;
use Drupal\skilling\SkillingCurrentUser;
......@@ -63,7 +63,7 @@ class StudentSubmissionsDataSource extends QueryPluginBase {
/**
* Skilling current class service.
*
* @var \Drupal\skilling\CurrentClass
* @var \Drupal\skilling\CurrentClassOld
*/
protected $currentClass;
......@@ -98,17 +98,17 @@ class StudentSubmissionsDataSource extends QueryPluginBase {
* Submissions service.
* @param \Drupal\Core\Render\Renderer $renderer
* The renderer service.
* @param \Drupal\skilling\CurrentClass $currentClass
* @param \Drupal\skilling\CurrentClassOld $currentClass
*/
public function __construct(
array $configuration,
$pluginId,
$pluginDefinition,
EntityTypeManagerInterface $entityTypeManager,
SkillingCurrentUser $skillingCurrentUser,
Submissions $submissionsService,
Renderer $renderer,
CurrentClass $currentClass
array $configuration,
$pluginId,
$pluginDefinition,
EntityTypeManagerInterface $entityTypeManager,
SkillingCurrentUser $skillingCurrentUser,
Submissions $submissionsService,
Renderer $renderer,
CurrentClassOld $currentClass
) {
parent::__construct($configuration, $pluginId, $pluginDefinition);
$this->entityTypeManager = $entityTypeManager;
......
This diff is collapsed.
......@@ -38,7 +38,7 @@ use Drupal\skilling\Utilities as SkillingUtilities;
*
* $currentEnrollments - array of enrollment nodes.
*/
class CurrentClass {
class CurrentClassOld {
const CURRENT_CLASS_KEY = 'current_class_id';
......@@ -267,12 +267,12 @@ class CurrentClass {
* @return int
* The id.
*/
public function getCurrentClassId() {
if (!$this->isCurrentClass()) {
return 0;
}
return $this->wrappedDrupalClassNode->id();
}
// public function getCurrentClassId() {
// if (!$this->isCurrentClass()) {
// return 0;
// }
// return $this->wrappedDrupalClassNode->id();
// }
/**
* Get the current user's enrollment in the current class.
......@@ -311,29 +311,6 @@ class CurrentClass {
return $this->currentEnrollments;
}
/**
* Load the current user's enrollments.
*
* @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
*/
protected function loadCurrentUserEnrollments() {
if ($this->skillingCurrentUser->isAnonymous()) {
$this->currentEnrollments = [];
return;
}
// Is user blocked?
if ($this->skillingCurrentUser->isBlocked()) {
$this->currentEnrollments = [];
return;
}
// Load the published enrollments.
$this->currentEnrollments
= $this->skillingUtilities->getUserEnrollmentsPublished(
$this->skillingCurrentUser->id()
);
}
/**
* Set the current class nid in the user data key storage.
*
......@@ -369,9 +346,9 @@ class CurrentClass {
* @return array|string[]
* The tags.
*/
public function getCacheTags() {
return $this->wrappedDrupalClassNode->getCacheTags();
}
// public function getCacheTags() {
// return $this->wrappedDrupalClassNode->getCacheTags();
// }
/**
* Get the current user's instructor.
......@@ -386,23 +363,23 @@ class CurrentClass {
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
* @throws \Drupal\skilling\Exception\SkillingWrongTypeException
*/
public function getCurrentInstructor() {
if (!$this->skillingCurrentUser->isStudent()) {
return NULL;
}
if (is_null($this->wrappedDrupalClassNode)) {
return NULL;
}
/** @var \Drupal\user\Entity\User[] $instructors */
$instructors = $this->skillingClassUtilities->getInstructorsForClass($this->wrappedDrupalClassNode);
if (count($instructors) === 0) {
return NULL;
}
// If there is more than one, just get the first one.
/** @var \Drupal\user\Entity\User $instructor */
$instructor = reset($instructors);
return $instructor;
}
// public function getCurrentInstructor() {
// if (!$this->skillingCurrentUser->isStudent()) {
// return NULL;
// }
// if (is_null($this->wrappedDrupalClassNode)) {
// return NULL;
// }
// /** @var \Drupal\user\Entity\User[] $instructors */
// $instructors = $this->skillingClassUtilities->getInstructorsForClass($this->wrappedDrupalClassNode);
// if (count($instructors) === 0) {
// return NULL;
// }
// // If there is more than one, just get the first one.
// /** @var \Drupal\user\Entity\User $instructor */
// $instructor = reset($instructors);
// return $instructor;
// }
/**
* Get exercise due record for an exercise for the current class.
......@@ -417,16 +394,16 @@ class CurrentClass {
* @throws \Drupal\Core\Entity\EntityStorageException