Moodle

"Supplied grade is invalid" error message when importing grades as percentages in .csv files.

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 1.9.2, 1.9.3
  • Fix Version/s: None
  • Component/s: Gradebook
  • Labels:
    None
  • Environment:
    Moodle 1.9.3+ (also reproduced in 1.9.2+). Windows Server 2003 SP2, MS SQL 2005, FreeTDS, PHP 5.2.6 (Non Thread Safe), FastCGI, IIS 6
  • Database:
    Microsoft SQL
  • URL:
    Site not available outside my company network.
  • Affected Branches:
    MOODLE_19_STABLE

Description

I tried to import quiz grades into Moodle via a .csv file when the grades are setup as percentages in the .csv file but I got a "Supplied grade is invalid" error.

First I created a test course and quiz with the maximum grade set to 50. Then I was successfully able to import grades into the Gradebook for that course AS NUMBERS using the following .csv format:

username,Quiz: QZ-TST
student1,41.7
student2,22.2
student3,34.1

In the above file student1 achieved 41.7 marks for the quiz (out of a possible 50 marks), etc.
Moodle imported the grades nicely and they displayed in the Gradebook.

But when I converted the results to percentages like this:

username,Quiz: QZ-TST
student1,83.4 %
student2,44.4 %
student3,68.2 %

and imported the .csv file, Moodle complained that the "Supplied grade is invalid" and I got the following error in the top left corner just below the 'Choose an action' list (my debugging level is set to quite high):

t0 is 6
grade is 83.4 %

What does "t0 is 6" mean? And why is the "Supplied grade invalid"?

If Moodle does not support grade import as percentages then this error message should be more specific, e.g. "Grade import as percentages is not supported".

Is it possible to import grades into the Gradebook as percentages? I haven't seen anything in Moodle Docs that says you CAN'T. The instructions for importing and exporting grades on http://docs.moodle.org/en/Grade_import and http://docs.moodle.org/en/Grade_export are quite vague and don't specifically explain why the "Supplied grade is invalid" or even that you can or can't import grades as percentages. See http://docs.moodle.org/en/Talk:Grade_import for more details about the documentation issue.

I get the "Supplied grade is invalid" error in both Moodle 1.9.2+ and 1.9.3+ (on IIS 6, PHP 5.2.6 and MSSQL 2005 with FreeTDS).

Activity

Hide
Michael de Raadt added a comment -

Thanks for reporting this issue.

We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

Michael d;

lqjjLKA0p6

Show
Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; lqjjLKA0p6
Hide
Luis de Vasconcelos added a comment -

I "re-tested" this in Moodle 2.0.3+ (Build: 20110609). My test quiz has 25 questions with each question having a maximum grade of 1. So the max grade for the quiz is 25.

I imported a grade into the course using this .csv file:

username,CRS_TST_QUIZ_GRADES
abc0101,85
xyz0202,44
azc1243,15

After I imported the .csv file the gradebook shows the grade as "25 (100 %)" for users abc0101 and xyz0202. The grade for user azc1243 is 15. So Moodle reduced all the grades that were greater than 25 down to 25 - 25 being the maximum grade allowed in the quiz settings. I think this is acceptable. Perhaps Moodle should display a message indicating that those first two grades in the .csv file are invalid and that they will converted to the maximum grade when the import is done. This will alert trainers or admins that there was a problem with the data that was imported.

Or should Moodle block the grade import when a supplied grade is higher than the maximum allowed grade (max grade)?

I'm not sure if this behaviour is the same in Moodle 2.1 or 2.2 - I don't have a test box available for those versions at the moment.

Show
Luis de Vasconcelos added a comment - I "re-tested" this in Moodle 2.0.3+ (Build: 20110609). My test quiz has 25 questions with each question having a maximum grade of 1. So the max grade for the quiz is 25. I imported a grade into the course using this .csv file: username,CRS_TST_QUIZ_GRADES abc0101,85 xyz0202,44 azc1243,15 After I imported the .csv file the gradebook shows the grade as "25 (100 %)" for users abc0101 and xyz0202. The grade for user azc1243 is 15. So Moodle reduced all the grades that were greater than 25 down to 25 - 25 being the maximum grade allowed in the quiz settings. I think this is acceptable. Perhaps Moodle should display a message indicating that those first two grades in the .csv file are invalid and that they will converted to the maximum grade when the import is done. This will alert trainers or admins that there was a problem with the data that was imported. Or should Moodle block the grade import when a supplied grade is higher than the maximum allowed grade (max grade)? I'm not sure if this behaviour is the same in Moodle 2.1 or 2.2 - I don't have a test box available for those versions at the moment.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: