-
Notifications
You must be signed in to change notification settings - Fork 8
lml/ost#346: Make feedback penalty configurable. #350
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,17 @@ | ||
# Copyright 2011-2012 Rice University. Licensed under the Affero General Public | ||
# Copyright 2011-2014 Rice University. Licensed under the Affero General Public | ||
# License version 3 or later. See the COPYRIGHT file for details. | ||
|
||
# Place all the behaviors and hooks related to the matching controller here. | ||
# All this logic will automatically be available in application.js. | ||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ | ||
$ () -> | ||
feedbackRequired = $ ".field.feedback-required input" | ||
feedbackRequired.click () -> | ||
feedbackPenalty = $ ".field.feedback-viewing-penalty" | ||
feedbackPenaltyValue = feedbackPenalty.find "input" | ||
if feedbackRequired.is ':checked' | ||
feedbackPenaltyValue.val "100" | ||
feedbackPenalty.show() | ||
else | ||
feedbackPenaltyValue.val "0" | ||
feedbackPenalty.hide() |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,10 +19,19 @@ | |
The assignment event to use when determining feedback availability: | ||
<%= form.select :exercise_correctness_option, exercise_correctness_options %> | ||
</div> | ||
<div class="field"> | ||
<div class="field feedback-required"> | ||
<%= 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 commentThe 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 commentThe 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. The norm in the baseline is to use
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense. Will fix. |
||
style="display:none" | ||
<% end %> > | ||
<%= link_to_help 'feedback_viewing_penalty', | ||
text="Penalty", | ||
{:title => 'Penalty'} %> if a student does not view feedback (0-100%): | ||
<%= form.number_field :feedback_viewing_penalty, in:0..100, step:1, size:3 %> | ||
</div> | ||
<div class="field"> | ||
<%= form.check_box :can_automatically_show_feedback %> | ||
The site can automatically present students with feedback if other conditions are met. <%#<%= link_to_help 'auto_feedback' %> | ||
|
@@ -96,4 +105,4 @@ | |
FeedbackCondition::AvailabilityClosesOption, :DELAY_AFTER_OPEN %> | ||
of <%= form.text_field :availability_closes_delay_days, :size => 4 %> days</p> | ||
</div> | ||
</div> | ||
</div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<%# Copyright 2011-2014 Rice University. Licensed under the Affero General Public | ||
License version 3 or later. See the COPYRIGHT file for details. %> | ||
|
||
<%# TODO: @Kim %> | ||
|
||
<p> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for sticking this in. |
||
This field allows you to configure the credit penalty in percentage. For example, if | ||
you set a value of 25%, then students lose 25% of their credit if they fail to view | ||
their feedback on time. | ||
</p> |
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.