Gradebook 2 into Moodle 1.5

Gradebook 2 into Moodle 1.5

by Gustav W Delius -
Number of replies: 33

I would very much like to see gradebook2 get into the main CVS repository. Because the new central grades table requires changes to all grading modules, this is really required if development on the gradebook is to proceed. The way this could be done would be to create a branch in dedicated to integrating gradebook2 into moodle. Once everything is working well in this branch it could be merged into HEAD. Martin, would this be o.k. with you?

We would like to contribute improvements to the gradebook as part of our "Serving Mathematics" project.

In reply to Gustav W Delius

Re: Gradebook 2 into Moodle 1.5

by Jean-Michel Védrine -

Hello Gustav,

I already made some modifications and bugfixes to gradebook2. I also tried to clearly differentiate no grade and zero grade cases (not sure that I catch all issues) because some of my students tend to be ill when there is a test or an assignment and if they have no reason they get a 0 mark but if they have one they are not graded. I also did the (boring) job of replacing all hardcoded english strings with calls to get_string. I will happily made my work available if someone is interested.

In my opinion this a very valuable addition to Moodle, but the GID would need some work for a better integration in Moodle. It would also simplify the code to call existing Moodle lib functions in numerous places.

PS did you see my message about preg_replace in gradebook2 and calculated columns in the other thread ? Did you agree with my fix ?

In reply to Jean-Michel Védrine

Re: Gradebook 2 into Moodle 1.5

by Gustav W Delius -

Hi Jean-Michel,

I saw your name in the other thread and was therefore aware that you had done a lot of work on this gradebook2 to fix bugs. However I haven't followed the developments in detail. That thread is simply too long sad. Too really work on this development we need a) a branch in CVS and b) a section in the bug tracker.

In reply to Gustav W Delius

Re: Gradebook 2 into Moodle 1.5

by Michael Penney -
HI Gustav, we've been trying to work with this code and we can't quite get our heads around the reason for a centralized grades table in a modular application.

Since many modules of moodle allow retakes, the average or the max, students grades may be changing all the time. So the central  grades  table  needs to be constantly querying the modules for new  grades anyway.  Thus a gradebook that requires rewriting all grading modules doesn't  seem efficient.

Why not just new features in the existing gradebook that enable weighting, stats, bar charts, etc. with the numbers receieved from the modules?
In reply to Michael Penney

Re: Gradebook 2 into Moodle 1.5

by Jason Cole -
Hi Micheal,

I designed the new gradebook this way for scalability and performance. An application like this is accessed for read only more frequently than the data changes. When an instructor looks at all of the grades, they are accessing all of the grades for all of the assessments. In a large class with a large number of assessments that's a lot of queries and calculations to generate statistics.

What I wanted was a system that would minimize processing when someone accessed the system to check their grade or when the instructor accessed the gradebook for the class. Our experience with Blackboard indicates that when you try to scale a gradebook, on-the-fly calculation of the gradebook is very expensive.

So we've written this system as a central repository. Each module reports its grades to the central DB when they change. We don't need to poll every module, they just report when they have something new to report. When there's a new grade, we recalculate and store the stats for the assessment and the class. That way, when a student accesses the gradebook, all we do is a simple query of one or two tables instead of hitting every module.

It also makes it easier to generate the stats. We looked at a number of different schemes to avoid rewriting the modules but a centralized repository is the one that made the most sense.

Hope that helps.

J
In reply to Jason Cole

Re: Gradebook 2 into Moodle 1.5

by Jean-Michel Védrine -

Hello,

I think Jason is right and I fully agree with his arguments. I think Moddle NEED central tables for it's gradebook but at the same time this new gradebook should be designed not to be dependant from the modules from wich he receive it's grades and this is perfectly done in Jason work. If tomorrow we decide that a new module need to put it's grades in the new gradebook it's only a matter of a few lines of code in 1 ou 2 files of this module no change is needed in the gradebook !!

Also you must not think that "So the central  grades  table  needs to be constantly querying the modules for new  grades anyway" because it don't work this way : the gradebook doesnt query the modules. The module itselft  put it's grade at each new attempt and it does not make a big difference in time of processor work to put a grade in a module table or in a central table

In reply to Jean-Michel Védrine

which two lines?

by Michael Penney -
Hi jean, we're trying to update our version of lesson to test with this module, but I can't find which two lines of code need to be updated, there doesn't seem to be anything specific in the commenting to gradebook2 in the modified lesson files I have.

Anyway, this would help us resolve this as we have a pretty large course (140 students, 45 lessons) backed up to test gradebook2 and our own additions of weighting to gradebook one.

My coders seem to think the MySQL/PHP environment is fast enough to make the difference between a central table and querying the mods much less of a problem than it would be in some other environments.
In reply to Michael Penney

Re: which two lines?

by Jean-Michel Védrine -

Hello Michael,

I saw your "Lesson reloaded module" and installed it. Seems a great improvement on standard lesson mod. I will look into making it "GB2" enabled and send you the code changes if you want.

In reply to Jean-Michel Védrine

Re: which two lines?

by W Page -
Hi Jean-Michel!

You sound really busy, but, could you create a "fake" course with some "fake" students and allow teacher and student logins so some of us could see how you have implemented GB2.  I would really like to see how you implemented the "Widget".

WP1

In reply to W Page

Re: which two lines?

by Jean-Michel Védrine -

Hello,

unfortunately the widget grid is NOT implemented now, I was just asking the question "would something like this solve the problem with current GB2 GUI ?"

But you can see yourself : I setup some students (student1 to student3 password student1 to student3) and a teacher (teacher password teacher) on a fake course (gradebook test) on http://www.vedrine.net

Some notes :

  • I didn't had time to setup some activities, you will have to do it yourself
  • I am pretty sure the fra lang file is up to date but the eng one miss some strings, sorry ! will look into that as sooon as I can
  • I removed the final grade from student view as it don't suit my needs but left it in the teacher view.
  • unfortunately yesterday I replaced lesson mod with new "lesson reloaded" but didn't had time to make it "GB2 enabled" so lesson grades will not show up in the gradebook, only forums, tests and assesments grades
  • please this is my production website so try not to mess anything !!

I you spot some bug, please let me know, it's not very good having students complaining that grades are wrong (it already happened with not graded student displaying as '"0" !!!)

If you find some mastake in eng file I would be very happy to correct them (as you may know english is not my native language grand sourire)

In reply to Jean-Michel Védrine

Re: which two lines?

by Jean-Michel Védrine -
Opps I made a big mistake it's http://www.vedrine.org  NOT .NET wich is one of my others websites unrelated to Moodle !!!
In reply to Jean-Michel Védrine

Re: which two lines?

by W Page -

Hi Jean!

Thanks for posting your site and allowing folks to checkout the "Widget".  The "NET" site is very nice. I will be visiting it again when I have more time.  I did not get a chance to check out your "ORG" site until today.  Been running so much lately.  It was very nice to see the teacher and student view.

WP1

In reply to Michael Penney

Re: Gradebook 2 into Moodle 1.5

by Gustav W Delius -
Jason has already given a good reply on why we need a central gradebook. Looking at grades is a favourite activity of teachers and students mixed and currently this puts a heavy load on the server, especially for large classes or when looking at the grades from several courses (I know this isn't an official Moodle feature yet, but this cross-course reporting is something that Moodle will have to provide in the future).
In reply to Gustav W Delius

Re: Gradebook 2 into Moodle 1.5

by Jean-Michel Védrine -

Hello,
As I said before on this board, I think Moodle really need a gradebook with centralized tables.
I installed gradebook2 and in fact I am running it on my production Moodle site http://www.vedrine.org (I am the only teacher using this site, my University choose Claroline another LMS  but here in France every teacher is totaly free and can do what he wants so I took the Moodle way and nobody complained so far !!)
After a few weeks of use I think it's time to write the state of my current thinking about Moodle gradebook2 (GB2).
1) first thing is to say that I thank a lot Jason and his student for giving us this addon, so further critics only aim is to improve gradebook2 !!
2) I understand that a lot of people (like me) are in a urgent need of a gradebook but, as Gustav said, not to waste our efforts it seems evident that we need to carefully study future Moodle gradebook features and work in a coordinated way on a CVS branch
3) some design decisions need to be made very quickly, for instance :
  what grading scales should the gradebook use (I find GB2 numerical, litteral, pass/fail credit/nocredit well done but do anyone have other needs ? do we want to use Moodle scales ?)
  How are conversions between scales handled ? (for instance as a recent msgs pointed out, it would be usefull to be able to say <70 -> fail >=70 -> pass and also things with credit to numerical conversions)
4) should this be a module ? this question has been asked before. Should we make it a block or something else ?
5) I don't want to seems severe but GB2 code quality isn't up to Moodle standards and in a lot of places could be simplified a lot using Moodle lib functions wich would have the added benefit to make future evolution easier
6) I don't know if it's my setup but I had a lot of issue with wrong casing (like A_from and a_from) this need to be corrected in all the files
7) GB2 GUI is sometime very confusing and largely different from Moodle one. This point needs some work. I have classes of more than 150 students with a lot of grades because all tests are done in groups of about 30 students, the grid view is (on a recent PC) awfully slow, so I already eliminated it from enlarge.php and use window cursors instead. The idea of using CSS seems good. Maybe we should look at something like http://www.activewidgets.com/grid/ if it is not too slow with hundreds of students and grades !!
8) some points need a better integration : if I use (and I do !) calculated columns, final grade is of no use to me, so there should be a way to not display it.
9) What about periods (semesters, ...) do we need to implement them (I think so !!) and how ?
10) grades categories are great and I already use them a lot. Do we need subcategories also ? If yes we shoud use the same GUI adopted in other places in Moodle (and the one that will be adopted for quiz questions hierachical categories as I understand it)

11) as I teach statistics, I would really want a way for my students to access grades statistics and graph

12) The distinction between no grade and "0" grade is very important for a lot of people so this should carefully reviewed in GB2 code.
13) I certainly foget a lot of things ...
To conclude I really hope we will not end with several uncompatible and uncomplete gradebooks wich none of them will be adoped in standard Moodle !!

In reply to Jean-Michel Védrine

Re: Gradebook 2 into Moodle 1.5

by Gustav W Delius -
I am glad that you are putting all this thought into the development of the new gradebook. I agree with you that this is a very important component and should be done properly. Unfortunately personally I haven't even had time to look at the code yet. In your personal opinion, is the code written in a way that makes it sufficiently easy to understand and develop further? If so, then I think it would be worthwhile to try to incrementally make it more moodly.
In reply to Jean-Michel Védrine

Re: Gradebook 2 into Moodle 1.5

by Jason Cole -
5) I don't want to seems severe but GB2 code quality isn't up to Moodle standards and in a lot of places could be simplified a lot using Moodle lib functions wich would have the added benefit to make future evolution easier

Jean and Michael,

Can either of you give me a couple of examples of non-Moodly code that you find confusing or overly complex? I'm meeting with Maria in the next couple of days and I'd like to be able to give her some specific direction...

Part of what she needed to do was use an object-oriented approach, perhaps that is adding to the confusion?


In reply to Jason Cole

Re: Gradebook 2 into Moodle 1.5

by Michael Penney -
Hi Jason, off the top of my head there are alot of things like <?php ">" ?> in there.

One of our programmers, Jeff Graham did an analysis of the module a fre weeks ago with an eye to what kind of work it would take to make it 'moodlelized', I'll get him to send that to you.

Part of what she needed to do was use an object-oriented approach, perhaps that is adding to the confusion?

I think the oo approach used causes some confusion because it seems to be c or java like oo rather than php style (eg separating the data from the display may be more helpful than creating alot of 'objects' with mixed data and display).

If the existing oo approach needs to be stuck to, clear commenting in the code and perhaps the object structure described in the read me file would be a help.

In reply to Michael Penney

Re: Gradebook 2 code style analysis

by Jeff Graham -
I took a long look at the code trying to wrap my head around it and came up with the following:

- Comments were non-existent and when they did exist they pertained to something 30-40 lines before where there were, or were obviously in regards to some piece of code that no longer existent

- Seperation of code and data, would be nice. Given that there are 36!!!! files the code and data shouldn't have been intermingled as much as it was. For instance the:
<?php echo $somevar; ?>
statements make it difficult to grasp and confuses the code rather than helps, look at addcategory.php for an example. Single quote print statements such as:
print 'some html'.$somevar.'more html';
don't take all that big of a performance hit.

There is lots of javascript. This is okay if it serves a solid purpose and is fuctional. Error checking has to be done server side as well for solid robust applications and with grades at stake this is critical. Using javascript from my experience tends to lead to browser incompatibilities unless it is a small amount and limited.

Filenaming convention jumps between some_filename.php and somefilename.php it should be either, but not both.

Lots of files only have two functions. The way the files and functions were broken up would make sense if there was a huge discrepency between which files used given functions, but there is a lot of overlap. These could/should be rolled up into 8 files at the most in my opinion. For instance if the lib files were rolled up they would make one big one with a limited amount (less than 5) of extraneous functions for certain files. Using templates and breaking code up into seperate files, such as 'grade.php' and 'grade.html' as per the suggested Moodle coding style would be helpful.

My first comment to Michael after looking at the code was "it looks like whoever coded this is used to C/C++" smile

Hope that helps.
In reply to Jason Cole

Re: Gradebook 2 into Moodle 1.5

by W Page -
Hi Jason!

Why not have the student programmer working directly with the code interact with the other GB2 interested Moodler developers directly? That would probably save some time in getting things implemented.

WP1
In reply to Michael Penney

Re: Gradebook 2 into Moodle 1.5

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I'm sorry I've been absent on the recent gradebook discussions. sad

First thing is that a central database is not only necessary for simple display of grades to people, but an essential step towards conditional activities (making access to activities dependent on grades from other activities). Because these things will be used every time course pages are displayed, they need to be pre-calculated and simple to access.

Secondly, we want to add manual columns, calculated columns etc ... which are not related to external modules. It makes it all easier to keep everything consistently central.

Has anyone been using the Jason Cole Gradebook? I would like to get this rolling in CVS ... I haven't tried it yet - can anyone give me/us a quick summary of where it's at, what it does well and what it needs still?
In reply to Martin Dougiamas

Re: Gradebook 2 into Moodle 1.5

by Jason Cole -
The gradebook is nearing readiness...

I tried posting the most recent code to CVS, but I was having problems that day, so the most recent code is in this forum in a zip file..

The new code has better code / interface seperation, better commenting, and better use of Moodle functions.

It works and it has some nice features (manual columns, calculated columns, catagory weighting, stats, etc). Currently, the interface is ugly, ugly though. We're working on that part right now. Making it much more "Moodle-y" and reorganizing some of the workflow.

I'm hoping to get a test version up and running this weekend so everyone can come check it out.

Jason
In reply to Jason Cole

Re: Gradebook 2 into Moodle 1.5

by Michael Penney -

How about the questions wrt to module grades vs. gradebook grades?

Eg I finish a quiz and it tells me I get 80 points. The instructor changes this grade in the gradebook to 85. I look at the quiz review and it still says 80 or does quiz query the gradebook for the new grade? Will quizzes still handle the review stats or will these be handled by the gradebook, or will they be kept in both places?

Second, how well tested is running the calcs on submit? One of the biggest problems we have with Blackboard is dropping students at the submit phase of a quiz (a heartrending time to get dropped). This has approached %10 in some classes. Moodle is currently running well below .1% (in a class with 56 timed single attempt lessons, we've had to reset 4 students so far due to ISP failures during the lesson.

So I'm pretty concerned that running alot of math on the submit function may decrease Moodle's high degree of stability at the grade submit phase.

IMO, this big of change in the way the modules work is a good thing in the long run for the reasons Martin lays out, but needs extensive testing to get the interfacing of grades between gradebook and modules right & it will need a new (and hopefully well documented) method for the modules to handle grades, that all grade producing modules will have to implement and stick to.

In reply to Michael Penney

Re: Gradebook 2 into Moodle 1.5

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
1)  I think the modules should always be displaying grades from the central gradebook store, so that they are consistent even if manually altered.

2) The amount of maths done on a quiz submit shouldn't be much different from what it does now.  The only difference is that the final result is written to a central table.
In reply to Jason Cole

Re: Gradebook 2 into Moodle 1.5

by W Page -

Hi Jason!

Can you point out the post with the "ZIP" file for the most recent GradeBook2 is in this forum.

Do you mean?
http://moodle.org/download.php/modules/gradebook2.zip

Is it at all possible to

  • Add the ability to sort categories into groups and have grades calculated for each group displayed so a teacher can see what the grades are for an activity for all the students at one look?
  • Get GradeBook2 to work with Zbigniew's code [checked into CVS]??
    Grade distribution statistics and graphing
    http://moodle.org/mod/forum/discuss.php?d=12747 
  • Have "printer-friendly" page and PDF page generation?

WP1

In reply to W Page

Re: Gradebook 2 into Moodle 1.5

by Jason Cole -
Here's the latest gradebook2 (with centeralized tables) code. There has been a lot of interface work and some new features..

  1. Drop lowest grade
  2. Add extra credit
Still has grade scales, weighting, calculated columns, etc. I'm trying to get it to work with the latest 1.4 build right now for a public demo. At the moment weighting isn't working for some reason. Hope to have that fixed soon.

You can see the interface at

http://ilearn.sfsu.edu/moodledev/course/gradebook/index.php?id=2

Login as Teacherdemo  password abc123
In reply to Jason Cole

Re: Gradebook 2 into Moodle 1.5

by Michael Penney -
Hi Jason, I just see the standard Gradebook there?
In reply to Michael Penney

Re: Gradebook 2 into Moodle 1.5

by Jason Cole -
Are you going to the right URL? Don't click on the grades link.. use the URL in the link. Put gradebook inbetween course and index

course/gradebook/index.php?id=2
In reply to Jason Cole

Re: Gradebook 2 into Moodle 1.5

by Jason Cole -
I've updated the database for the demo... Everything is working except the calculation of final grades. I'm sure I'm just missing a field or something. That's what I get for moving from Postgres to MySQL...

J
In reply to Jason Cole

Re: Gradebook 2 into Moodle 1.5

by Michael Penney -

Hi Jason, I created an assignment and graded it from the module. The grades came out multiplied by 100?

I changes Harry Potter's grade from 8700 to 90, then went back to the assignment module where the grade was still reported as 87. I think that for this to be less confusing, grades changed manually would have to update the module's grades.

Catgories still appear odd, the gradebook doesn't have a way to just show the catagories? This will get pretty long when folks have a few dozen assignments in the homework catagory. I thought I added an (moodle) assignment to a catagory, but it appears that this is no longer working?

When I click enlarge, I get this error:

<>Warning>: Missing argument 4 for calculatepoints() in /www/htdocs/moodledev/course/gradebook/grades_library.php on line 646

General things:

The interface still appears very complicated, why are the category, coursework, and grades drop downs above the header?

On IE6/XP the columns and Go button wrap to a second line & the javascript navigator jumps several columns/rows each time it's clicked.

Mac IE 5.2, its totally wacked (big suprisesmile. Mac Netscape it works fine though.

It still seems not to really work with Moodle activities very well. In our experience here, anyway, most of the grade for Moodle courses originate with Moodle activities, but this gradebook seems to me more (currently) designed to work with external activities than with Moodle activities?

Thanks for setting up this test site!

In reply to Michael Penney

Re: Gradebook 2 into Moodle 1.5

by Jason Cole -
Ah... so you're the one messing about with this.. thanks for the feedback..

I change.... grades changed manually would have to update the module's grades.
- Agreed... I'll pass that on..


Catgories still appear odd, .. This will get pretty long when folks have a few dozen assignments in the homework catagory.
Most instructors I work with want to see all of the individual assignments...which is why we went with the scroll bar the way we did. I'll see how hard it would be to have a display by catagory option

I thought I added an (moodle) assignment to a catagory, but it appears that this is no longer working?

That should be working... I think it's a porting bug (we're moving the code from 1.2 to 1.4 and trying to get MySQL working at the same time). I know it works on the developers reference version.

When I click enlarge, I get this error:

Warning: Missing argument 4 for calculatepoints() in /www/htdocs/moodledev/course/gradebook/grades_library.php on line 646

This I KNOW is a porting bug. Will have that fixed soon.

General things:

The interface still appears very complicated..

There are a lot of features... Any suggestions?

why are the category, coursework, and grades drop downs above the header?

It has to do with the way 1.4 handles the headers vs l.2. I just tracked that down and hope to have it fixed tonight.

On IE6/XP the columns and Go button wrap to a second line & the javascript navigator jumps several columns/rows each time it's clicked.

I think that's simply a setting in the JS. Let me check.

Mac IE 5.2, its totally wacked (big suprisesmile. Mac Netscape it works fine though.

It still seems not to really work with Moodle activities very well.... designed to work with external activities than with Moodle activities?

Except for not reporting changed scores back to the activity, how could we improve it? The activities report themselves to the gradebook and update when the score changes... There isn't a clean way to automatically assign a activity to a category (and therefore a weight), unless we assume that all activities of a certain type are in the same catagory...


Thanks for setting up this test site!

Thanks for testing the test site!


In reply to Gustav W Delius

Re: Gradebook 2 into Moodle 1.5

by W Page -
Hi Everyone!

  • Anyway to get GradeBook2 to work with Zbigniew's code??
    Grade distribution statistics and graphing
    http://moodle.org/mod/forum/discuss.php?d=12747 
    Zbigniew has checked the code into CVS.
  • Anyway to eventually get the grades for a student to display on a "MyMoodle" page??

 
WP1