From fc93cabf87f5a0ade527c13acaeecdbd2c5f41ce Mon Sep 17 00:00:00 2001 From: Gabriel Felipe Soares Date: Wed, 4 Oct 2023 11:40:20 +0200 Subject: [PATCH 1/3] feat: expose method to recreate route for test session --- src/qtism/runtime/tests/AbstractSessionManager.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/qtism/runtime/tests/AbstractSessionManager.php b/src/qtism/runtime/tests/AbstractSessionManager.php index 9fa7d5aa3..ae2b79e32 100644 --- a/src/qtism/runtime/tests/AbstractSessionManager.php +++ b/src/qtism/runtime/tests/AbstractSessionManager.php @@ -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. From 1f819f2e8dc729b42fee7a98dc033e0de0f77115 Mon Sep 17 00:00:00 2001 From: Gabriel Felipe Soares Date: Wed, 4 Oct 2023 18:45:20 +0200 Subject: [PATCH 2/3] feat: add new method to support reinitialize item session --- src/qtism/runtime/tests/AssessmentTestSession.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/qtism/runtime/tests/AssessmentTestSession.php b/src/qtism/runtime/tests/AssessmentTestSession.php index bb0b71a10..590a6b6c3 100644 --- a/src/qtism/runtime/tests/AssessmentTestSession.php +++ b/src/qtism/runtime/tests/AssessmentTestSession.php @@ -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 */ From 94f0874473041257fb5b71a1f6a143e6d4e45398 Mon Sep 17 00:00:00 2001 From: Gabriel Felipe Soares Date: Thu, 5 Oct 2023 16:38:18 +0200 Subject: [PATCH 3/3] chore: update year of change --- src/qtism/runtime/tests/AbstractSessionManager.php | 2 +- src/qtism/runtime/tests/AssessmentTestSession.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qtism/runtime/tests/AbstractSessionManager.php b/src/qtism/runtime/tests/AbstractSessionManager.php index ae2b79e32..f4ebb03c7 100644 --- a/src/qtism/runtime/tests/AbstractSessionManager.php +++ b/src/qtism/runtime/tests/AbstractSessionManager.php @@ -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 * @license GPLv2 diff --git a/src/qtism/runtime/tests/AssessmentTestSession.php b/src/qtism/runtime/tests/AssessmentTestSession.php index 590a6b6c3..84283c389 100644 --- a/src/qtism/runtime/tests/AssessmentTestSession.php +++ b/src/qtism/runtime/tests/AssessmentTestSession.php @@ -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 * @license GPLv2