Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
df466983
Commit
df466983
authored
7 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-2774: resume session of authors under strict control and start a new session if something fails.
parent
d057dac1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/olat/ims/qti21/ui/AssessmentTestDisplayController.java
+40
-4
40 additions, 4 deletions
...rg/olat/ims/qti21/ui/AssessmentTestDisplayController.java
with
40 additions
and
4 deletions
src/main/java/org/olat/ims/qti21/ui/AssessmentTestDisplayController.java
+
40
−
4
View file @
df466983
...
@@ -314,9 +314,7 @@ public class AssessmentTestDisplayController extends BasicController implements
...
@@ -314,9 +314,7 @@ public class AssessmentTestDisplayController extends BasicController implements
AssessmentTestSession
lastSession
=
qtiService
.
getResumableAssessmentTestSession
(
assessedIdentity
,
anonymousIdentifier
,
entry
,
subIdent
,
testEntry
,
authorMode
);
AssessmentTestSession
lastSession
=
qtiService
.
getResumableAssessmentTestSession
(
assessedIdentity
,
anonymousIdentifier
,
entry
,
subIdent
,
testEntry
,
authorMode
);
if
(
lastSession
==
null
)
{
if
(
lastSession
==
null
)
{
candidateSession
=
qtiService
.
createAssessmentTestSession
(
assessedIdentity
,
anonymousIdentifier
,
assessmentEntry
,
entry
,
subIdent
,
testEntry
,
authorMode
);
initNewAssessmentTestSession
(
ureq
,
assessmentEntry
,
authorMode
);
candidateAuditLogger
=
qtiService
.
getAssessmentSessionAuditLogger
(
candidateSession
,
authorMode
);
testSessionController
=
enterSession
(
ureq
);
}
else
{
}
else
{
candidateSession
=
lastSession
;
candidateSession
=
lastSession
;
candidateAuditLogger
=
qtiService
.
getAssessmentSessionAuditLogger
(
candidateSession
,
authorMode
);
candidateAuditLogger
=
qtiService
.
getAssessmentSessionAuditLogger
(
candidateSession
,
authorMode
);
...
@@ -324,7 +322,45 @@ public class AssessmentTestDisplayController extends BasicController implements
...
@@ -324,7 +322,45 @@ public class AssessmentTestDisplayController extends BasicController implements
lastEvent
=
new
CandidateEvent
(
candidateSession
,
testEntry
,
entry
);
lastEvent
=
new
CandidateEvent
(
candidateSession
,
testEntry
,
entry
);
lastEvent
.
setTestEventType
(
CandidateTestEventType
.
ITEM_EVENT
);
lastEvent
.
setTestEventType
(
CandidateTestEventType
.
ITEM_EVENT
);
testSessionController
=
resumeSession
(
ureq
);
if
(
authorMode
)
{
//check that the resumed session match the current test
try
{
testSessionController
=
resumeSession
(
ureq
);
if
(!
checkAuthorSession
())
{
initNewAssessmentTestSession
(
ureq
,
assessmentEntry
,
authorMode
);
}
}
catch
(
Exception
e
)
{
logError
(
"Cannot resume session as author"
,
e
);
initNewAssessmentTestSession
(
ureq
,
assessmentEntry
,
authorMode
);
}
}
else
{
testSessionController
=
resumeSession
(
ureq
);
}
}
}
private
void
initNewAssessmentTestSession
(
UserRequest
ureq
,
AssessmentEntry
assessmentEntry
,
boolean
authorMode
)
{
candidateSession
=
qtiService
.
createAssessmentTestSession
(
assessedIdentity
,
anonymousIdentifier
,
assessmentEntry
,
entry
,
subIdent
,
testEntry
,
authorMode
);
candidateAuditLogger
=
qtiService
.
getAssessmentSessionAuditLogger
(
candidateSession
,
authorMode
);
testSessionController
=
enterSession
(
ureq
);
}
/**
* If the session data doesn't match the current assessmentTest and assessmentItems, it will
* return false.
* @return
*/
private
boolean
checkAuthorSession
()
{
try
{
//
TestSessionState
testSessionState
=
testSessionController
.
getTestSessionState
();
if
(!
isTerminated
()
&&
!
testSessionState
.
isExited
()
&&
testSessionState
.
getCurrentTestPartKey
()
!=
null
)
{
testSessionController
.
mayEndCurrentTestPart
();
}
return
true
;
}
catch
(
Exception
e
)
{
logError
(
"Cannot resume session as author"
,
e
);
return
false
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment