Skip to content

Commit

Permalink
chore: add test part preconditions to item just one time
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielfs7 committed Sep 25, 2023
1 parent 7430ae7 commit a01223b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/qtism/runtime/tests/AbstractSessionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ protected function createRoute(AssessmentTest $test): Route
// Do the same as for branch rules for pre conditions, except that they must be
// attached on the first item of the route.
$route->getFirstRouteItem()->addPreConditions($current->getPreConditions());
$route->getFirstRouteItem()->addPreConditions($testPart->getPreConditions());
}

array_push($routeStack, $route);
Expand All @@ -220,6 +219,7 @@ protected function createRoute(AssessmentTest $test): Route
// Now, decorate last RouteItem of SelectableRoute with BranchRule objects if any.
if (!empty($route) && $route->count() > 0) {
$route->getLastRouteItem()->addBranchRules($testPart->getBranchRules());
$route->getFirstRouteItem()->addPreConditions($testPart->getPreConditions());
}
}

Expand Down

0 comments on commit a01223b

Please sign in to comment.