WeBWorK Main Forum

Problems not rendering due to warning message

Problems not rendering due to warning message

by Andrew Mathas -
Number of replies: 2
When I load up a webwork quiz I am getting the warning message below. Unfortunately, webwork does not seem to be telling where to find this error. The quiz is built from various topic sets and when I render each of these sets directly each one of them displays correctly. I suspect that I am probably being "unlucky" in the the random seed breaks the quiz when I test it but not when I look at the topic question.

I am sure that the problem is due to an error that I introduced when I was modifying the topic questions. Does anyone have any hints as to how I can find out where the problem occurs?

Cheers,
Andfrew

----
Here's the warning message that gets displayed.

WeBWorK Warnings

WeBWorK has encountered warnings while processing your request. If this occured when viewing a problem, it was likely caused by an error or ambiguity in that problem. Otherwise, it may indicate a problem with the WeBWorK system itself. If you are a student, report these warnings to your professor to have them corrected. If you are a professor, please consult the warning output below for more information.

Warning messages

  • Argument "" isn't numeric in numeric gt (>) at /users/amstaff/v0ww/webwork/webwork2/lib/WeBWorK/ContentGenerator/GatewayQuiz.pm line 816.
In reply to Andrew Mathas

Re: Problems not rendering due to warning message

by Alex Jordan -
It could be slightly different with the version you are on, but in the current version at line 821 of GatewayQuiz.pm, there is this comparison that the warning may refer to:

$_->version_creation_time() > ($timeNow - $timeInterval)

If say the left side isn't defined for some reason, that could give the warning. Is there any reason why something about a version creation time would not be defined in the scenario where this happens?

This is all part of a conditional expression. I guess it evaluates to false if the left side is not defined, but still gives the warning. The conditional in question will iterate $currentNumVersions if it evaluates to true, so I guess that is not being incremented as a consequence of this. In the scenario where you see this, does it make sense that something with a name like $currentNumVersions would not be incremented?

If you see no real bad consequence of this other than the warning appearing, it may just be that this conditional needs more scrutiny and protection against whatever is not defined in this scenario.

In reply to Alex Jordan

Re: Problems not rendering due to warning message

by Andrew Mathas -
Thanks very much for the suggestions. In the end I tracked down the problem by successively deleting problems until I found the culprit.It then turned out that webwork was unable to find rank.pl, which is part of the open problem library -- and which was found when I previewed this question. Not sure what caused this error but as a work-around I found the code for rank.pl in the github repository and copied it into the question. Now both webwork and I are happy.