Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ARSnova Backend
Manage
Activity
Members
Labels
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Privacy
Imprint
Contact
Snippets
Groups
Projects
Show more breadcrumbs
Paul-Christian Volkmer
ARSnova Backend
Commits
ab8794c4
Commit
ab8794c4
authored
10 years ago
by
Christoph Thelen
Browse files
Options
Downloads
Patches
Plain Diff
Cap learning progress at 100 percent
parent
caae69e0
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/thm/arsnova/dao/CouchDBDao.java
+3
-2
3 additions, 2 deletions
src/main/java/de/thm/arsnova/dao/CouchDBDao.java
with
3 additions
and
2 deletions
src/main/java/de/thm/arsnova/dao/CouchDBDao.java
+
3
−
2
View file @
ab8794c4
...
@@ -1491,7 +1491,7 @@ public class CouchDBDao implements IDatabaseDao {
...
@@ -1491,7 +1491,7 @@ public class CouchDBDao implements IDatabaseDao {
}
}
final
double
courseAverageValue
=
userTotalValue
/
numUsers
;
final
double
courseAverageValue
=
userTotalValue
/
numUsers
;
final
double
courseProgress
=
courseAverageValue
/
courseMaximumValue
;
final
double
courseProgress
=
courseAverageValue
/
courseMaximumValue
;
return
(
int
)
Math
.
round
(
courseProgress
*
100
);
return
(
int
)
Math
.
min
(
100
,
Math
.
round
(
courseProgress
*
100
)
)
;
}
}
@Override
@Override
...
@@ -1517,8 +1517,9 @@ public class CouchDBDao implements IDatabaseDao {
...
@@ -1517,8 +1517,9 @@ public class CouchDBDao implements IDatabaseDao {
return
new
AbstractMap
.
SimpleEntry
<
Integer
,
Integer
>(
0
,
courseProgress
);
return
new
AbstractMap
.
SimpleEntry
<
Integer
,
Integer
>(
0
,
courseProgress
);
}
}
final
double
myProgress
=
userTotalValue
/
courseMaximumValue
;
final
double
myProgress
=
userTotalValue
/
courseMaximumValue
;
final
int
myLearningProgress
=
(
int
)
Math
.
min
(
100
,
Math
.
round
(
myProgress
*
100
));
return
new
AbstractMap
.
SimpleEntry
<
Integer
,
Integer
>(
(
int
)
Math
.
round
(
my
Progress
*
100
)
,
courseProgress
);
return
new
AbstractMap
.
SimpleEntry
<
Integer
,
Integer
>(
myLearning
Progress
,
courseProgress
);
}
}
@Override
@Override
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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