WeBWorK not rendering

200 views
Skip to first unread message

John Travis

unread,
Aug 15, 2016, 5:18:23 PM8/15/16
to MathBook XML Support
My WeBWorK problems are not rendering...all I get is an Exercise Stub and a "WeBWorK Exercise" statement. I did set up a course on my WeBWorK server using the instructions on


and copied some of the problems from the subsequent page into my xml document.  I compile using

xsltproc --stringparam webwork.server https://math.mc.edu/webwork2/ --xinclude ../../xsl/mathbook-html.xsl ProbabilityMain.xml


and everything works except for the WeBWorK problem. I get nothing in Chrome and in Safari I get 


"Course 'webwork2' not found: No such file or directory at /opt/webwork/webwork2/lib/WeBWorK.pm line 311."


I was unable to find an answer by searching this forum.  Any suggestions what simple fix I am missing? Thanks!



Alex Jordan

unread,
Aug 15, 2016, 5:30:33 PM8/15/16
to MathBook XML Support
Hi John,

Can you post the HTML output somewhere public? And also can you post here one complete chunk of mbx code for a problem. Everything starting from the opening `<exercise>` and ending with the closing `</exercise>`.I'll take a look.

John Travis

unread,
Aug 15, 2016, 6:33:20 PM8/15/16
to MathBook XML Support
The current state of things is located at


I'm still busy copying stuff over and am not approaching this linearly.  :)

Current state of xml files is located at


with my attempt at WeBWorK located at

Alex Jordan

unread,
Aug 15, 2016, 6:51:26 PM8/15/16
to MathBook XML Support
It looks like you haven't uploaded your knowls recently. The webwork ones at least are missing.

Alex Jordan

unread,
Aug 15, 2016, 7:10:00 PM8/15/16
to MathBook XML Support
Aside from that, probably the main issue is that you are using the old style of creating answer blanks that we scrapped sometime in spring. Instead of things like

<answer var="$answer1" width="15"/>

It should be

<var name="$answer1" width="15"/>

The presence of a width attribute makes it an answer blank. Or you can explicitly say "form='blank'".

I want to check if this old style has just been sitting in your project for a while, or if you found it living on the internet somewhere recently. I should act to cleanse out the old style if it is up somewhere public as an example.

John Travis

unread,
Aug 15, 2016, 9:40:29 PM8/15/16
to MathBook XML Support
The xml version of a webwork problem is copied from your github site which had the pcc calculus demo. The others are copied from the instructions at the link in my original post.

So, to be certain, can one no longer simply render a regular library problem or one stored in local without converting?

John Travis

unread,
Aug 15, 2016, 9:44:49 PM8/15/16
to MathBook XML Support
Here is the direct link to the documentation regarding inserting webwork problems...I copied from here.

http://mathbook.pugetsound.edu/doc/author-guide/html/section-61.html

Also, generally I've been browsing the html files locally and having the same reaction. Those knowles should be up to date.

Alex Jordan

unread,
Aug 15, 2016, 11:48:56 PM8/15/16
to MathBook XML Support

The main issue (I am guessing, until I probe deeper after resolving this one) is the way answer elements are coded. The link you gave here goes to examples that use the newer style, where answer blanks are coded with the "var" element. I think that this guide was written after the switch, so I *think* the old style never appeared in this guide. Have you recently been copying from any examples where the answer blanks is coded with an "answer" element? That is the kind of example I need to squash if it still exists on the interwebs. I saw such a problem at the github link you gave earlier for your project. You mentioned "the pcc calculus demo" but I'm not sure what that is. Any chance you still have a link?

If this ends up not being the only issue, then it will help me more to diagnose the problem if you can post the new knowls along with the new html files. I can look to see what is going wrong with how the .pg is being translated to base64. Also you should know that when viewing these webwork knowls from local html files, we have observed issues relating to some kind of conflict with localhost. Generally, if you are viewing locally and click to open a webwork knowl (or a sage knowl) and you see nothing happening, this may be *because* you are viewing locally instead of from http... wherever. This does not apply to what is happening to you, where you are clearly seeing an error message from the WeBWorK server itself. But still something to file away for future reference.


John Travis

unread,
Aug 16, 2016, 2:06:13 PM8/16/16
to MathBook XML Support
I copied the webwork exercise code (there are four attempts using various forms) from


and from the previously linked documentation.

I have also copied over my more current collection of knowls. Thanks for catching that but unfortunately that did not complete the deal. It will however be good to know that localhost might not be able to snag the live WW problem in general.

JT

Rob Beezer

unread,
Aug 16, 2016, 3:09:00 PM8/16/16
to mathbook-x...@googlegroups.com
Sorry, that repo is dead. Everything there got incorporated into mainline
MathBook XML.

Yes, I need to update the README so folks don't go crawling around in there.

This is the place to go exploring:

https://github.com/rbeezer/mathbook/tree/dev/examples/webwork

On 08/16/2016 11:06 AM, John Travis wrote:
> https://github.com/rbeezer/ww-mbx/blob/master/examples/webwork-templates/webwork-templates.xml

Alex Jordan

unread,
Aug 16, 2016, 4:45:08 PM8/16/16
to MathBook XML Support, bee...@ups.edu
Hi John,

  1. It looks like you dumped your knowls in the wrong place. There are a lot of files in:
    http://math.mc.edu/travis/mathbook/Probability/knowl/knowl/
    that should be in
    http://math.mc.edu/travis/mathbook/Probability/knowl/
  2. At https://github.com/drjt/Probability/blob/master/ProbabiltyGeneralities.xml, line 113, you have
    <p><answer var="$answer1" width="15"/></p>
    This needs to be changed to
    <p><var name="$answer1" width="15"/></p>
    There is a similar issue at line 121. But I understand this is only the sample question and you have this issue addressed in your other problems.
  3. Your webwork knowls are pointing to
    https://math.mc.edu/webwork2//webwork2/html2xml
    It should be just
    https://math.mc.edu/webwork2/html2xml
    When you run xsltproc, the stringparam you need to pass is:
    --stringparam webwork.server https://math.mc.edu
    And I suspect that you are including an unwanted additional '/webwork2/' at the end of this string.

Work your way through these three things and see if they do the trick.

If not, update the online versions so I can see the newer stuff and continue to troubleshoot.

The good news is I back-translated your base64 into .pg and it looks valid.

John Travis

unread,
Aug 16, 2016, 5:22:26 PM8/16/16
to MathBook XML Support, bee...@ups.edu
Thanks.  I guess i got a little careless with the "roaming knowls". They are now in the right place. You should never roam alone.

For #2, I made the edit as suggested but no change.

For #3, I also removed "webwork2" from the compile sequence and now get the error message

Unable to decode problem text
Error message for command: renderProblem 
faultcode: Server 
faultstring: Please use 'course_password' instead of 'password' as the key for submitting passwords to this webservice 
End error message

Alex Jordan

unread,
Aug 16, 2016, 10:21:19 PM8/16/16
to MathBook XML Support, bee...@ups.edu
Dang. Looks like when WeBWorK upgraded to 2.12 they changed the key for how the password is submitted from "password=" to "course_password=". We'll have to think about how to handle this.

Otherwise your knowls work. After I change that key in the url string, I get this:
https://math.mc.edu/webwork2/html2xml?&amp;answersSubmitted=0&amp;problemSource=IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjCiMjIyBHZW5lcmF0ZWQgZnJvbSBNYXRoQm9vayBYTUwgc291cmNlIAojIyMgICAgb24gMjAxNi0wOC0x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EgPSBDb21wdXRlKHJhbmRvbSgxLCA5LCAxKSk7IAokYiA9IENvbXB1dGUocmFuZG9tKDEsIDksIDEpKTsgCiRjID0gJGEgKyAkYjsKCiMjIyMjIyMjIyMjIyMjIyMjIyMjCiMgQm9keQojIyMjIyMjIyMjIyMjIyMjIyMjIwpCRUdJTl9QR01MCkNvbXB1dGUgW2BbJGFdK1skYl1gXS4KClRoZSBzdW0gaXMgICAgIFtfX117JGN9IFtAQW5zd2VyRm9ybWF0SGVscCgnbnVtYmVycycpQF0qLgoKCkVORF9QR01MCgojIyMjIyMjIyMjIyMjIyMjIyMjIwojIFNvbHV0aW9uCiMjIyMjIyMjIyMjIyMjIyMjIyMjCkJFR0lOX1BHTUxfU09MVVRJT04KW2BbJGFdK1skYl09WyRjXWBdLgoKCkVORF9QR01MX1NPTFVUSU9OCgojIyMjIyMjIyMjIyMjIyMjIyMjIwojIEVuZCBQcm9ibGVtCiMjIyMjIyMjIyMjIyMjIyMjIyMjCkVORERPQ1VNRU5UKCk7Cg==&amp;problemSeed=123567890&amp;displayMode=MathJax&amp;courseID=anonymous&amp;userID=anonymous&amp;course_password=anonymous&amp;outputformat=simple

Anyway, stand by while we think about how to address this change in WeBWorK's behavior in the new versions.

Rob Beezer

unread,
Aug 17, 2016, 12:46:08 AM8/17/16
to mathbook-x...@googlegroups.com
On 08/16/2016 07:21 PM, Alex Jordan wrote:
> Dang. Looks like when WeBWorK upgraded to 2.12 they changed the key for how the
> password is submitted from "password=" to "course_password=". We'll have to
> think about how to handle this.

Is the problem that there are now two ways to accomplish this, depending on
which version is on the configured server?

Can we send both versions? ;-)

Rob

Alex Jordan

unread,
Aug 17, 2016, 2:46:18 AM8/17/16
to MathBook XML Support, bee...@ups.edu

Is the problem that there are now two ways to accomplish this, depending on
which version is on the configured server?

Yes. Likely Geoff and Mike had some good reason to stop calling the selector
"password" and start calling it "course_password".
 

Can we send both versions?  ;-)

Initial experiment suggests that tacking on both js selectors
&amp;password=anonymous&amp;course_password=anonymous
will work on both new and old WeBWorK versions.

John, I haven't upgraded here yet to WeBWorK 2.12. So I'm not yet
familiar with lots of changes. Since you have a 2.12 server running, I
wonder if you would give me access to yours to look around to more
completely understand this issue. Could you go into your anonymous
course and create an account for me with instructor level permissions?
You could email me the account name and password off list and delete
it as soon as I am done. I wouldn't be changing any settings, but I do
want to look around what settings you have in the various course
configuration files that might explain why your version of the problem
looks so different than what I see if I swap out your server with the one
at pcc.edu.

John Travis

unread,
Aug 17, 2016, 2:14:07 PM8/17/16
to MathBook XML Support, bee...@ups.edu
Aha! Glad to have found (in this case) that I am not the problem!  

Absolutely. Will send details...

Michael Gage

unread,
Aug 18, 2016, 10:58:01 AM8/18/16
to MathBook XML Support, bee...@ups.edu
While including both password and course_password may work for the moment it should be deprecated over the long term.

There are two "passwords" involved.  The course_password (formerly password) is authenticated against the webwork database
to compare the user and the associated password.  The site_password will be authenticated against the webservice right at the beginning of 
the process -- no checking of the database.  I'm hoping that because this check is so fast it will help reduce the danger of DNS exploits.  Currently the site_password isn't being checked because all of the webservice sites are more or less experimental and we haven't had DNS attacks so far. 

There is an error message if you only use the keyword password -- indicating that this keyword is deprecated in favor of course_password.

Alex Jordan

unread,
Aug 19, 2016, 10:03:14 PM8/19/16
to MathBook XML Support, bee...@ups.edu
Mike, to your knowledge, is there no downside to passing both "password=" and "course_password="? My experiments on my 2.11 server and John's 2.12 server suggest that there is none.

mgage

unread,
Aug 19, 2016, 10:57:54 PM8/19/16
to mathbook-x...@googlegroups.com, Michael Gage
There aren’t any now and I don’t think there will be any.  Password was replaced by course_password.
The site_password keyword has been reserved as a site level filter.  It’s not used not checked at the moment — and it’s default
in the webwork webservice code is something like 1234567890 but eventually it could be turned on to 
to quickly dismiss bots and spam that didn’t know the site password.  

In any case using both password will work well for now when you have both 2.11 and 2.12 sites around.

Take care,

Mike

On Aug 19, 2016, at 10:03 PM, Alex Jordan <jordanc...@gmail.com> wrote:

Mike, to your knowledge, is there no downside to passing both "password=" and "course_password="? My experiments on my 2.11 server and John's 2.12 server suggest that there is none.


--
You received this message because you are subscribed to the Google Groups "MathBook XML Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathbook-xml-sup...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Robert Beezer

unread,
Aug 22, 2016, 10:48:45 PM8/22/16
to MathBook XML Support, ga...@math.rochester.edu
I just merged:

https://github.com/rbeezer/mathbook/pull/375

So I hope that addresses the password changes.  Thanks to Alex for maintaining the WeBWorK code.

Rob
Reply all
Reply to author
Forward
0 new messages