Skip to content

Commit

Permalink
Merge pull request #373 from oat-sa/feat/TR-5782/dry-run-items
Browse files Browse the repository at this point in the history
Feat/tr 5782/dry run items
  • Loading branch information
gabrielfs7 authored Oct 9, 2023
2 parents c917fd2 + 94f0874 commit f773789
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
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

0 comments on commit f773789

Please sign in to comment.