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
5ccc4c53
Commit
5ccc4c53
authored
10 years ago
by
Christoph Thelen
Browse files
Options
Downloads
Patches
Plain Diff
Fix calculating question-based progress for course
parent
0f629097
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/thm/arsnova/domain/QuestionBasedLearningProgress.java
+2
-4
2 additions, 4 deletions
.../de/thm/arsnova/domain/QuestionBasedLearningProgress.java
with
2 additions
and
4 deletions
src/main/java/de/thm/arsnova/domain/QuestionBasedLearningProgress.java
+
2
−
4
View file @
5ccc4c53
...
...
@@ -40,11 +40,9 @@ public class QuestionBasedLearningProgress implements LearningProgress {
private
int
calculateCourseProgress
(
CourseScore
courseScore
)
{
int
numQuestionsCorrect
=
numQuestionsCorrectForCourse
(
courseScore
);
int
numUsers
=
courseScore
.
getTotalUserCount
();
final
double
correctQuestionsOnAverage
=
(
double
)
numQuestionsCorrect
/
(
double
)
numUsers
;
final
double
myLearningProgress
=
correctQuestionsOnAverage
/
courseScore
.
getQuestionCount
();
final
double
correctQuestionsOnAverage
=
(
double
)
numQuestionsCorrect
/
(
double
)(
courseScore
.
getQuestionCount
());
// calculate percent, cap results to 100
return
(
int
)
Math
.
min
(
100
,
Math
.
round
(
myLearningProgress
*
100
));
return
(
int
)
Math
.
min
(
100
,
Math
.
round
(
correctQuestionsOnAverage
*
100
));
}
private
int
numQuestionsCorrectForCourse
(
CourseScore
courseScore
)
{
...
...
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