Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

Commit

Permalink
#346: Fix JP's review comments.
Browse files Browse the repository at this point in the history
- Use `unless` instead of `if not`
- Use floating point division.
  • Loading branch information
navilan committed Jun 28, 2014
1 parent 738cdfe commit 6830308
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/feedback_condition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def schedule_feedback_availability_notification(student_exercise, event)

def adjust_credit(student_exercise, event)
if StudentExercise::Event::COMPLETE == event
student_exercise.update_feedback_credit_multiplier!(is_feedback_required_for_credit ? feedback_viewing_penalty/100 : 1)
student_exercise.update_feedback_credit_multiplier!(is_feedback_required_for_credit ? feedback_viewing_penalty/100.0 : 1)
end

if StudentExercise::Event::FEEDBACK_VIEWED == event
Expand Down
2 changes: 1 addition & 1 deletion app/views/feedback_conditions/_form_fields.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
Students must view the feedback to get credit for the problems.
</div>
<div class="field feedback-viewing-penalty"
<% if not feedback_condition.is_feedback_required_for_credit %>
<% unless feedback_condition.is_feedback_required_for_credit %>
style="display:none"
<% end %> >
<%= link_to_help 'feedback_viewing_penalty',
Expand Down

0 comments on commit 6830308

Please sign in to comment.