Skip to content

Commit

Permalink
fix: code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Karol-Stelmaczonek committed Dec 6, 2023
1 parent 18a4ac2 commit 3b923a9
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions helpers/class.TestSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -832,10 +832,14 @@ private function triggerResultTestVariablesTransmissionEvent(

public function attachToTransmissionEvent(ResultTestVariablesTransmissionEvent $event): void
{
$scoreTotal = array_filter($event->getVariables(), function ($item) {
return $item->getIdentifier() === 'SCORE_TOTAL';
})[0];
if ($scoreTotal === null) {
$scoreTotal = array_filter(
$event->getVariables(),
function ($item) {
return $item->getIdentifier() === 'SCORE_TOTAL';
}
);

if (empty($scoreTotal)) {
return;
}
$outcomeVariables = $this->getResultsStorage()->getDeliveryVariables($event->getDeliveryExecutionId());
Expand All @@ -851,10 +855,11 @@ private function isManualScored(): bool
/** @var AssessmentItemRef $itemRef */
foreach ($this->getRoute()->getAssessmentItemRefs() as $itemRef) {
foreach ($itemRef->getComponents() as $component) {
if ($component instanceof OutcomeDeclaration) {
if ($component->isExternallyScored()) {
return true;
}
if (
$component instanceof OutcomeDeclaration
&& $component->isExternallyScored()
) {
return true;
}
}
}
Expand Down

0 comments on commit 3b923a9

Please sign in to comment.