I’m going to be posting a “midterm reflection” about the Alternate Worlds class soon. But before that, I wanted to put up a post that (maybe) will be easy to find for people trying to use the KB Gradebook plugin that I mentioned in the earlier posts.
This was looking like a very good way to let students see their grades throughout the course–an important feature to students in an online class (and others, too, probably). I was very happy to have found it, especially because it allowed for actual written comments, not just letter grades or numerical scores, but shortly after my (successful) testing, it started to fail to work.
The first problem was that I would get a message saying
“Sorry, but your CSV file has too few columns.”
When I knew that it had plenty of columns. A bit of googling tracked down the answer to that problem–something about the way Excel on a Mac saves CSV files with some problematic end-of-line encoding. There’s probably a way around that in the setttings of Excel, but I took the (somewhat clumsy) workaround instead. I just made the file on my Mac in Numbers (instead of Excel) and exported to CSV from there. That was fine.
But then the second problem was more serious, and seemed insurmountable for a while. Uploading new grades gave an error message of either
“There is no grade information available for this course. Since there was as of the last step, it’s possible that another user is also working on your grades right now.”
or
“Unable to write CSV data to database. Please try again in a couple minutes.”
All my googling turned up several people who had encountered the same problem, but nobody with any solutions, and even the person who originally steered me to the plugin, Kyle Jones, said that he had no solution and had ended up having to abandon the plugin–wishing that someone would have the skill or time to troubleshoot it. (the original developer had decided to let it go–no more time to work on it and wasn’t interested in using it anymore).
I thought about hiring a programmer to troubleshoot for me–it was certainly beyond my skill to fix, but it seemed like a plugin that could be really beneficial to anyone using WordPress for courses.
So I kept plugging away at it, trying to figure out where those errors were coming from, trying to see if I could find a fix or even a workaround.
In thinking about hiring someone, I needed to see if I could reliably reproduce the problem and describe the symptoms. And I couldn’t. On my MAMP test bed, it seemed to work fine, no matter how I pushed it. But no matter what I tried, I couldn’t get it to work on my production server.
Then finally I decided to go to a low-level examination. I looked very carefully at the database itself (Sequel Pro is an utterly fantastic tool, by the way). And there I noticed that the tables did not include all the information that should have been uploaded in the CSV files. There was an abrupt truncation, and when I looked closely, I saw that it was where I had left a student a comment, not just a letter grade, and part of that comment was the phrase “you really haven’t…”
The whole table stopped at “you really haven..” It was the apostrophe! Once I made sure there were no apostrophes, everything worked just fine.
So for anyone who is trying to use this plugin, if you want to leave students comments, do not use any apostrophes in those comments. Quotation marks and slashes might cause problems too, I suspect, but I haven’t tested that.
Boone tells me on twitter that there might be a way to fix it for real with mysql_real_escape_string (on the way in) and stripslashes (on the way out). I will have to learn to do that–maybe with Boone’s help–and maybe find out how to get the plugin updated in the repository, if the original developer will allow it.
But for now–anyone using KB Gradebook who might come upon this post–if you have those error messages, check carefully for apostrophes or other odd characters in your CSV file! That just might do it!
Categories:
