From 6830308bf2cf66a348e1c9e589aa674bfef8dfc0 Mon Sep 17 00:00:00 2001 From: lakshmivyas Date: Sat, 28 Jun 2014 15:26:51 +0530 Subject: [PATCH] lml/ost#346: Fix JP's review comments. - Use `unless` instead of `if not` - Use floating point division. --- app/models/feedback_condition.rb | 2 +- app/views/feedback_conditions/_form_fields.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/feedback_condition.rb b/app/models/feedback_condition.rb index 956cda19..17e081cf 100644 --- a/app/models/feedback_condition.rb +++ b/app/models/feedback_condition.rb @@ -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 diff --git a/app/views/feedback_conditions/_form_fields.html.erb b/app/views/feedback_conditions/_form_fields.html.erb index 97eeb501..599bf66d 100644 --- a/app/views/feedback_conditions/_form_fields.html.erb +++ b/app/views/feedback_conditions/_form_fields.html.erb @@ -24,7 +24,7 @@ Students must view the feedback to get credit for the problems.
+ <% unless feedback_condition.is_feedback_required_for_credit %> style="display:none" <% end %> > <%= link_to_help 'feedback_viewing_penalty',