importing grades from external data

importing grades from external data

by Jim Proctor -
Number of replies: 13
I would love to see a feature in Moodle whereby one can import grades to an already-defined Moodle assignment, forum (with ratings enabled), etc...anything that shows up in the gradebook. The reason for this is that I and my TA's often grade assignments offline in a spreadsheet (it's quicker than doing a drop-down menu selection, and forms a separate record). Is this feature under development or consideration?

Thanks --

Jim P.
In reply to Jim Proctor

Re: importing grades from external data

by Josh Jones -

I would also love this feature to.  My TA's "have" to use a more functional gradebook that does reports and many other gradebook features, but if I was able to import grades, I could have them doing grades once, instead of double duty!!!

Ideally it would be nice to have a seriously functional gradebook here.  spreadsheet views, simple report generations for individuals and course students, etc.

Jones

In reply to Josh Jones

Gradebook features

by Michael Penney -
Hi Josh, we're working on one. You can see a feature demo here:
http://moodle.org/mod/forum/discuss.php?d=13327&mode=-1

It would be great if you have time to check that out and give us some feedback.

Importing grades has some of the same sort of issues that the central grades table has:
  • since Moodle is built on the concept that modules handle grades, that modules may change grades and grades may be based on calculations of the modules (average scored quizzes, lessons, etc.) importing grades or setting grades manually raises the question of priority: if a grade is set manually in an external file or central table is the the module then locked out of changing it?
  • and if so, how (technically) to accomplish this when the modules are designed to control their own grades?
  • some graded items give feedback: eg assignment, essay questions in lesson, the student is told here is your points and feedback, then later the points change via a manual action of the teacher or ta, how is the feedback handled to let the student know why their first grade was later changed?
One of the ideas we are working on to handle this is a 'bonus points' column, where the grade is assigned and managed via the module, but the teacher can add extra points to an activity via the gradebook. The student can thus see their original points and any bonus points that were added or subtracted.
In reply to Michael Penney

Re: Gradebook features

by Solomon Gifford -
Have you ever considered adding a sort of "history" to the grades?  In other words, grades could have changed multiple times before settling on a final grade.  The gradebook could show and use the latest grade, but when you click on the grade you see a revision history, along with who made the changes.

I know this would be benefitial in large classes when students come to the prof for points after going to the TA, sometimes trying to get points back twice.  If the Prof changed the grade w/ a note, then if the TA went in s/he'd see that the student had already gotten the points back.  This also helps when trying to remember if you had updated a score or not.     
In reply to Jim Proctor

Re: importing grades from external data

by Stephen Edwards -
I'm very interested in being able to import/upload grades too. WRT the new gradebook work going on, I read Deon Metelski's comments (see the original message in another thread)about some uploading code that Girishan Shanmugam had posted, but I haven't been able to locate the source so I can try it out.

I'm very excited about the gradebook redesign stuff going on, but in the near term, I really need upload capabilities as soon as possible. Can anyone point me to a recent, working version of such upload code? Girishan, would you be willing to share again? Thanks!

(and hi, Solomon!)
In reply to Stephen Edwards

Re: importing grades from external data

by Zbigniew Fiedorowicz -
I've attached our quick and dirty modification to allow import of grades from a comma delimited file. We've been using it here at Ohio State University for over a year to import hundreds of grades. This version works with Moodle v. 1.4 (and probably with any version other than the gradebook2 version (which may or may not work)). You should put the import_grades.php attached here into the course subfolder of your moodle installation.

The import file format looks like this:

username,###
smith,27
jones,43
ames,78

Here ### in the first line should be replaced by the assignment number into which you are uploading the grades. If you click on the assignment link the url will look like: http://yourmoodlesite/mod/assignment/view.php?id=###

You also need to make a few modifications to your course/grades.php
file (make a backup first). Add the line:

require_once("./import_grades.php");

right before the line:

$strgrades = get_string("grades");

Also right after the line:

print_single_button("grades.php", $options, get_string("downloadtext"));

add the following lines:

echo "</td></tr><tr><td colspan=\"2\">\n".
"<form method=\"post\" enctype=\"multipart/form-data\" action=\"grades.php\">\n".
"<input type=\"submit\" value=\"Import Grades\">".
"<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"get_max_upload_file_size()\">\n".
"<input type=\"hidden\" name=\"id\" value=\"$course->id\">".
"<input type=\"file\" name=\"gradefile\" size=30>\n".
"</form></td></tr>";

The next line (in the original grades.php) after these newly added lines should be:

echo "</TABLE>";

Make sure that you use a plain text editor to edit grades.php, NOT a word processor.
In reply to Zbigniew Fiedorowicz

Re: importing grades from external data

by Stephen Edwards -
Thanks for the contribution! I'll try it out on my own installation while I am waiting (and drooling!) for the gradebook2 features to be fully ready. I'm an OSU alum, too, so I'm glad to hear Moodle is seeing some action there.
In reply to Zbigniew Fiedorowicz

Re: importing grades from external data

by Jim Hardy -
Well, I think I followed your instructions to the letter and it looks like your routine is exactly what I've been looking for. Only one small problem, I can't seem to get it to work.

I placed import_grades.php in the courses folder and modified grades.php as outlined above.

I bring up the grade book and the buttons for import and selection of a file are now present. I then determined the assignment number and created a file that looks like this:

username,201
bob,30
lawanda,40
waldo, 50

I can select the file but when I try to import the file, I'm told that the module is incorrect.

Any suggestions?
In reply to Jim Hardy

Re: importing grades from external data

by Zbigniew Fiedorowicz -
That indicates that the 201 in the first line:

username,201

is not the correct number.  How did you get 201?

If you got this directly from the mysql database, you should be looking for the course_module id, not the assignment id.
In reply to Zbigniew Fiedorowicz

Re: importing grades from external data

by Jim Hardy -
I selected the gradebook entry (outside entry) which listed:
http://server/mod/outside/view.php?id=201

I figured I was doing something wrong.

I'll give it another try tomorrow using the the id from the mysql database. I guess that means I need to finally get around to learning how to use phpMyAdmin to find the outside event and the ID number.

Thanks.
In reply to Jim Hardy

Re: importing grades from external data

by Zbigniew Fiedorowicz -
It seems that you are using gradebook2?  Moodle v. 1.4.1 doesn't have a mod/outside  The import grades script imports into mod/assignment only.
In reply to Zbigniew Fiedorowicz

Re: importing grades from external data

by Jim Hardy -
I'm using the standard 1.4.1 gradebook. With all of the versions floating around, I figured it was best to stick with the original.

"Outside events" is a separate resource module and will show up in the gradebook. Still, if the only module one can import to is an assignment, I'll modify my classroom exam scores to fit the assignment module. Given the fact that the "Outside events" module does not sort alphabetically for score entry, I'll likey be happier after making the change.

I'll let you know how it turns out and thanks for the help. I guess that what people say at the U of Akron about OSU faculty is not true afterall.
In reply to Jim Proctor

Re: importing grades from external data

by W Page -

Hello All!

Suggest you all make your suggestions on the thread referenced below.  GradeBook2 is being worked on aggressively right now.  The issue of grade importation (from what I recall) has been discussed in different places in the different forums at Moodle.org, so it is something many are interested in.  Myself, included.

Gradebook 2 into Moodle 1.5
http://moodle.org/mod/forum/discuss.php?d=12760

I think that including your thoughts on this matter would be good because it is an important tool for a gradebook.

WP1