Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/tr 5782/dry run items #373

Merged
merged 3 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/qtism/runtime/tests/AbstractSessionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Copyright (c) 2013-2020 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
* Copyright (c) 2013-2023 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
*
* @author Jérôme Bogaerts <[email protected]>
* @license GPLv2
Expand Down Expand Up @@ -137,6 +137,17 @@ protected function getRoute(AssessmentTest $test, Route $route = null): Route
return $route ?? $this->createRoute($test);
}

/**
* Allow to recreate route items when AssessmentTest structure is changed
*
* @param AssessmentTest $test
* @return Route
*/
public function recreateRoute(AssessmentTest $test): Route
{
return $this->createRoute($test);
}

/**
* Contains the logic of creating the Route of a brand new AssessmentTestSession object.
* The resulting Route object will be injected in the created AssessmentTestSession.
Expand Down
12 changes: 11 additions & 1 deletion src/qtism/runtime/tests/AssessmentTestSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Copyright (c) 2013-2020 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
* Copyright (c) 2013-2023 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
*
* @author Jérôme Bogaerts <[email protected]>
* @license GPLv2
Expand Down Expand Up @@ -3061,6 +3061,16 @@ public function isNextRouteItemPredictible(): bool
return true;
}

/**
* In case of need to recreate item sessions after the route was created
*
* @param RouteItem $routeItem
*/
public function reinitializeAssessmentItemSession(RouteItem $routeItem): void
{
$this->initializeAssessmentItemSession($routeItem);
}

/**
* @param RouteItem $routeItem
*/
Expand Down
Loading