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
2a0181cf
Commit
2a0181cf
authored
5 years ago
by
uhensler
Browse files
Options
Downloads
Patches
Plain Diff
OO-4108: Respect scale direction when calculating min / max value
parent
c29592a0
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/course/nodes/ms/manager/MSServiceImpl.java
+17
-5
17 additions, 5 deletions
.../java/org/olat/course/nodes/ms/manager/MSServiceImpl.java
with
17 additions
and
5 deletions
src/main/java/org/olat/course/nodes/ms/manager/MSServiceImpl.java
+
17
−
5
View file @
2a0181cf
...
@@ -194,12 +194,18 @@ public class MSServiceImpl implements MSService {
...
@@ -194,12 +194,18 @@ public class MSServiceImpl implements MSService {
float
rubricSumMin
=
evaluationFormManager
.
getRubricStatistic
(
rubric
,
getSlidersStatistic
(
rubric
,
true
))
float
rubricSumMin
=
evaluationFormManager
.
getRubricStatistic
(
rubric
,
getSlidersStatistic
(
rubric
,
true
))
.
getTotalStatistic
()
.
getTotalStatistic
()
.
getSum
().
floatValue
();
.
getSum
().
floatValue
();
// If no responses the min is 0
rubricSumMin
=
rubricSumMin
>
0
?
0
:
rubricSumMin
;
sumMin
+=
rubricSumMin
;
float
rubricSumMax
=
evaluationFormManager
.
getRubricStatistic
(
rubric
,
getSlidersStatistic
(
rubric
,
false
))
float
rubricSumMax
=
evaluationFormManager
.
getRubricStatistic
(
rubric
,
getSlidersStatistic
(
rubric
,
false
))
.
getTotalStatistic
()
.
getTotalStatistic
()
.
getSum
().
floatValue
();
.
getSum
().
floatValue
();
if
(
rubricSumMin
>
rubricSumMax
)
{
float
temp
=
rubricSumMin
;
rubricSumMin
=
rubricSumMax
;
rubricSumMax
=
temp
;
}
// If no responses the min is 0
rubricSumMin
=
rubricSumMin
>
0
?
0
:
rubricSumMin
;
sumMin
+=
rubricSumMin
;
sumMax
+=
rubricSumMax
;
sumMax
+=
rubricSumMax
;
}
}
}
}
...
@@ -223,11 +229,17 @@ public class MSServiceImpl implements MSService {
...
@@ -223,11 +229,17 @@ public class MSServiceImpl implements MSService {
float
rubricAvgMin
=
evaluationFormManager
.
getRubricStatistic
(
rubric
,
getSlidersStatistic
(
rubric
,
true
))
float
rubricAvgMin
=
evaluationFormManager
.
getRubricStatistic
(
rubric
,
getSlidersStatistic
(
rubric
,
true
))
.
getTotalStatistic
()
.
getTotalStatistic
()
.
getAvg
().
floatValue
();
.
getAvg
().
floatValue
();
// If no responses the min is 0
rubricAvgMin
=
rubricAvgMin
>
0
?
0
:
rubricAvgMin
;
float
rubricAvgMax
=
evaluationFormManager
.
getRubricStatistic
(
rubric
,
getSlidersStatistic
(
rubric
,
false
))
float
rubricAvgMax
=
evaluationFormManager
.
getRubricStatistic
(
rubric
,
getSlidersStatistic
(
rubric
,
false
))
.
getTotalStatistic
()
.
getTotalStatistic
()
.
getAvg
().
floatValue
();
.
getAvg
().
floatValue
();
// switch if descending scale
if
(
rubricAvgMin
>
rubricAvgMax
)
{
float
temp
=
rubricAvgMin
;
rubricAvgMin
=
rubricAvgMax
;
rubricAvgMax
=
temp
;
}
// If no responses the min is 0
rubricAvgMin
=
rubricAvgMin
>
0
?
0
:
rubricAvgMin
;
int
numberOfSliders
=
rubric
.
getSliders
().
size
();
int
numberOfSliders
=
rubric
.
getSliders
().
size
();
sumMin
+=
numberOfSliders
*
rubricAvgMin
;
sumMin
+=
numberOfSliders
*
rubricAvgMin
;
sumMax
+=
numberOfSliders
*
rubricAvgMax
;
sumMax
+=
numberOfSliders
*
rubricAvgMax
;
...
...
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