lsuits / OBSOLETE--DO-NOT-USE--gradebook_moodle

LSU's fork of Moodle for gradebook changes
GNU General Public License v3.0
2 stars 1 forks source link

Percentage weight bug #7

Closed rrusso closed 12 years ago

rrusso commented 12 years ago

From Carey:

Now for the bad bit. in testing this, I randomly clicked on MC 2525 for Anne Osborne. There is something really strange going on with her category weighting. The actual percents, those that are in parenthesis by the category name have totals like (1000%) & (2000%).

She used whole numbers in her weight settings, so I suspect that is the problem. In previous Moode, you could use decimal or whole numbers, it didn't matter. Also one of her categies is weighted "20" but showing the actual percent of (0%). It has an extra credit item inside, so maybe that's the problem. I will look more into it, and contact the instructor to tell her that her grade totals are currently incorrect.

Looks like you are assuming out of 1 and not out of total to get percentages?

philcali commented 12 years ago

Category items parent category was incorrectly assumed to be the parent category. The grade API requires an additional call to retrieve the parent category.

$parent = $item->get_parent_category();
...

if ($item->is_category_item()) {    
    $parent = $parent->get_parent_category();
}

That was the only issue I found in testing.

rrusso commented 12 years ago

Sounds good. How do I test?

philcali commented 12 years ago

In branch: weighted_percentages. Apply the setting Show weighted percentages in the Gradebook preference page at the course level.

rrusso commented 12 years ago

Wow.

Not even close.

Now it will not show percentages for the category and shows percentages for SWM and SUM items in the cats.

Example Course ( Weighted Mean )

I get the following results in the gradebook:

Example:

Weights should only show up in weighted mean categories for both cats and items.

Under NO circumstances should weights show up in SWM and SUM.

And they are not correct. Extra credit should not be weighted .33 percent.

philcali commented 12 years ago

The only problem was that the weight was calculated for extra credit items.

This statement is wrong and unreasonably narrow:

Under NO circumstances should weights show up in SWM and SUM.

Weights are calculated for items in these aggregation methods instead of given (like WM), so I say why not?

I updated the branch.

rrusso commented 12 years ago

I see your point. At least make sure the weights are correct.

rrusso commented 12 years ago

See my latest email

exam 1 ( 25 ) exam 2 ( 25 ) exam 3 ( 50 ) exam extra credit ( -1 - extra credit checked )

Shows up as

exam 1 ( 25.25% ) exam 2 ( 25.25% ) exam 3 ( 50.51% ) exam extra credit ( -1.01% - extra credit checked )

So we have 101.01% - extra credit of 1.01% to = 100%...weird.

rrusso commented 12 years ago

This issue only occurs in WM as far as I can tell.

philcali commented 12 years ago

It was > 0 instead of < 0. Also, this branch alone does not recognize WM as an extra credit category (because Moodle doesn't). You'd have to merge in the changes with weighted_mean_ec to a see a difference.

philcali commented 12 years ago

I'd also add: the real test is the consolidated branch, as it includes all the gradebook changes into a single branch.

rrusso commented 12 years ago

And how does one test this branch?

philcali commented 12 years ago

I never work off of consolidated as the changes are in the children branches. If you already have it locally: git branch -D consolidated. Add gradebook_moodle as a remote: git remote add gradebook git://github.com/lsuits/gradebook_moodle.git

Fetch consoldiated:

git fetch --no-tags gradebook consolidated:consolidated

Voila!

rrusso commented 12 years ago

Works great!