gradebook_cdc & scaled assignments

gradebook_cdc & scaled assignments

by Thom Vreeland -
Number of replies: 5

I've begun playing around with the cdc version of gradebook and came across some strange behavior.  I'm wondering if this is typical or if I've done something wrong?

I created an assignment using a scale instead of points.  When I open the gradebook, the assignment shows up as uncategorized.  I can't find any way to put it into a category.  Additionally, it shows up with Max Points = 100 and always scores at 0%.

So, is this the correct behavior or did I do something wrong?

PS - I did find if I give it a point score, give it a category in the gradebook, and then change it to using a scale it'll keep it's category.  Still 100 pt max and 0% though. sad

In reply to Thom Vreeland

Re: gradebook_cdc & scaled assignments

by Jeff Graham -
hi Thom,

What you are experiencing is the assignment module not following the suggested  (implied?) API for modules. If you set it to scale it does not return a maxgrade. How do you calculate a percent for a student then? Additionally it may or may not return any grades for students. As far as I know scales have no quantitative meaning so they don't really belong in the gradebook. (correct me if I'm wrong)

I would suggest pointing this out in the assignment forum. My information is based on the developer documentation and the moodle module template. You can download this at http://moodle.org/mod/newmodule_template.zip inside it is a lib.php that has a  section:

function NEWMODULE_grades($NEWMODULEid) {
/// Must return an array of grades for a given instance of this module,
/// indexed by user.  It also returns a maximum allowed grade.
///
///    $return->grades = array of grades;
///    $return->maxgrade = maximum allowed grade;
///
///    return $return;

   return NULL;
}

From the comments it says MUST return an array of grades and also a maximum allowed grade. The forum module is also broken according to this, and AFAIK every other module that uses scales.

Initially the gradebook_cdc code was setup to ignore these module items they wouldn't even show up. I thought this was the only appropriate way to handle a module that doesn't follow the guidelines. Michael Penney sugessted that we should assume 100 for the max since they don't return a value. The problem with this assumption, as you have just pointed out, is that the modules also don't necessarily return any grades for students. So the gradebook_cdc code will probably revert to the previous method of dropping these module items from grade calculations.  Unless there is some other suggested method for handling scales that makes sense, but I would suggest that these changes should be handled by the modules themselves so that the gradebook doesn't make any assumptions (like assuming max grade=100) so that there is no "surprise" grading showing up.


In reply to Jeff Graham

Re: gradebook_cdc & scaled assignments

by Thom Vreeland -

Thanks!  That helps a lot!

I'll focus my attention on the assignment module now smile

In reply to Jeff Graham

Re: gradebook_cdc & scaled assignments

by Thom Vreeland -

I've been playing around with this issue.  The reason it's important for me is that I work in a HS that uses a non-graded, standards & benchmark pedagogy.  However, it is useful to set specific, numeric minimum requirements for students on homework, class participation, etc.  Additionally, I teach the Interactive Mathematics Program which is primarily a student-centric and student-driven curriculum.  (I should mention that I'm using Moodle for my classes only -- it's not a schoolwide system right now)

I currently have several weekly grades I give the students:  class participation and "leadership" being two of them.  Take the leadership grade for example.  It's a grade I give to students based upon how much leadership initiative they demonstrated during the week.  I use a scale that has 4 possible values:

  • 0 - No Leadership demonstrated
  • 1 - Demonstrated leadership within your group
  • 2 - Demonstrated leadership during a whole class activity
  • 3 - Demonstrated leadership within your group and during a class activity.

Now, I require my students to earn a specific # of points during the semester to receive credit in my class.  Therefore, getting the gradebook to calculate a score would be a great assistance.

Here's my thinking:

Assumptions
I assume that I'll always use the scale with associated numeric "points".  I further assume that the scale has been input from least points to greatest point value, beginning from zero and increasing by 1 point for each entry in the scale.  (I always do point systems this way)

Changes to existing code
I've already changed the assignment module to return the maximum points for the assignment if it's using a scale (based upon my assumptions above).

My thinking is: if I also change the assignment module to return the grades as an array (grade, description), then it should be possible to check in the gradebook module to see if the grade is an array.  If this is the case, then the gradebook will know it's a scaled assignment and can execute specialized code to calculate points per assignment, category points, etc.

Obviously, if this idea is attractive to others, we should add the "option" of whether or not to calculate points for scaled items in the gradebook advanced options.

Questions
Could somebody who's more intimately familiar with the gradebook_cdc code help me focus in on where to experiment with these changes?  The code is a bit bulky and I haven't had a chance to print it out yet.  I tried returning the array to find where it's used and found gradeslib.php:469 generated errors on grade being an array.

Thanks for reading this lengthy post!

In reply to Thom Vreeland

Re: gradebook_cdc & scaled assignments

by Jeff Graham -
Thom,

The grades are first brought in from the modules in the function 'grade_get_grades' this is the first step. Get your grades importing into this function first (should be trivial). Instead of an array as you suggest I would recomend continuing the object model that is already implemented, just set and extra field like maxgrade called scaled and set it to true or 1 in the grades function for whicheve module you modify. In the grade_get_grades function I would suggest setting something like
$grades["$mod->cname"]["$mod->modid"]["$mod->cminstance"]->scaled = 1;
So that you can later know that this is a scaled assignment (in the next step).

The last part will require you to add special handling code for scaled assignments in "grade_get_formatted_grades" based on your scaled setting this is where the raw points are turned into something meaningful. Take a look at the handling code in this function for either; 'scale_grade', 'hidden', 'extra_credit', or 'sort_order'. That should give you an idea of what is necessary to implement your proposed solution. The code is fairly well commented block by block so it should be straightforward to see what is going on globally. The data structure is a little nasty due to pieces of information being everywhere and trying to consolidate them with all the features of gradebook_cdc, but it shouldn't be too cumbersome.

Unfortunately I think that your solution is too specific (ie. it assumes so much about the structure of the scale) to be useful in general, but I may be completely wrong so good luck smile

Regardless, it seems there does need to be a general way of making sense out of the scaled graded items if they are to be of any quantitative use in calculating grades. I think there needs to be more discussion in this regard concerning modules, grading, and the gradebook.

hope that helps smile
In reply to Jeff Graham

Re: gradebook_cdc & scaled assignments

by Michael McDermott -

I have just picked up on this issue (scales telling students they got 0 / 100 in assignments) and it is causing real problems for me. What I can't fathom though is why it is OK in Moodle 1.4.5 but causes a problem in 1.5 and 1.6.

 

Mike McDermott