Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
wazelin committed Oct 26, 2022
2 parents d9dc296 + fc2bf32 commit 806b918
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 24 deletions.
9 changes: 3 additions & 6 deletions src/qtism/runtime/tests/AssessmentItemSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -766,11 +766,10 @@ public function beginAttempt()
* @param State $responses (optional) A State composed by the candidate's responses to the item.
* @param bool $responseProcessing (optional) Whether to execute the responseProcessing or not.
* @param bool $forceLateSubmission (optional) Force the acceptance of late response submission. In this case, responses that are received out of the time frame indicated by the time limits in force are accepted anyway.
* @param bool $forceResponseSave (opional) Force save response even if it empty or validation required
* @throws AssessmentItemSessionException If the time limits in force are not respected, an error occurs during response processing, a state violation occurs.
* @throws PhpStorageException
*/
public function endAttempt(State $responses = null, $responseProcessing = true, $forceLateSubmission = false, $forceResponseSave = false)
public function endAttempt(State $responses = null, $responseProcessing = true, $forceLateSubmission = false)
{
// Flag to indicate if time is exceed or not.
$maxTimeExceeded = false;
Expand All @@ -793,10 +792,8 @@ public function endAttempt(State $responses = null, $responseProcessing = true,

// Apply the responses (if provided) to the current state.
if ($responses !== null) {
if (!$forceResponseSave) {
$this->checkResponseValidityConstraints($responses);
$this->checkAllowSkipping($responses);
}
$this->checkResponseValidityConstraints($responses);
$this->checkAllowSkipping($responses);
$this->mergeResponses($responses);
}

Expand Down
4 changes: 2 additions & 2 deletions src/qtism/runtime/tests/AssessmentTestSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ public function beginAttempt($allowLateSubmission = false)
* @param bool $allowLateSubmission If set to true, maximum time limits will not be taken into account.
* @throws AssessmentTestSessionException
*/
public function endAttempt(State $responses, $allowLateSubmission = false, $ignoreAllowSkippingCheck = false)
public function endAttempt(State $responses, $allowLateSubmission = false)
{
if ($this->isRunning() === false) {
$msg = 'Cannot end an attempt for the current item while the state of the test session is INITIAL or CLOSED.';
Expand Down Expand Up @@ -899,7 +899,7 @@ public function endAttempt(State $responses, $allowLateSubmission = false, $igno
}
} else {
try {
$session->endAttempt($responses, true, $allowLateSubmission, $ignoreAllowSkippingCheck);
$session->endAttempt($responses, true, $allowLateSubmission);
} catch (Exception $e) {
throw $this->transformException($e);
}
Expand Down
16 changes: 0 additions & 16 deletions test/qtismtest/runtime/tests/AssessmentItemSessionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,22 +262,6 @@ public function testSkippingForbiddenSimple()
}
}

public function testIgnoreSkippingForbiddenSimple()
{
$itemSession = $this->instantiateBasicAssessmentItemSession();
$itemSessionControl = new ItemSessionControl();
$itemSessionControl->setAllowSkipping(false);
$itemSession->setItemSessionControl($itemSessionControl);
$itemSession->beginItemSession();

$itemSession->beginAttempt();

// Test with empty state...
// no exception should be produced
$itemSession->endAttempt(new State([new ResponseVariable('RESPONSE', Cardinality::SINGLE, BaseType::IDENTIFIER)]), true, false, true);
$this->assertTrue(true);
}

public function testSkippingForbiddenDefaultValue()
{
$doc = new XmlDocument();
Expand Down

0 comments on commit 806b918

Please sign in to comment.