Skip to content

Commit

Permalink
Resume/Suspend methos for AssessmentTestSession.
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Nov 16, 2015
1 parent cafd45e commit fd6d0d1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "qtism/qtism",
"description": "OAT QTI Software Module Library",
"type": "library",
"version": "0.9.15",
"version": "0.9.16",
"authors": [
{
"name": "Open Assessment Technologies S.A.",
Expand Down
20 changes: 20 additions & 0 deletions qtism/runtime/tests/AssessmentTestSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -1330,6 +1330,26 @@ public function jumpTo($position, $allowTimeout = false) {
throw new AssessmentTestSessionException($msg, AssessmentTestSessionException::FORBIDDEN_JUMP, $e);
}
}

/**
* Suspend the current test session if it is running.
*/
public function suspend() {
if ($this->isRunning() === true) {
$this->suspendItemSession();
$this->setState(AssessmentTestSessionState::SUSPENDED);
}
}

/**
* Resume the current test session if it is suspended.
*/
public function resume() {
if ($this->isRunning() === false) {
$this->interactWithItemSession();
$this->setState(AssessmentTestSessionState::INTERACTING);
}
}

/**
* AssessmentTestSession implementations must override this method in order
Expand Down

0 comments on commit fd6d0d1

Please sign in to comment.