WeBWorK Main Forum

Errors and misbehavior associated with achievements; greetings

Errors and misbehavior associated with achievements; greetings

by Dave Rosoff -
Number of replies: 8
Hello all,

I'll just begin by introducing myself--I'm Dave Rosoff and I teach in the Math department at the College of Idaho (with Robin Cruz, whom I think many of you know). I'm looking forward to being able to contribute more than bug reports in the future!

The "Mathchievements" feature has been a big hit in the courses where we've enabled it this semester (thanks to those involved for a great idea), but after the first few days I noticed a problem. When I extend the due date for a single student on a single set, everything looks fine from the administrator view, but the student will see red screens and warning messages when loading a problem. A typical error message reads

* Argument "" isn't numeric in numeric gt (>) at (eval 7174) line 1729.

This error is identical across courses, sets, and students, except that the number following 'eval' varies. But 1729 is (an easily memorable) constant.

The student can submit answers normally and they seem to be evaluated and checked correctly. However, I noticed the hard way that if a student had done previous work on any problems in the set, their progress was zeroed out. Past answers remain visible in the instructor view. After closer inspection I realized that the set had actually been reassigned to the student (or something similar had happened). All their seeds were different, so that even had they had the presence of mind to record their previous work on paper, they still had to solve the problems a second time.

The reason I suspect the achievements is that this behavior appears in all and only courses in which they have been enabled. I got some confirmation when by happenstance I extended a due date for a student who was working on the extended set at the same time. His progress was zeroed out and his seeds reset, and when loading the set he received this error message:

*   Argument "" isn't numeric in numeric gt (>) at (eval 3198) line 1729. 
*   Argument "" isn't numeric in numeric ne (!=) at /opt/webwork/webwork2/lib/WeBWorK/AchievementEvaluator.pm line 114. 

The second line was repeated once for each problem in the set. Having examined the AchievementEvaluator script at line 114, I think that $thisProblem->status is getting reinitialized to "" instead of a numeric value, but I'm not sure how to fix it without borking everything (or even all that confident that this is what's wrong). I would very much appreciate any advice you all can give! and I apologize if this post is long on details.

Thanks very much in advance,
In reply to Dave Rosoff

Re: Errors and misbehavior associated with achievements; greetings

by Geoff Goehle -
Hey Dave, 

So it turns out the problem was that for some reason when the homework due date was being change the status field for some (or all) of the problems in the homework was getting erased.  

I put in some changes where if you erase the status field it will default to zero and I also put a check in PGanswermacros.pl that should automatically fix an empty status field after a student hits submit.

These went up to the git repo last friday.  I don't know when they will come down to your machine.  

In reply to Geoff Goehle

Re: Errors and misbehavior associated with achievements; greetings

by Michael Gage -
These modifications were in ww2.5.1.1 but not yet placed  into ww2.5.2.

I have now pulled Geoff's changes into ww2.5.2 in openwebwork/webwork2-dev

Let us know if this solves the problem.
In reply to Michael Gage

Re: Errors and misbehavior associated with achievements; greetings

by Dave Rosoff -
I think we are going to wait for our midsemester recess to do another update. I'll be sure to follow up in this thread when that happens.

Thanks for your timely replies.

In reply to Dave Rosoff

Re: Errors and misbehavior associated with achievements; greetings

by Michael Gage -
Here's a further update.  I finally got a chance to look through the code last night and found about 5 lines that were inadvertently deleted in one of the upgrades to ww2.5.2 over the last two weeks.  

The lines pretty clearly involve grabbing all of the problems in a homework set for an individual.  Replacing those lines fixed the problem I was seeing about 
problems not being defined.  These lines only ran when one was updating an individual record as opposed to updating the entire class so I'm fairly confident
that this will fix the behavior you were seeing. 

I've pushed the changes to mgage/webwork2-dev ww2.5.2 and to openwebwork/webwork2-dev ww2.5.2.  As best I can tell the original
updates never affected the stable ww2.5.1.1 version.

The only file changed in this fix was ProblemSetDetail.pm  so you can just update that file if you wish.

In the version I pushed to the repo's last night there are also minor revisions to some of the .conf.dist files -- mostly changes in comments that will hopefully make configuration more straightforward.  ww2.5.2 is undergoing constant minor tweaks as we ready it to be the next stable version, one that includes the essayAnswer questions among other features. The version on hosted2.webwork.rochester.edu has the latest updates.

-- Mike

In reply to Michael Gage

Re: Errors and misbehavior associated with achievements; greetings

by Robin Cruz -


This is Robin--Dave is having problems submitting to the forum. When he types into the text box, it deletes his stuff when he presses the submit button????

So, I'm sending on what is happening. Dave is experiencing another problem. He's the only one here using the Achievements so we're thinking the problems are linked. (Our server went down unexpectedly the night before so that should be considered as well.) A problem set that was working this morning--students were happily submitting answers-- now have problems which are producting the following error. Also, the points in the "Worth" column for the broken problems do not show up. If I do a force reload on the page, the points show up for an instant and then disappear. I updated the file you suggested(ProblemSetDetail.pm, I think, is the file you meant.) and this problem persists.

Anyway, here is the error message from a broken problem.



WeBWorK error

Anerror occured while processing your request. For help, please send mail to thissite's webmaster ( webmaster@localhost ),including all of the following information as well as what what you were doingwhen the error occured.

ThuOct 04 16:01:52 2012

Warning messages

· Use of uninitialized value $result[0] in print at/opt/webwork/webwork2/lib/WeBWorK/Template.pm line 154.<br />Use ofuninitialized value $result[0] in print at/opt/webwork/webwork2/lib/WeBWorK/Template.pm line 154.<br />

Error messages

Can't use anundefined value as a HASH reference at/opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 1134.

Call stack

Theinformation below can help locate the source of the problem.

· in WeBWorK::ContentGenerator::Problem::output_checkboxes called atline 152 of /opt/webwork/webwork2/lib/WeBWorK/Template.pm

· in WeBWorK::Template::template called at line 496 of/opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm

· in WeBWorK::ContentGenerator::content called at line 200 of/opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm

· in WeBWorK::ContentGenerator::go called at line 371 of/opt/webwork/webwork2/lib/WeBWorK.pm

Request information





HTTP Headers


Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)


text/html, application/xhtml+xml, */*






gzip, deflate




WeBWorKCourseAuthen.MAT123_01_F12=rcruz%09i2EHN5ZWPf5pZCPGIaJTEVO8vb5EFeZx%091349383356; WeBWorKCourseAuthen.MAT151_02_F12=rcruz%0958YEbyVe7eU9bEkhn0CvkaZBDRst2u1K%091349385515; WeBWorKCourseAuthen.MAT152_01_F12=rcruz%0961PBII2pXMtnefbJTpnAbQEIzRtvg3W6%091349388093; WeBWorKCourseAuthen.MAT251_01_F12=rcruz%09T5sTcfwI9MgFlVK16d4mm3YkBYjbPo1I%091349388109; __utmc=33027372; __utma=33027372.1807117324.1315868043.1349381280.1349384845.419; __utmz=33027372.1315868043.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __unam=6bbc56c-134200a8c3e-4849860d-600



In reply to Robin Cruz

Re: Errors and misbehavior associated with achievements; greetings

by Michael Gage -
the error line is from the routine that outputs the checkboxes for show correct answers, show hints, etc.  I don't think it has anything to do with your earlier problems.  The new ProblemSetDetail.pm should fix the issue with updating an individual student's record.

Some of this sounds like a browser issue which will be really hard for me to diagnose long distance.  Turning the browser off (or perhaps even restarting the computer) might help with debugging just to make sure you are dealing with a clean slate.  Which platform and browser are you using?   

It's also possible that the Problem.pm file was corrupted some how?   

The description of values showing up and then disappearing sounds like some kind of browser rendering problem. It could be an interaction with CSS particularly if it's an old IE browser but there is very little CSS on the student pages.

In reply to Michael Gage

Re: Errors and misbehavior associated with achievements; greetings

by Robin Cruz -
Yes, with the new ProblemSetDetail.pm editing individual's problem sets seem to be working now--Thanks a bunch!

We've tried different browsers: IE, Foxfire and Chrome on Windows and Linux machines. A corrupt file is a possibility since the server went down unintentionally the day before. I tried a "git pull' in the folder were Problem.pm resides, but it said the content was up to date. Would github know if a file was corrupt?

I've looked through the problem sets in a couple of courses and Dave's section is the only one I can find the error occurring.

If it would help, Dave could make a login for you to his course.

In reply to Robin Cruz

Re: Errors and misbehavior associated with achievements; greetings

by Michael Gage -
I'm pretty puzzled if it is just for this course. I guess creating a login for me is a good place to start.

Git would probably not know if a file was corrupt. You can delete it or rename it and then do a git pull. It will
know if a file is missing.

- Mike