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
22096776
Commit
22096776
authored
5 years ago
by
uhensler
Browse files
Options
Downloads
Patches
Plain Diff
OO-4295: Save Scorm score only for participants
parent
0f2bdf27
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/olat/course/nodes/scorm/ScormRunController.java
+10
-8
10 additions, 8 deletions
.../java/org/olat/course/nodes/scorm/ScormRunController.java
with
10 additions
and
8 deletions
src/main/java/org/olat/course/nodes/scorm/ScormRunController.java
+
10
−
8
View file @
22096776
...
...
@@ -126,7 +126,7 @@ public class ScormRunController extends BasicController implements ScormAPICallb
// assertion to make sure the moduleconfig is valid
if
(!
ScormEditController
.
isModuleConfigValid
(
config
))
throw
new
AssertException
(
"scorm run controller had an invalid module config:"
+
config
.
toString
());
this
.
isPreview
=
isPreview
||
userCourseEnv
.
isCourseReadOnly
();
this
.
isPreview
=
isPreview
||
userCourseEnv
.
isCourseReadOnly
()
||
!
userCourseEnv
.
isParticipant
()
;
this
.
userCourseEnv
=
userCourseEnv
;
this
.
config
=
config
;
this
.
scormNode
=
scormNode
;
...
...
@@ -141,7 +141,7 @@ public class ScormRunController extends BasicController implements ScormAPICallb
startPage
=
createVelocityContainer
(
"run"
);
// show browse mode option only if not assessable, hide it if in
// "real test mode"
isAssessable
=
config
.
getBooleanSafe
(
ScormEditController
.
CONFIG_ISASSESSABLE
,
true
);
isAssessable
=
userCourseEnv
.
isParticipant
()
&&
config
.
getBooleanSafe
(
ScormEditController
.
CONFIG_ISASSESSABLE
,
true
);
if
(
isAssessable
)
{
assessableType
=
config
.
getStringValue
(
ScormEditController
.
CONFIG_ASSESSABLE_TYPE
,
ScormEditController
.
CONFIG_ASSESSABLE_TYPE_SCORE
);
...
...
@@ -152,7 +152,7 @@ public class ScormRunController extends BasicController implements ScormAPICallb
// score was given back by the SCORM
// set start button if max attempts are not reached
if
(!
maxAttemptsReached
())
{
chooseScormRunMode
=
new
ChooseScormRunModeForm
(
ureq
,
getWindowControl
(),
!
isAssessable
,
userCourseEnv
.
isCourseReadOnly
());
chooseScormRunMode
=
new
ChooseScormRunModeForm
(
ureq
,
getWindowControl
(),
!
isAssessable
&&
!
isPreview
,
userCourseEnv
.
isCourseReadOnly
());
listenTo
(
chooseScormRunMode
);
startPage
.
put
(
"chooseScormRunMode"
,
chooseScormRunMode
.
getInitialComponent
());
startPage
.
contextPut
(
"maxAttemptsReached"
,
Boolean
.
FALSE
);
...
...
@@ -314,11 +314,13 @@ public class ScormRunController extends BasicController implements ScormAPICallb
true
,
null
,
doActivate
,
fullWindow
,
false
,
deliveryOptions
);
}
else
{
boolean
attemptsIncremented
=
false
;
//increment user attempts only once!
if
(!
config
.
getBooleanSafe
(
ScormEditController
.
CONFIG_ADVANCESCORE
,
true
)
||
!
config
.
getBooleanSafe
(
ScormEditController
.
CONFIG_ATTEMPTSDEPENDONSCORE
,
false
))
{
courseAssessmentService
.
incrementAttempts
(
scormNode
,
userCourseEnv
,
Role
.
user
);
attemptsIncremented
=
true
;
if
(
userCourseEnv
.
isParticipant
())
{
//increment user attempts only once!
if
(!
config
.
getBooleanSafe
(
ScormEditController
.
CONFIG_ADVANCESCORE
,
true
)
||
!
config
.
getBooleanSafe
(
ScormEditController
.
CONFIG_ATTEMPTSDEPENDONSCORE
,
false
))
{
courseAssessmentService
.
incrementAttempts
(
scormNode
,
userCourseEnv
,
Role
.
user
);
attemptsIncremented
=
true
;
}
}
courseId
=
userCourseEnv
.
getCourseEnvironment
().
getCourseResourceableId
().
toString
();
...
...
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