Skip to content

Commit f773789

Browse files
authored
Merge pull request #373 from oat-sa/feat/TR-5782/dry-run-items
Feat/tr 5782/dry run items
2 parents c917fd2 + 94f0874 commit f773789

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

src/qtism/runtime/tests/AbstractSessionManager.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* along with this program; if not, write to the Free Software
1616
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1717
*
18-
* Copyright (c) 2013-2020 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
18+
* Copyright (c) 2013-2023 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
1919
*
2020
* @author Jérôme Bogaerts <[email protected]>
2121
* @license GPLv2
@@ -137,6 +137,17 @@ protected function getRoute(AssessmentTest $test, Route $route = null): Route
137137
return $route ?? $this->createRoute($test);
138138
}
139139

140+
/**
141+
* Allow to recreate route items when AssessmentTest structure is changed
142+
*
143+
* @param AssessmentTest $test
144+
* @return Route
145+
*/
146+
public function recreateRoute(AssessmentTest $test): Route
147+
{
148+
return $this->createRoute($test);
149+
}
150+
140151
/**
141152
* Contains the logic of creating the Route of a brand new AssessmentTestSession object.
142153
* The resulting Route object will be injected in the created AssessmentTestSession.

src/qtism/runtime/tests/AssessmentTestSession.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* along with this program; if not, write to the Free Software
1616
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1717
*
18-
* Copyright (c) 2013-2020 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
18+
* Copyright (c) 2013-2023 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
1919
*
2020
* @author Jérôme Bogaerts <[email protected]>
2121
* @license GPLv2
@@ -3061,6 +3061,16 @@ public function isNextRouteItemPredictible(): bool
30613061
return true;
30623062
}
30633063

3064+
/**
3065+
* In case of need to recreate item sessions after the route was created
3066+
*
3067+
* @param RouteItem $routeItem
3068+
*/
3069+
public function reinitializeAssessmentItemSession(RouteItem $routeItem): void
3070+
{
3071+
$this->initializeAssessmentItemSession($routeItem);
3072+
}
3073+
30643074
/**
30653075
* @param RouteItem $routeItem
30663076
*/

0 commit comments

Comments
 (0)