-
Notifications
You must be signed in to change notification settings - Fork 56
Add maxGrade in UserInfo for submitted submissions #206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Pull Request Test Coverage Report for Build 1487
💛 - Coveralls |
ning-y
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As usual, specs looks good, but can't comment on the code.
tuesmiddt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor issue with the query.
lib/cadet/assessments/assessments.ex
Outdated
| Submission | ||
| |> where(status: ^:submitted) | ||
| |> join(:inner, [s], student in assoc(s, :student)) | ||
| |> where([_, student], student.id == ^user_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for this. Submission has student_id field.
| def user_max_grade(%User{id: user_id}) when is_ecto_id(user_id) do | ||
| max_grade = | ||
| Submission | ||
| |> where(status: ^:submitted) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is cool. Didn't know you could do that.
1477e7a to
24a7ff6
Compare
tuesmiddt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Add maxGrade in UserInfo for submitted submissions * Address code review
Fixes #205