Conversation
| missing = AvailablePoint.course_points(course).order!.map(&:name) - awarded | ||
| @missing_points[course_id] = missing | ||
|
|
||
| if awarded.size + missing.size > 0 |
There was a problem hiding this comment.
Style/ConditionalAssignment: Use the return of the conditional for variable assignment and comparison.
Style/NumericPredicate: Use (awarded.size + missing.size).positive? instead of awarded.size + missing.size > 0.
| @group_completion_ratios = {} | ||
| @awarded_points.keys.each do |course_id| | ||
| course = Course.find(course_id) | ||
| unless course.hide_submissions? |
There was a problem hiding this comment.
Style/Next: Use next to skip iteration.
| module PointVisualisation | ||
| extend ActiveSupport::Concern | ||
|
|
||
| def set_point_stats(user) |
There was a problem hiding this comment.
Naming/AccessorMethodName: Do not prefix writer method names with set_.
| end | ||
| end | ||
| end | ||
| end |
There was a problem hiding this comment.
Layout/EndAlignment: end at 32, 0 is not aligned with module at 2, 1.
| missing = AvailablePoint.course_points(course).order!.map(&:name) - awarded | ||
| @missing_points[course_id] = missing | ||
|
|
||
| if (awarded.size + missing.size).positive? |
There was a problem hiding this comment.
Style/ConditionalAssignment: Use the return of the conditional for variable assignment and comparison.
| @group_completion_ratios = {} | ||
| @awarded_points.keys.each do |course_id| | ||
| course = Course.find(course_id) | ||
| if course.hide_submissions? |
There was a problem hiding this comment.
Style/GuardClause: Use a guard clause instead of wrapping the code inside a conditional expression.
| @@ -0,0 +1,32 @@ | |||
| # frozen_string_literal: true. | |||
| module PointVisualisation | |||
| extend ActiveSupport::Concern | |||
There was a problem hiding this comment.
Layout/IndentationWidth: Use 2 (not 1) spaces for indentation.
| @@ -0,0 +1,32 @@ | |||
| # frozen_string_literal: true. | |||
| module PointVisualisation | |||
There was a problem hiding this comment.
Layout/InitialIndentation: Indentation of first line in file detected.
| @missing_points[course_id] = missing | ||
|
|
||
| @percent_completed[course_id] = | ||
| if (awarded.size + missing.size).positive? |
There was a problem hiding this comment.
Layout/IndentAssignment: Indent the first line of the right-hand-side of a multi-line assignment.
| @@ -0,0 +1,30 @@ | |||
| # frozen_string_literal: true. | |||
There was a problem hiding this comment.
Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.
Layout/CommentIndentation: Incorrect indentation detected (column 1 instead of 0).
Use PointVisualisation concern to add required variables
3d40c15 to
76ad367
Compare
0e06bd5 to
81b60ec
Compare
70e2419 to
91c8eb5
Compare
9d66300 to
0728cc8
Compare
3974ce8 to
5684048
Compare
a65b1b3 to
ae0f1e8
Compare
Add "my points"-section to course pages, where student can see their points for that course. Also add the possibility to export a csv-file of the points of a specific part (
sheetin the code) of the course.