Thanks David, that makes a lot of sense as a general case -- adding the "undroppable" flag.
I'm wondering if this eliminates the need for the "double the second exam" part, since if we make the second exam undroppable, but allow the first exam to be dropped if it is the lowest one, then the normal projecting of course grades would be in effect, so if the first exam is dropped the second exam would be scaled up to be worth the entire category... would this satisfy the instructors of LSA Chem 130?
I believe the effect would be the same, but it would eliminate the need for screwy instance-specific code. We could simply add the undroppable feature and turn it on/off with a sakai.properties flag.
Okay, so assuming we modify to use the w(1-x) as described in
, then I see the work involved for this one as the following:
(1) create a new table with the new boolean param (see GRBK-479
for why this is necessary -- we can use the same table for both tickets)
(2) modify the queries in GradebookToolService.java so they join against this table whenever we're bringing back Assignments
(3) add a new enum value IS_UNDROPPABLE to org.sakaiproject.gradebook.gwt.client.model.key.ItemKey
(4) modify the interface org.sakaiproject.gradebook.gwt.client.model.Item (and it's two implementation classes) to include the accessors for this new enum
(5) in the client code, modify org.sakaiproject.gradebook.gwt.client.gxt.view.panel.ItemFormPanel.java by adding a new Field for the undroppable enum value, add a call to initField (in initState) for that new column -- wire in turning this on/off using the SCALED_EXTRA_CREDIT enum as an example -- requires changes in Gradebook2ComponentServiceImpl as well.
(6) in org.sakaiproject.gradebook.gwt.sakai.Gradebook2ComponentServiceImpl.java, modify the following methods to take into account the new param
(7) modify org.sakaiproject.gradebook.gwt.sakai.calculations.GradeRecordCalculationUnit (and its constructor) to include a boolean for this value
(8) in org.sakaiproject.gradebook.gwt.sakai.calculations.CategoryCalculationUnit, modify the for loop at the bottom of the calculate() method to check to see if the GradeRecordCalculationUnit is undroppable... if it is I think you just want to skip that drop logic and add it to the units to count, but you'll need to figure out a sensible way to break out of that loop under the condition where you have more items to drop but none of them as droppable... this is the biggest complexity of the work.
(9) You'll need to do something similar in org.sakaiproject.gradebook.gwt.sakai.calculations.GradebookCalculationUnit.sumPoints() to handle the points-based gradebooks.