-
Notifications
You must be signed in to change notification settings - Fork 11
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: Adjust server-side timers when resuming an execution #2438
Changes from 14 commits
851360e
e9bc636
83dd3f8
a5b8f75
8b5b6f2
229d5a3
fb85c06
c5d9648
8da35ae
4393a42
0519afb
b4e1bd2
4c1ca83
46d1793
46991ef
75fb5c8
f841314
c6b4f7b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) 2016-2017 (original work) Open Assessment Technologies SA | ||
* Copyright (c) 2016-2024 (original work) Open Assessment Technologies SA | ||
* | ||
*/ | ||
|
||
|
@@ -336,13 +336,17 @@ protected function updateCurrentDurationCache() | |
{ | ||
$target = $this->getTimerTarget(); | ||
$routeItem = $this->getCurrentRouteItem(); | ||
|
||
$sources = [ | ||
$routeItem->getAssessmentTest(), | ||
$this->getAssessmentTest(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we sure, that we can use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This solves a bug: If this ends up being called on a test (lets call it test B) other than the one we are current running (lets call it test A), protected function getCurrentRouteItem()
{
if ($this->isRunning() === true) {
return $this->getRoute()->current();
}
return false;
} The test we are pausing (B) is / was running, but not in the current request (which is "bound" to A), and we need this to work also in that case (so the elapsed time for the item of test B is stored when suspending the test). Both |
||
$this->getCurrentTestPart(), | ||
$this->getCurrentAssessmentSection(), | ||
$routeItem->getAssessmentItemRef(), | ||
]; | ||
|
||
if ($routeItem instanceof RouteItem) { | ||
$sources[] = $routeItem->getAssessmentItemRef(); | ||
} | ||
|
||
foreach ($sources as $source) { | ||
$this->updateDurationCache($source->getIdentifier(), $target); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Optional]