-
Notifications
You must be signed in to change notification settings - Fork 8
lml/ost#346: Make feedback penalty configurable. #350
Conversation
navilan
commented
Jun 12, 2014
- Add feedback penalty field to the settings store.
- Add feedback penalty to show and edit views.
- Add JS to show / hide penalty based on feedback required.
- Add help file for @kjdav with some help text.
- Ensure score detail page does not need any updates.
@kjdav - the help file is _feedback_viewing_penalty.html.erb |
- Add feedback penalty field to the settings store. - Add feedback penalty to show and edit views. - Add JS to show / hide penalty based on feedback required. - Add help file for @kjdav with some help text. - Ensure score detail page does not need any updates.
<%= form.check_box :is_feedback_required_for_credit %> | ||
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 %> |
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.
Might need some JS to display this when the checkbox is clicked.
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.
Nevermind... unobtrusive JS always gets me.
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.
Ha ha ha - yeah. Good thing is, code like this would soon be history :)
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.
The norm in the baseline is to use !
instead of not
. Here you can also say
unless feedback_condition.is_feedback_required_for_credit
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.
Makes sense. Will fix.
- Stop getting confused between JS and CS. - Fix copyrights on changed files.
@@ -303,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 ? 0 : 1) | |||
student_exercise.update_feedback_credit_multiplier!(is_feedback_required_for_credit ? feedback_viewing_penalty/100 : 1) |
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.
Since feedback_viewing_penalty
is an integer, dividing by another integer will do integer division, e.g. 12/100 == 0
. To force the division we expect, divide the attribute by a float: feedback_viewing_penalty/100.0
.
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.
Oops. Its like I am learning to code again ;) Thanks. Will fix.
- Use `unless` instead of `if not` - Use floating point division.
#346: Make feedback penalty configurable.