Gradebook rewrite

Gradebook rewrite

by Jason Cole -
Number of replies: 53
One of the graduate students I'm working with has just gotten her new gradebook to the point where it's ready for public review. It's still an alpha, but we wanted to release it as soon as we had something working.

We took the best features from the electronic gradebooks we were familiar with and added  some really interesting features. Hopefully, this will provide a platform for moving forward with the gradebook to make Moodle so far ahead of the other platforms that they'll just give up.big grin

Our new gradebook installs as Gradebook as an alternative to the Grades feature.

The features we've put together:

1. Grades from all graded components are now stored in a centralized table (we've added code to quizzes, forums, assignments, and a couple of others. We're still working on workshop).
2. Grade catagories: You can add a catagory label to each grade
3. Grade weighting: You can choose to weight grades by catagory or by individual ite,
4. Locked scrolling: The coolest interface widget I've seen. Click a box and the first row and column lock depending on whether you are scrolling horizontally or vertically
5. Calculated columns: You can add a calculated column anywhere
6. Grading scales: You can add letter grades or other scales into the calculations

There are a couple of other niceties in there as well.

The disadvantage of our system is that it does require code changes to all of the other grade producing modules. But once it's done, it won't have to be done again. This method will make the gradebook much more scalable and useful. We'll reduce the number of database calls and that really ugly nesting that occurs now.

The table descriptions are only for postgres right now. I'd appreciate any help with new table desc for MySQL.

It is now available in cvs/contrib/gradebook2

I'll be adding the modifications for the other modules to that directory in the near future.


In reply to Jason Cole

Re: Gradebook rewrite

by Thomas Haynes -
Wow!

This is quite timely. We have been looking for a gradebook more like what the teachers are used to.

I am on MySQL and while I am a nice guy, I am not the one to help you figure out table desc.

I'll be watching progress here and giving it a try as soon as I can.

I had always hoped that an open source program I have been using (Bessie) would be integrated into Moodle.
In reply to Jason Cole

Re: Gradebook rewrite

by Gustav W Delius -

This gradebook based on a central grades table is what Moodle has been waiting for for quite a while. Thank you for delivering.

Because this will involve changes to all modules with grades it will be very tedious to install from cvs/contrib. Perhaps Martin would be willing to give you a branch off the main cvs trunk on which you could commit your changes. That would make things much easier for testers.

In reply to Jason Cole

Re: Gradebook rewrite

by W Page -

Hi Jason,

Thank you  to you and your student.

This looks like a really nice addition to Moodle.

I was not clear however on the following.

  • How will trimesters, semesters, etc be indicated in the GradeBook?
  • Will there be a a "printer" format for grades?
  • Will there be a easy way to add a grade for a a non-online assignment?

WP1

In reply to Jason Cole

Re: Gradebook rewrite

by Fernando Oliveira -
Picture of Plugin developers

The new features sound great. 

Has anyone has installed it on a test site? It would be great to see it in action.

Thanks for all your work!

In reply to Jason Cole

Re: Gradebook rewrite

by Michael Penney -
Hi Jason, given your switch to MySQL, is this working with MySQL yet?

I think we can put some time into this, as several faculty have identified as a reason the don't want to move from the ugly BBeast for nowsmile.

Do you have a road map with it, or is it pretty much done needing just bug squashing?


In reply to Michael Penney

Re: Gradebook rewrite

by Jason Cole -
Hi Micheal

Deon just uploaded the MySQL table defs. I haven't tested them yet, but they look promising.

I don't have a roadmap right now. I've pretty much gotten everything I want out of it. There's sure to be some usability issues and bug squashing to do though.


In reply to Jason Cole

Re: Gradebook rewrite

by Deon Metelski -

Hi Jason,

I have downloaded your gradebook and included all of the tables from the db file. I changed the syntax of the Postgres file to reflect MySQL syntax. Attached is the files. They successfuly added and the module shows up as module_name in the module admin. Since I am not a programmer, if someone wants to take a look at it, feel free. All tables from the Postgres are in there.

I am wondering though how I can show these changes. You stated that mods needed to be made to the grade producing modules. Can you describe those here or shoot me an e-mail. I am working off of the 1.4 Beta. Everything good so far. Yay!

Thanks,

Deon

In reply to Deon Metelski

Re: Gradebook rewrite

by Jason Cole -
Thank you!!!!!

I'll upload those to the CVS site today.

I should also have the modifications for everything except the workshop module uploaded either today or tomorrow.

Jason
In reply to Jason Cole

Re: Gradebook rewrite

by Michael Penney -
Hi Jason, this is great news. I'll refresh my CVS copy later today. How will we know find the module changes? We'll happily hammer it here and squash bugs as soon as we can get it up and running.

Faculty response here has been that with a better gradebook and the ability to do date/time based programming of course content, they would be happy to switch.

I have one of my folks building a course programmer right now, that will allow faculty to show/hide content on a time schedule.

Its getting better all  the timesmile.
In reply to Jason Cole

Re: Gradebook rewrite

by Jean-Michel Védrine -

Hello,

During my testing of the gradebook rewrite I came across 2 bugs :

  • bug#1 when you delete an activity module instance records from the gradebook_statistics table aren't deleted. This will require the addition of one line in each of the lib.php files
  • bug#2 for the lesson module the grade is always stored in the gradebook as if maximum grade was 100. this is because in view.php line:

$gradebook->points = $thegrade;

should be :

$gradebook->points = $thegrade * $lesson->grade / 100;

Note sure of the right way to submit a bug report for a contrib so I use the forum.

In reply to Jean-Michel Védrine

Re: Gradebook rewrite

by Jean-Michel Védrine -

Hello,

Here is my work : modified files for forum, lesson, quiz and assigment. I took yesterday CVS files and merged gradebook modifs. Please note that testing has been rather minimal and I would suggest to only use them to test gradebook rewrite on a test site.

I havenot included workshop mod as the original file is not complete.

I have included corrections to the 2 bugs I submited earlier.

I am also in the process to replace all hardcoded english words with get_string calls. Is anybody interested in sharing that work ?

In reply to Jean-Michel Védrine

Re: Gradebook rewrite

by W Page -
Hi Jean-Michel!

You appear to have gotten the "gradebook2" to some kind of working status. Could you please help me out a bit so I could help in testing the new mod as well. I will be installing it on a fresh v1.5 dev test site. It will be the only modification I will make on that site.

  1. Did you place all the files including the "db" directory into a directory named "gradebook2" within the "mod" directory or the main directory? In other words did the path look like, "moodle/mod/gradebook2" or "moodle/gradebook2"?
  2. You indicated that Gustav's gradebook script and tables needed to be installed to get CalculatedColumns to work. But I sensed by reading your post it was really just the "mdl_grade table" in the database? Couldn't the table be installed directly into the database via phpMyAdmin?
  3. In which "lib.php" files should the changes you indicated in a post above be done? That is, changing the line "$gradebook->points = $thegrade;" to "$gradebook->points = $thegrade * $lesson->grade / 100;". In what directories are those "lib.php" files?

After downloading the latest "gradebook2.zip" [http://moodle.org/download.php/modules/gradebook2.zip], I did the following:

  • I removed the "course" and "mods" directories from the latest "gradebook2.zip" file.
  • Renamed the "mods" directory to "mod"
  • Left the remaining files and "db" directory inside the "gradebook2" directory.

Thanks in advance for your response.

WP1
In reply to W Page

Re: Gradebook rewrite

by Jean-Michel Védrine -

Here is what I have done

  • create a gradebook directory in the mod directory of my moodle site (I think it's your first problem it's gradebook and not gradebook2 !)
  • put all the files from the gradebook2 directory in the gradebook2 zip (including the db subdirectory but not the mods and course subdirectories) in this gradebook directory.
  • I changed lesson, quiz, assignment, forum files to the ones I already sent to this forum.(only use them if you run Moodle 1.4beta or 1.5dev else use the ones from the mods subdirectory of the gradebook2.zip file)
  • I went to the admin page to create the tables for the gradebook module and initialise everything as usual for new modules
  • For some reason (maybe I should have modified the date in mysql.php) the modifications to the tables from mysql.php weren't executed so I ended doing them with phpmyadmin !!triste
  • I created the mdl_grade table acording to Gustav Delius readme file
  • as I didn't modified course lib.php file because it has changed a lot and I don't know exactly were are now menu links to the grades, I entered manualy the following links in my browser to test the gradebook :

mymoodlesite/mod/gradebook/index.php?id=XX for teacher view

and

mymoodlesite/mod/gradebook/calculated_col_grade.php?id=XX for student view

where XX is course id.

In reply to Jean-Michel Védrine

Re: Gradebook rewrite

by W Page -
Hi Jean-Michel!

As I indicated above, I am running v1.5 Dev. This is what I did. I think I followed your directions correctly but I am still getting warnings and error messages. I am not in "debug" mode.

1. I removed the "course" and "mods" directories from the decompressed "gradebook2.zip" file.

2. I created a directory named "gradebook" inside of the "mod" directory. The path was then, "/moodle/mod/gradebook/". I then uploaded the remaining "db" directory and files in the "gradebook2" directory up to the "moodle/mod/gradebook" directory.

3. I DLed and decompressed your "mods.zip" file. The assignment file in the resulting directory "mods" is mispelled "assignement". It should be "assignment". [I forgot to change it initially and received an error message. It went away when I removed the directory "assignement" from the server and then uploaded the files to the "assignment" folder on the server].

4. Visted the Admin page and all the tables installed with no problem.

5. The version date of the v1.5 Dev I am running is 2004082900. Since the "version.php" [moodle/version.php] file version date was 2004082900, I did not have to change it. I then changed the date in "mysql.php" [moodle/lib/db/mysql.php] file and appended [as outlined in "Gustav's" instructions] the indicated code to it. (I have attached this file to this post).

6. I then visited the Admin page. All "Success" but when I continued on there was a "Success" in the left upper corner of the page which persisted. When I went to the next page it turned into the word "Error" in red and is always there when I go to the Admin page. [This happened when running Gustav's Calculated Column script as well. The CalclatedColumns worked however and the Error message could not be seen on the rest of the site, only on the Admin page. Therefore, it was not big deal. People did report it however.]

7. I uploaded the "course/lib.php" file to "course/lib.php" but I received the following error message when I tried to access the site,"
Fatal error: Cannot redeclare print_side_block() (previously declared in /homepages/30/d94988299/htdocs/moodlegrade/lib/weblib.php:2460) in /homepages/30/d94988299/htdocs/moodlegrade/course/lib.php on line 1923
"

8. I then replaced the original "course/lib.php" file and got the HomePage of the site to load.

9. When I entered a course I created I got the following error messages within the "Recent Activity" block,
"Warning: print_recent_activity(/homepages/30/d94988299/htdocs/moodlegrade/mod/gradebook2/lib.php): failed to open stream: No such file or directory in /homepages/30/d94988299/htdocs/moodlegrade/course/lib.php on line 698"
and
"Warning: print_recent_activity(): Failed opening '/homepages/30/d94988299/htdocs/moodlegrade/mod/gradebook2/lib.php' for inclusion (include_path='.:/usr/local/lib/php') in /homepages/30/d94988299/htdocs/moodlegrade/course/lib.php on line 698"

10. When I visit the student page I see the following message,
"Warning: Invalid argument supplied for foreach() in /homepages/30/d94988299/htdocs/moodlegrade/mod/gradebook/calculated_col_grade.php on line 44".

11. When I visit the teacher page I see no apparent serious problem. However, it does look like some language strings are needed. I noted also that the module name is missing.

You can check out the site and error messages at the following links,

My MoodleGradeBook Test Site
http://s94988317.onlinehome.us/moodlegrade/
Course
http://s94988317.onlinehome.us/moodlegrade/course/view.php?id=3
Teacher View / GradeBook2
http://s94988317.onlinehome.us/moodlegrade/mod/gradebook/index.php?id=3
Student View / GradeBook2
http://s94988317.onlinehome.us/moodlegrade/mod/gradebook/calculated_col_grade.php?id=3

Login: teacher1010/teacher1010

Thanks for helping me get this up. I hope, if you have some time, you can help me out with the error messages. It would be appreciated.

WP1
In reply to W Page

Re: Gradebook rewrite

by Jean-Michel Védrine -

hello,

sorry for misspelling assignment but english is not my native language sourire

I think the warnings are caused by the fact you had a gradebook2 module in your first attempt and some records were inserted that are now incorrects. Look in the moodle tables to see if anything seems ok. Reinstalling a fresh Moodle and gradebook (with no gradebook2 directory) will be some work but will certainly solve the problem.

For your problem with the student view I believe it is caused by the fact that either no student are enrolled in the course or no activity wre created (not sure wich one is causing the problem, I must check the code). But this should not be a problem in normal use as this page is for students so obviously if someone see it he is a student and there is some activity. !! Of course we can add a test in the php script to prevent that warning from displaying.

Note : I have tried to create a student (student1 password : student1) and enroll him in course but the warning is still there. Another possibility is that you created a calculated column with summ(all) in the formula and there is no normal column in the gradebook so maybe this is causing the problem. Try to create some activities (forum quiz lesson assignment)

I have played a lot in the last 2 days with the gradebook and the only problem I am having until now is that Excel export produce incorrect .xls files (the original excel grades export from Moodle is OK). But I didn't have time to check export code until now. I spend a lot of time converting nearly all hardcoded english strings to get_string calls and producing a french lang file. My course are starting next week and my hope is to have gradebook running (I'm the only teacher on my Moodle site so I can take the risk) but french students want french speaking webpages grand sourire

I can't give you the adress of my website as I worked on a local easyphp install until now.

In reply to Jean-Michel Védrine

Re: Gradebook rewrite

by W Page -
Hi Jean Michael,

I will do an absolutely clean install later today [database & files]. 

What do you think is causing the Error message after installing the database for Gustav's CalculatedColumns.

Could you post a copy of your "moodle/lib/db/mysql.php" file so I could see where you placed the code in his instructions?  Maybe I am doing something wrong there.

WP1
In reply to W Page

Re: Gradebook rewrite

by Jean-Michel Védrine -

Hello WP1

I can't post my mysql.php because in fact I didn't manage to make it working. I'm rather new at moodle programing and I don't master the upgrade mechanism. I suppose it's a matter of dates and I seem to remember a very good post on this subject explaining how to change dates so that the mysql.php IS executed but I was not able to retreive it triste

So I ended creating the table in sql. In case anybody is interested here is the sql statement used:

CREATE TABLE `mdl_grade` (
  `id` int(10) NOT NULL auto_increment,
  `courseid` int(10) NOT NULL default '0',
  `coursemoduleid` int(10) default NULL,
  `scaleid` int(10) default NULL,
  `name` varchar(255) default NULL,
  `calculation` varchar(255) default NULL,
  `timemodified` int(11) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM;

I'm certainly not a mysql or postgres expert so can anybody give information on the following point:

the mysql.php file from gradebook2 use numeric datatype As I understand it in mysql this is equivalent to decimal and default to decimal(10,0). Is it the same in postgres ? Wouldn't it be better for the gradebook to store some digits after decimal point ?

By the way I found another problem in the letter/numeric grade conversions functions because of a difference in uppercase/lowercase A,B,C,D,F between database fields names and php code. On my test setup (easyPHP, PHP 4.3.3, MySQL 4.0.75) it doesn't work.

In reply to Jean-Michel Védrine

Re: Gradebook rewrite

by Jean-Michel Védrine -

Hello,

For those interested I have put the current state of my changes to the gradebook on download here  because it's too big to send it in this forum (140Kb). Translation is not quite finished.

In reply to Jean-Michel Védrine

Re: Gradebook rewrite

by Jean-Michel Védrine -

Hello,

I always had a lot of problems with pattern matching and regular expression in PHPso maybe I am wrong , but in the file gradeslib.php, there is the line:

$check = preg_replace('/(MA|PA)\d+/','/(A|C)\d+/', "", $check);

shouldn't it be :

$check = preg_replace(array('/(MA|PA)\d+/','/(A|C)\d+/'), "", $check);

and shouldn't we add regular expression for HAn and AAn also ?

The same remark apply to gradeslib.php file for the original hack for calculated column.

In reply to Jason Cole

New uploads for Gradebook rewrite

by Jason Cole -
Alrighty...

I've uploaded changes for the grade producing modules to a mods directory in the contrib/gradebook2 area
There is also a change to the course/lib.php file to create the link to the new gradebook for access within the course.


In reply to Jason Cole

Re: New uploads for Gradebook rewrite

by W Page -
Hi Jason,

I could not locate the course/lib.php file referred to in your post above when I decompressed "gradebook2.zip".

Wouldn't it have been like,
/moodle/course/lib.php

All the files were in one directory named "gradebook2"

Anyway, I uploaded the mod anyway into the mod directory just to see how it installed.. I went to the admin page and received this error,
Module gradebook2: /homepages/30/d94988299/htdocs/moodle14dev/mod/gradebook2/db/mysql.php was not readable

I was working with v1.4 Beta.

WP1
In reply to Jason Cole

Re: New uploads for Gradebook rewrite

by Herbert Keijers -
Hi Jason,
Like WP1 reported there is a problem, I'm not shure if we have the same ... smile
I've put gradebook2 in the mod directory and replaced lib.php in course/ by your version.
Moodle pages get not parsed anymore ... (I'm getting blank pages).
Apache gives the following error :
[Fri Aug 27 13:33:41 2004] [error] PHP Fatal error:  Cannot redeclare print_side_block() (previously declared in /usr/home/moodle/www/lib/weblib.php:2460) in /usr/home/moodle/www/course/lib.php on line 1923

I guess weblib.php has to be rewritten to

Thanks for the work, hope you have benefits from my report

In reply to Jason Cole

Re: New uploads for Gradebook rewrite

by W Page -
Hello!

I am getting mixed up with the CVS files for "gradebook2". I downloaded a zip file from the following link, but from the discussion in this thread I cannot figure out if all the relevant files are in the zip in the proper path for the script to work.

http://moodle.org/download.php/modules/gradebook2.zip

Can anybody help me out with this??

WP1

In reply to Jason Cole

Re: Gradebook rewrite

by Deon Metelski -

Hello All!

I just had some time to download the updates. It may be a verison issue. The mySQL syntax works great with 1.4 and 1.3.3. All the tables are setup but in 1.3.3 I do get an error message in the admin-module section (Table 'test.mdl_gradebook' doesn't exist
SELECT COUNT(*) FROM mdl_gradebook
). In 1.4 Beta no error message and just adds module_name to the list. I have not been following the dev part because I am at best an amateur at programming. I belive the other errors are also attributed to the version of Moodle. In the one error listed here with weblib.php I notice that Martin had moved part of the code from lib to weblib in 1.4. If you compare both versions of  lib/weblib.php you can see and read where he moved it to at the bottom of 1.4 weblib.php line 2457.

// ================================================
// THREE FUNCTIONS MOVED HERE FROM course/lib.php
// ================================================

I hope this helps out in some way. I cannot get past the errors either. I get different errors in 1.3.3 and 1.4. I even tried moving the code from the gradebook lib.php to where it is in weblib.php. I just got different errors. Follow the crumbtrail I guess. I'll work on it some more. big grin

Thanks,

Deon

In reply to Deon Metelski

Re: Gradebook rewrite

by Jean-Michel Védrine -
It seems to me that the patched lib.php only goal is to change the links for the teachers from "grades.php?id=$course->id" to "$CFG->wwwroot/mod/gradebook/index.php?id=$course->id"
and for the students from "grade.php?id=$course->id" to "$CFG->wwwroot/mod/gradebook/calculated_col_grade.php?id=$course->id"
As I use Moodle CVS version, these links are no more in lib.php (I found some in blocks/admin/block_admin.php but maybe there are other places)
In the meantime I was able to play with the new gradebook entering these adresses directly in my browser.
It seems very nice and I was able to add delete categories, grades, ...
For the mods modifs, I wasn't able either to use the patched files because they don't match the current CVS state.
In reply to Jean-Michel Védrine

Re: Gradebook rewrite

by Jason Cole -
I think I'm having CVS issues.

I the block_admin seems to be the place to replace the links. I'll take a look at that.


In reply to Jason Cole

Re: Gradebook rewrite

by Jean-Michel Védrine -

One thing to note for those interested in testing the gradebook rewrite is that in order to be compatible with gradebook calculated columns contrib from Gustav Delius it use the same mdl_grade table but installing the module will not create the table. So if you haven't the calculated columns previously installed they won't work. You must create the mdl_grade !!

After that calculated columns work.

I think I have modified files for quiz, forum, lesson and assignment compatible with today CVS state. A little more testing and I will send them.

In reply to Jason Cole

Got it running, questions

by Michael Penney -
Hi Jason et al.

Got it up and running on 1.4beta using jean-michel vedrine's mods above.

Looks great but I have some questions about how its supposed to operate.

When I add a new graded activity, the activity shows up in the gradebook, but without the total points for that activity the old gradebook showed. I note that if I add a new catagory, then it will show the total in that catagories screen, but not in the overview.

It seems like you should be able to add an activity to a catagory, ie I create a catagory of Chapter Tests, with a weight of 2, and add an item of test to that catagory. Then I add a lesson, call it test, etc. The lesson shows up and the test item of the Chapter Tests catagory, but I see no way to add the lesson I just created as a member of type test in the chapter test catagory?

Also, it doesn't show the course total possible points in teacher view (something our faculty have been complaining about in the standard Moodle gb as well).

So am I missing something? Shouldn't the gradebook pick up the points set for a graded activity when the activity is created?

And shouldn't the gradebook show the total points for the course?

If I'm missing something let me know. Otherwise, I'll set one of my programmers on making these changes.

A final issue is that when the gradebook is put in the modules directory, it shows up in the add module drop down, but of course it doesn't work. This seems like it will confuse people, could we put it somewhere else besides mod?

Overall, looks like some great potential here!
In reply to Michael Penney

Re: Got it running, questions

by Jason Cole -
We created it as a mod to avoid changing the main branch as much as possible. I don't think it should be a mod at all. I'll have to ask Martin about including it as part of the main code in 1.5

Your suggestions are right on. I have a meeting with the main programmer on Wed. Let me talk to her and then get back to you about the changes. She may be working on some improvements right now.

In reply to Jason Cole

Re: Got it running, questions

by W Page -
Hi Jason,

Why not just have the student interact directly with the Moodlers interested in the rewritten GradeBook in the Forums?  I would think that would be easier for all interested parties.

I have the script up on a site I created to test it.  Just having a bit of a problem with the "/moodle/lib/db/mysql.php" install.

WP1
In reply to Jason Cole

Re: Got it running, questions

by Michael Penney -
Great Jason, thanks! I have a pretty darn good Moodle hacker here I can put on a few things if you all like.

Regarding where to put it, maybe it would be better as a block? It will still run the automatic db upgrades from the blocks directory, and you could set it so that if an instructor adds it as a block, it just gives another link to access grades?

I think that would be easier to explain to faculty than the mod you don't addsmile.

PS our course programming tool should be ready for testing in a few weeks. That gives a single place to set date based hide/show restrictions for topics/weeks and/or activities within them --basically it 'programs' the 'eye' to get turned off/on automatically-- (the lack of which was the other complaint the faculty I've been showing Moodle had).




In reply to Michael Penney

Re: Got it running, questions

by Jean-Michel Védrine -

another couple of bug smashing !

bug#3
in calculated_col_grade.php the code:
    if($studentgrade){
      if($assignment->numeric_grade){         
         $grades[] = $studentgrade->points;
         $details[] = get_string("maximumgrade").': '.$assignment->points;
         $maxgrades[] = $assignment->points;    
      }else{
        if($assignment->letter_grade){          
           $grades[] = convertletter($scale, $studentgrade->lettergrade); //$grade->lettergrade;
           $max = highestletter($scale);
           $details[] = get_string("maximumgrade").': '.$max;
           $maxgrades[]=$max;
        }else if(strcmp($studentgrade->lettergrade,'P')==0 || strcmp($studentgrade->lettergrade,'CR')==0){
          $grades[]=1;
          $details[] = get_string("maximumgrade").': 1';
          $maxgrades[]=1;
        }else{
   $grades[]=0;
          $details[] = get_string("maximumgrade").': 1';
          $maxgrades[]=1;
       }
     }
    }else
      $grades[]  = "";
produce inexpected results if this tudent has no grade for this assignment because in this case neither $details[] nor $maxgrades[] get some value so the resulting table is completely messed (maxgrades and details on the folowing lines don't match assignments)
solution
replace the code with
   
    if($assignment->numeric_grade){
      if($studentgrade) {
         $grades[] = $studentgrade->points;
      }else{
         $grades[]  = "?";
      }
      $details[] = get_string("maximumgrade").': '.$assignment->points;
      $maxgrades[] = $assignment->points;    
    }else{
      if($assignment->letter_grade){          
        if($studentgrade) {
           $grades[] = convertletter($scale, $studentgrade->lettergrade);
        }else{
           $grades[]  = "?";
        }

        $max = highestletter($scale);
        $details[] = get_string("maximumgrade").': '.$max;
        $maxgrades[]=$max;
      }else{
        if($studentgrade) {
          if(strcmp($studentgrade->lettergrade,'P')==0 || strcmp($studentgrade->lettergrade,'CR')==0){
            $grades[]=1;
          }else{
            $grades[]=0;
          }
        }else{
           $grades[]  = "?";
        }
        $details[] = get_string("maximumgrade").': 1';
        $maxgrades[]=1;
      } //end if lettergrade
    }  //end if numericgrade

bug#4
in calculated_col_grades.php file
lines :
<script>
function closeme(){
   opener.location.reload(true);
    self.close();
}
</script>
at the beginning of the file are included in xls and txt export wich prevent the excel export to work.
solution
suppress these lines and add
       echo "<script> function closeme(){ opener.location.reload(true); self.close();} </script>";
somewhere in the php code to output the html page for instance after the line with the print_header call.

In reply to Jean-Michel Védrine

Re: Got it running, questions

by W Page -
Hi Jean Michael,

Can you post the changed file and the path to the file?

Thanks in advance.

WP1
In reply to W Page

Re: Got it running, questions

by Jean-Michel Védrine -

Hello,

the 2 files to patch are in mod/gradebook and are calculated_col_grade.php and calculated_col_grades.php

As I said I am in the process of replacing all hardcoded english strings with get_string calls because I need a french translation. Soi if I post my files you will have a lot of undefined strings displaying in double brackets. This is the reason why I gave the instructions to patch the files in my previous post rather than posting mine.

Hopefully this task will be finished tomorrow and I can post both my files and the lang file.

In reply to Jean-Michel Védrine

Re: Got it running, questions

by W Page -

Thanks Jean-Michael,

I will just wait then.

WP1

In reply to Michael Penney

Re: Got it running, questions

by W Page -
Hi Michael,

Did you get that persistent red "Error" message in the upper left corner of the Admin page after installing Gustav's addended "/moodle/lib/db/mysql.php" file?

If not, would you please attach a copy of the "mysql.php" file you used.  I must be doing something wrong.

WP1
In reply to Jason Cole

UI Issues

by Michael Penney -

Hi Jason, I have another question about the gradbook.

The slider bar seems a bit hard to figure out. Its a great function, but it doesn't scream "this is how you use me" very loudly.

Why not use css for the slider bar? If the grades table was in it's own div, and you set a size with overflow, then you'd get a nice scollbar. We used this in our lesson rewrite and it works pretty well on different browsers. It looks like an iframe, but all the content is on the same page.

It also seems to me that 'enlarge' should show the whole gradebook, without a slider at all. You could pop that window up with fixed size and let the browser handle the scrolling. Since folks already know how to use browser style scroll bars, it might be easier for faculty to figure out how to use the gradebook with these changes.

In reply to Michael Penney

Re: UI Issues

by Jason Cole -
We originaly had a CSS version, but it wasn't cross-browser. This was the only way we could get it to work in Netscape, Moz, and IE.

I agree with the enlarge function. We'll post a fix soon.


In reply to Jason Cole

Re: UI Issues

by Michael Penney -
Good to hear, Jason.

I'm having one of my folks do a re-write on the standard gradebook to add weighting, catagorization, and stats, so we'll have a backup in case your's isn't ready by Dec (when we'll start our build of Spring Semster's Moodle).

We've already gotten catagory weighting going & adding moodle graded mods to catagories (this works on the numbers the mods send to  standard gradebook so no mod re-writing needed). That, and course total in teacher view, and being able to see what the 45th graded item stands for on your 140th student were the main issues our faculty had.

I think the css will work here, we've used a fixed size div with overflow =scroll on another project and found it stable on just about all 5+ IEs (mac and pc) and 7+ Netscapes (mac and pc) which is as cross-browser as we needsmile. We'll just use this for vertical scrolling for student names, and probably reprint the names list every 20 items for gradebooks with many items at some point (maybe not in the first version).

Anyway, we'll see and let you know. It sure would be nice to get standard GUI elements for moving around in there.

PS, I know you are busy, but this thread was the first I heard that there was a need to replace the standard molular grading method with a centralized grades table. The centralized table seems problematic with the flexibiliy built into many modules (to allow repeated attempts and use max or mean for the grade, for instance)-seems like the central table needs to be constantly querying the modules to see if grades have changed.

So I was wondering what the rationale for changing to a centralized table was?

Thanks!
In reply to Michael Penney

Re: UI Issues

by Jason Cole -
Hey Michael

I just posted our reasoning for a centralized table this morning

http://moodle.org/mod/forum/discuss.php?d=12760

I'd love to see your CSS code. Part of the reason we switched from CSS was I wanted column and row locking so the assignments and student names were always visible. I was really pushing for this and this was the only solution the grad student could come up with.

If we decide that CSS is more important than column locking, I'll be happy to revert.

J


In reply to Michael Penney

Re: UI Issues

by Gustav W Delius -
It would be a waste of effort if everyone was starting to work on their own version of the gradebook. If we could get the existing gradebook code into central CVS then we could all work on improving the same code.
In reply to Gustav W Delius

Re: UI Issues

by Michael Penney -
Hi Gustav, unfortunatly, we can't seem to start working with the G2 code the way it is now. We tried, but we are pretty much used to and dependent on working with heavily commented code that uses the moodle api. If the original programming team or more experienced programmers than we have on our team could comment the code a bit more and  maybe moodlize it, we could start helping out. 
 
Meanwhile, we need catagorization and weighting in moodle by dec. and so we have begun the work with the original gradebook to make sure we can provide it. After spending about a week trying to figure out how to add moodle activities to a weighted catagory in G2, we gave up. In the next week one of our programmers got pretty far to getting these features in the standard gradebook.
 
So we're going to go with that for now. If the G2 code gets to the point where we can begin to make useful contributions with a reasonable amount of effort, we'll be happy to help. Meanwhile, our code runs math on the standard grades array, it shouldn't be too hard to point our ui and math code at a central grades table once that is easy enough for us to dosmile.

As far as the server load, we have a few extra dual 2.8ghz blades and an good admin itching to set up a cluster, so that is less of a worry for me than faculty who want their weighting and catagorization the day before yesterdaysmile.



In reply to Jason Cole

Re: Gradebook rewrite

by Deon Metelski -

Well I just have to say, Thanks to everyone who took on this addon and worked so diligently. I have tried the modified files and they work. There are just a few more bugs to work out. I seem to not be able to get final grade to show up when I sign on as a student. The other thing is letter grades do not calculate and show up when using calculated columns. Overall a great addon big grin

I am trying one other thing to incorporate the bulk upload of grades from an excel spreadsheet. Girishan originally did this and sent me the files which I use now. I know the new gradebook allows you to change the grade right on the webpage but some teachers work on the gradebook offline. This is a consideration. If you want to see what girshan did for his faculty, his webpage for the gradebook is at https://maysportal.tamu.edu/docs/Downloadgrade/download-upload-final-grades.html

The upload feature is the only thing I think needs to be added. Any thoughts?

Keep Moodling!!

Deon

In reply to Jason Cole

CVS help please

by Tim Scott -
Hi

Just wondering if someone can give me a clue on how to download the latest copy of gradebook2 from the cvs.

I know that:

cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/moodle login

<>then

cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/moodle co -r MOODLE_14_STABLE moodle
>

get me the latest stable copy of moodle from the cvs but what command to I issue to get the gradebook2 files?

TIA

Regards

Tim
In reply to Tim Scott

Re: CVS help please

by Jacob Romeyn -

Use:


cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/moodle login
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/moodle co contrib

This will give you all the files on the contrib folder. gradebook2 is in that folder.

In reply to Jacob Romeyn

Re: CVS help please

by Marc Dastous -

It is very unfortunate that CVS is not working properly, I would love to try this new gradebooksad

I have tried to login since the problems that occurred earlier last week and I get

cvs [login aborted]: unrecognized auth response from cvs.sourceforge.net: M PserverBackend::PserverBackend() Connect (Connection refused)

I can see the CVS using Sourceforge however.  Is there a way in CVS that a .zip or .tgr file could be included so that it could be easily downloaded from Sourceforge?  I know that this is an extra step, but it sure would make things a lot easier wink and save Martin server space so that the files would not have to be uploaded to Moodle.org.

Just a suggestion.

Marc

In reply to Jason Cole

Re: Gradebook rewrite

by Jason Cole -
OK... Thanks for the feedback Micheal and Jean... I guess I didn't make it clear enough that this is definitely a work in progress. I'm really amazed that people are using it in production already...guess we hit an unmet need!

I met with Maria yesterday. She had already taken the feedback about the code and revisited all of her files. As a result, she has completely reorganized them for code first, presentation second. She's also gone through and used Moodle methods when possible and greatly improved the comments.

Our next step is the interface. She and I did a complete interface review using Micheal's demo as a guideline as well as existing Moodle interfaces. We should have a completely new interface within a week.

Regarding CSS versions of the row and column locking. We've been looking into this since the beginnning of the project. We thought we had a solution but it only worked in IE, not Mozilla. Since I'm a Firefox addict it wasn't working. The activewidget grid widget won't allow us to lock the student names without a major rewrite.

We'll keep looking though..

Oh.. and sourceforge cvs seems to be down right now, so I've attached the new PHP files. Would someone else try an update?

J
In reply to Jason Cole

Re: Gradebook rewrite

by Michael Penney -
Hi Jason, glad you were able to use the interface work. Our version will be done in a few weeks, so it might be ideal to adopt a 2 stage approach to getting this ready, it seems to me that since GB2 involves changes to the grading methods of the modules, the central grades table version may need to be extensively tested before sending it out for production.

Another issue that is pretty critical to our users is a default standard mode, as several of our users like the current gradebook and don't want any major changes in it. I would guess that there may be some others in this situation.

Our method of handling this is having the standard gradebook view as the default (with some nice things like course total points and the option to reprint table headers) with all gradesd efaulting to an 'uncatagorized' catagory wieghted 100%. Thus users who want more features in a gradebook (and feel they have time to learn new things) can use the new features while folks who are comfortable with the current system can keep on truckin'.

Finally, have you thought of doing the single grade views simply as new screens  (like we have done for single user view and drill down from catagory)? This is lo tech, but its also quite fast and cross-browser. It would be nice to avoid having alot of client side javascript IMO (we still have many faculty using MacOS9 and Internet Explorer 5, which handles most complex js in an unusual manner, often involving bombs;).
In reply to Jason Cole

To get this running

by Michael Penney -
I first install the code from CVS (the latest I have there is 8/30), then these files?

Is the 8/30 CVS code all updated with Jean-Pierre's fixes or do I have to load that code in first?

Oops when I do that (install 8/30 CVS then this code) into Moodle 1.4.1 I get:


Fatal error: Cannot redeclare print_side_block() (previously declared in /home/cdc/public_html/moodletest/gradebook2/lib/weblib.php:2464) in /home/cdc/public_html/moodletest/gradebook2/course/lib.php on line 1923

is there a different course/lib.php somewhere?

I backup to the standard course/lib file.



 
In reply to Jason Cole

Immediate issues

by Michael Penney -
Items from backup course don't show up in gradebook2. I though they might need to be updated to send their grade info. to the gb2 database, but attempting to update them gives this error:

Could not update the assignment

Newly created items show up in gradebook2 but:

Assignment: grades created in assignment don't show up in gradebook.

Also, once created the assignment could not be edited.

Quiz:
  • Once created, can't be updated.
  • Deleting a quiz from the site doesn't delete the quiz from the gradebook.
  • Entering a quiz gives this error:
  • Fatal error: Call to undefined function: quiz_get_attempt_questions() in /home/cdc/public_html/moodletest/gradebook2/mod/quiz/attempt.php on line 266
I guess code needs to be written to get the grades from the module's grades tables to send grades to the central grades table?

And some way has to be set up for modules to update the central grades table when they are updated?

Other questions: if an instructor enters a grade for a student in a quiz where the final grade is based on the max or average of multiple attempts, in the central table, and then the student retakes that quiz, how does the new grade get handled? Does the instructor's grade take precedence?

2nd, if an instructor grades an assignment in the gradebook, then forgets they did that and re-grades it in the assignment module, which grade is used? Does the latest added grade take precedence or is precendence always given to the grade entered manually in the gradebook?

Things like quiz and lesson analysis also it seems would require some sort of automated back and forth communication between the central table and the activity grades table, would this happen when a student submits an activity or when an instructor edits the gradebook?






In reply to Michael Penney

Re: Immediate issues

by Jason Cole -
Hi Mike,

Each of the files in the mod folder should replace the corresponding file in the mod. So the assignments mod should have the lib and submissions file replaced by the ones in the assignment folder in the mods folder from the CVS

The files I uploaded today replace a number of the existing files. Which is why  I really wanted to update via CVS... but I couldn't connect. Let me try to update the darn thing the right way...


In reply to Jason Cole

Re: Immediate issues

by Michael Penney -
I see that gradebook2 is updated in contrib, however the course/lib file is dated 8/26, as are the quiz/lib and assignment/lib & submissions files. So I take there is no fix yet for the issues I ran into previously.

Did you have a chance to look at my other questions? Basically we're trying to figure out what part of the way its working is a feature and which is a bug? Eg do you intend to have grades entered for the moodle modules in the gradebook only, or should the modules be able to send their grades to the gradbook?

Some kind of roadmap/requirements doc./planned feature set would be helpful before we start working on this, we don't want to 'fix' things that you see as features.

Thanks!