Installation

Unable to embed Question in html

Unable to embed Question in html

by Andrew Bayliss -
Number of replies: 6
This is the code I am using. Taken straight from http://michaelgage.blogspot.com/2015/06/whether-writing-full-text-book-or-just.html

<iframe height="600" src="http://webwork.sparta.org/webwork2/html2xml?
&answersSubmitted=0
&sourceFilePath=Library/Rochester/setAlgebra01RealNumbers/lhp1_31-34_mo.pg
&problemSeed=123567890
&displayMode=MathJax
&courseID=daemon_course
&userID=daemon
&course_password=daemon
&outputformat=debug" width="540">
</iframe>

This is the message I get with the output format set to debug.

WeBWorK Editor using host: http://localhost/mod_xmlrpc, format: debug

WebworkClient=HASH(0x7f4051ea2920)
course =>  
courseID => daemon_course
displayMode => MathJax
encodedSource =>  
error_string => Error message for command: renderProblem <br/>faultcode: Server <br/>faultstring: Unknown exception when trying to verify authentication. at /opt/webwork/webwork2/lib/WebworkWebservice.pm line 230. <br/>End error message<br/>
form_action_url => http://localhost/webwork2/html2xml
input => HASH(0x7f40526419f8)
envir => HASH(0x7f40526f0110)
inputs_ref => HASH(0x7f404bbbe488)
answersSubmitted => 0
courseID => daemon_course
course_password => daemon
displayMode => MathJax
outputformat => debug
problemSeed => 123567890
sourceFilePath => Library/Rochester/setAlgebra01RealNumbers/lhp1_31-34_mo.pg
userID => daemon
output =>  
outputformat => debug
outputformats => HASH(0x7f40526ea4a8)
simple => <!DOCTYPE html> <html> <head> <link rel="shortcut icon" href="/webwork2_files/images/favicon.ico"/> <!-- CSS Loads --> <link rel="stylesheet" type="text/css" href="/webwork2_files/js/vendor/bootstrap/css/bootstrap.css"/> <link href="/webwork2_files/js/vendor/bootstrap/css/bootstrap-responsive.css" rel="stylesheet" /> <link rel="stylesheet" type="text/css" href="/webwork2_files/css/jquery-ui-1.8.18.custom.css"/> <link rel="stylesheet" type="text/css" href="/webwork2_files/css/vendor/font-awesome/css/font-awesome.min.css"/> <link rel="stylesheet" type="text/css" href="/webwork2_files/themes/math4/math4.css"/> <link href="/webwork2_files/css/knowlstyle.css" rel="stylesheet" type="text/css" /> <!-- JS Loads --> <script type="text/javascript" src="/webwork2_files/js/vendor/jquery/jquery.js"></script> <script type="text/javascript" src="/webwork2_files/mathjax/MathJax.js?config=TeX-MML-AM_HTMLorMML-full"></script> <script type="text/javascript" src="/webwork2_files/js/jquery-ui-1.9.0.js"></script> <script type="text/javascript" src="/webwork2_files/js/vendor/bootstrap/js/bootstrap.js"></script> <script src="/webwork2_files/js/apps/AddOnLoad/addOnLoadEvent.js" type="text/javascript"></script> <script src="/webwork2_files/js/legacy/java_init.js" type="tesxt/javascript"></script> <script src="/webwork2_files/js/apps/InputColor/color.js" type="text/javascript"></script> <script src="/webwork2_files/js/apps/Base64/Base64.js" type="text/javascript"></script> <script src="/webwork2_files/mathjax/MathJax.js?config=TeX-MML-AM_HTMLorMML-full" type="text/javascript"></script> <script type="textx/javascript" src="/webwork2_files/js/vendor/underscore/underscore.js"></script> <script type="text/javascript" src="/webwork2_files/js/legacy/vendor/knowl.js"></script> <script src="/webwork2_files/js/apps/Problem/problem.js" type="text/javascript"></script> <script type="text/javascript" src="/webwork2_files/themes/math4/math4.js"></script> <script type="text/javascript" src="/webwork2_files/js/vendor/iframe-resizer/js/iframeResizer.contentWindow.min.js"></script> <base href="http://localhost/mod_xmlrpc"> <title>http://localhost/mod_xmlrpc WeBWorK Editor using host: http://localhost/mod_xmlrpc, format: simple seed: 123567890</title> </head> <body> <div class="container-fluid"> <div class="row-fluid"> <div class="span12 problem"> <form action="http://localhost/webwork2/html2xml" method="post"> <div class="problem-content"> Unable to decode problem text Error message for command: renderProblem <br/>faultcode: Server <br/>faultstring: Unknown exception when trying to verify authentication. at /opt/webwork/webwork2/lib/WebworkWebservice.pm line 230. <br/>End error message<br/> </div> <input type="hidden" name="answersSubmitted" value="1"> <input type="hidden" name="sourceFilePath" value = "Library/Rochester/setAlgebra01RealNumbers/lhp1_31-34_mo.pg"> <input type="hidden" name="problemSource" value=""> <input type="hidden" name="problemSeed" value="123567890"> <input type="hidden" name="pathToProblemFile" value=""> <input type="hidden" name=courseName value="daemon_course"> <input type="hidden" name=courseID value="daemon_course"> <input type="hidden" name="userID" value="daemon"> <input type="hidden" name="password" value=""> <input type="hidden" name="passwd" value=""> <input type="hidden" name="displayMode" value="MathJax"> <input type="hidden" name="session_key" value=""> <input type="hidden" name="outputformat" value="simple"> <p> <input type="submit" name="preview" value="Preview" /> <input type="submit" name="WWsubmit" value="Submit answer"/> <input type="submit" name="WWgrade" value="Show correct answer"/> </p> </form> </div> </div></div> </body> </html>
standard => <html> <head><link rel="shortcut icon" href="/webwork2_files/images/favicon.ico"/> <!-- CSS Loads --> <link rel="stylesheet" type="text/css" href="/webwork2_files/js/vendor/bootstrap/css/bootstrap.css"/> <link href="/webwork2_files/js/vendor/bootstrap/css/bootstrap-responsive.css" rel="stylesheet" /> <link rel="stylesheet" type="text/css" href="/webwork2_files/css/jquery-ui-1.8.18.custom.css"/> <link rel="stylesheet" type="text/css" href="/webwork2_files/css/vendor/font-awesome/css/font-awesome.min.css"/> <link rel="stylesheet" type="text/css" href="/webwork2_files/themes/math4/math4.css"/> <link href="/webwork2_files/css/knowlstyle.css" rel="stylesheet" type="text/css" /> <!-- JS Loads --> <script type="text/javascript" src="/webwork2_files/js/vendor/jquery/jquery.js"></script> <script type="text/javascript" src="/webwork2_files/mathjax/MathJax.js?config=TeX-MML-AM_HTMLorMML-full"></script> <script type="text/javascript" src="/webwork2_files/js/jquery-ui-1.9.0.js"></script> <script type="text/javascript" src="/webwork2_files/js/vendor/bootstrap/js/bootstrap.js"></script> <script src="/webwork2_files/js/apps/AddOnLoad/addOnLoadEvent.js" type="text/javascript"></script> <script src="/webwork2_files/js/legacy/java_init.js" type="tesxt/javascript"></script> <script src="/webwork2_files/js/apps/InputColor/color.js" type="text/javascript"></script> <script src="/webwork2_files/js/apps/Base64/Base64.js" type="text/javascript"></script> <script src="/webwork2_files/mathjax/MathJax.js?config=TeX-MML-AM_HTMLorMML-full" type="text/javascript"></script> <script type="textx/javascript" src="/webwork2_files/js/vendor/underscore/underscore.js"></script> <script type="text/javascript" src="/webwork2_files/js/legacy/vendor/knowl.js"></script> <script src="/webwork2_files/js/apps/Problem/problem.js" type="text/javascript"></script> <script type="text/javascript" src="/webwork2_files/themes/math4/math4.js"></script> <script type="text/javascript" src="/webwork2_files/js/vendor/iframe-resizer/js/iframeResizer.contentWindow.min.js"></script> <base href="http://localhost/mod_xmlrpc"> <title>http://localhost/mod_xmlrpc WeBWorK Editor using host: http://localhost/mod_xmlrpc, format: standard</title> </head> <body> <h2> WeBWorK Editor using host: http://localhost/mod_xmlrpc, format: standard</h2> <script type="text/javascript">addOnLoadEvent(function () {color_inputs([ ],[ ] )});</script> <form action="http://localhost/webwork2/html2xml" method="post"> Unable to decode problem text Error message for command: renderProblem <br/>faultcode: Server <br/>faultstring: Unknown exception when trying to verify authentication. at /opt/webwork/webwork2/lib/WebworkWebservice.pm line 230. <br/>End error message<br/> <input type="hidden" name="answersSubmitted" value="1"> <input type="hidden" name="sourceFilePath" value = "Library/Rochester/setAlgebra01RealNumbers/lhp1_31-34_mo.pg"> <input type="hidden" name="problemSource" value=""> <input type="hidden" name="problemSeed" value="123567890"> <input type="hidden" name="pathToProblemFile" value=""> <input type="hidden" name=courseName value="daemon_course"> <input type="hidden" name=courseID value="daemon_course"> <input type="hidden" name="userID" value="daemon"> <input type="hidden" name="password" value=""> <input type="hidden" name="passwd" value=""> <input type="hidden" name="displayMode" value="MathJax"> <input type="hidden" name="session_key" value=""> <p> <input type="submit" name="preview" value="Preview" /> <input type="submit" name="WWsubmit" value="Submit answer"/> <input type="submit" name="WWgrade" value="Show correct answer"/> </p> </form> <HR> <h3> Perl warning section </h3> <h3> PG Warning section </h3> ; <h3> Debug message section </h3> <h3> internal errors </h3> </body> </html>
sticky => <!DOCTYPE html> <html> <head> <link rel="shortcut icon" href="/webwork2_files/images/favicon.ico"/> <!-- CSS Loads --> <link rel="stylesheet" type="text/css" href="/webwork2_files/js/vendor/bootstrap/css/bootstrap.css"/> <link href="/webwork2_files/js/vendor/bootstrap/css/bootstrap-responsive.css" rel="stylesheet" /> <link rel="stylesheet" type="text/css" href="/webwork2_files/css/jquery-ui-1.8.18.custom.css"/> <link rel="stylesheet" type="text/css" href="/webwork2_files/css/vendor/font-awesome/css/font-awesome.min.css"/> <link rel="stylesheet" type="text/css" href="/webwork2_files/themes/math4/math4.css"/> <link href="/webwork2_files/css/knowlstyle.css" rel="stylesheet" type="text/css" /> <!-- JS Loads --> <script type="text/javascript" src="/webwork2_files/js/vendor/jquery/jquery.js"></script> <script type="text/javascript" src="/webwork2_files/mathjax/MathJax.js?config=TeX-MML-AM_HTMLorMML-full"></script> <script type="text/javascript" src="/webwork2_files/js/jquery-ui-1.9.0.js"></script> <script type="text/javascript" src="/webwork2_files/js/vendor/bootstrap/js/bootstrap.js"></script> <script type="text/javascript" src="/webwork2_files/js/vendor/jquery/modules/jquery.json.min.js"></script> <script type="text/javascript" src="/webwork2_files/js/vendor/jquery/modules/jstorage.js"></script> <script src="/webwork2_files/js/apps/AddOnLoad/addOnLoadEvent.js" type="text/javascript"></script> <script src="/webwork2_files/js/legacy/java_init.js" type="tesxt/javascript"></script> <script src="/webwork2_files/js/apps/InputColor/color.js" type="text/javascript"></script> <script src="/webwork2_files/js/apps/Base64/Base64.js" type="text/javascript"></script> <script src="/webwork2_files/mathjax/MathJax.js?config=TeX-MML-AM_HTMLorMML-full" type="text/javascript"></script> <script type="textx/javascript" src="/webwork2_files/js/vendor/underscore/underscore.js"></script> <script type="text/javascript" src="/webwork2_files/js/legacy/vendor/knowl.js"></script> <script src="/webwork2_files/js/apps/LocalStorage/localstorage.js" type="text/javascript"></script> <script src="/webwork2_files/js/apps/Problem/problem.js" type="text/javascript"></script> <script type="text/javascript" src="/webwork2_files/themes/math4/math4.js"></script> <script type="text/javascript" src="/webwork2_files/js/vendor/iframe-resizer/js/iframeResizer.contentWindow.min.js"></script> <base href="http://localhost/mod_xmlrpc"> <title>http://localhost/mod_xmlrpc WeBWorK Editor using host: http://localhost/mod_xmlrpc, format: sticky seed: 123567890</title> </head> <body> <div class="container-fluid"> <div class="row-fluid"> <div class="span12 problem"> <form id="problemMainForm" class="problem-main-form" name="problemMainForm" action="http://localhost/webwork2/html2xml" method="post"> <div class="problem-content"> Unable to decode problem text Error message for command: renderProblem <br/>faultcode: Server <br/>faultstring: Unknown exception when trying to verify authentication. at /opt/webwork/webwork2/lib/WebworkWebservice.pm line 230. <br/>End error message<br/> </div> <div id="local-storage-messages"><p>Your overall score for this problem is <span id="problem-overall-score"></span></p></div> <input type="hidden" name="answersSubmitted" value="1"> <input type="hidden" name="sourceFilePath" value = "Library/Rochester/setAlgebra01RealNumbers/lhp1_31-34_mo.pg"> <input type="hidden" name="problemSource" value=""> <input type="hidden" name="problemSeed" value="123567890"> <input type="hidden" name="pathToProblemFile" value=""> <input type="hidden" name="courseName" value="daemon_course"> <input type="hidden" name="courseID" value="daemon_course"> <input type="hidden" name="userID" value="daemon"> <input type="hidden" name="problemIdentifierPrefix" value=""> <input type="hidden" name="password" value=""> <input type="hidden" name="passwd" value=""> <input type="hidden" name="displayMode" value="MathJax"> <input type="hidden" name="session_key" value=""> <input type="hidden" name="outputformat" value="sticky"> <p> <input type="submit" name="preview" value="Preview" /> <input type="submit" name="WWsubmit" value="Submit answer"/> <input type="submit" name="WWgrade" value="Show correct answer"/> </p> </form> </div> </div> </div> <!-- Activate local storage js --> <script type="text/javascript">WWLocalStorage();</script> </body> </html>
password =>  
session_key =>  
site_password => xmlwebwork
sourceFilePath => Library/Rochester/setAlgebra01RealNumbers/lhp1_31-34_mo.pg
url => http://localhost/mod_xmlrpc
userID => daemon

I have just recently upgrade webwork and pg to 2.11. Any help would be appreciated. Thanks, Andrew
In reply to Andrew Bayliss

Re: Unable to embed Question in html

by Michael Gage -
Andrew,

Change the lines
&outputformat=debug" width="540">

to &outputformat=sticky" width="540">  (answers stay around)

or to 
&outputformat=standard" width="540"> 

(there is also a "simple" format).  

What you are seeing is exactly what one expects from the debug format
-- you get all the debugging information.  

Take care,

Mike

The example that I thought I put on my blog post was:

<iframe height="600" src="https://hosted2.webwork.rochester.edu/webwork2/html2xml?
&answersSubmitted=0
&sourceFilePath=Library/Rochester/setAlgebra01RealNumbers/lhp1_31-34_mo.pg
&problemSeed=123567890
&displayMode=MathJax
&courseID=daemon_course
&userID=daemon
&course_password=daemon
&outputformat=simple" width="540">
</iframe>
Hope this helps.

Take care,

Mike


In reply to Michael Gage

Re: Unable to embed Question in html

by Andrew Bayliss -
Sorry for not being clear.  When I try to embed the problem in a webpage, all I get is the error message below.  I can't get the problem to render correctly.

Error message for command: renderProblem 
faultcode: Server 
faultstring: Unknown exception when trying to verify authentication. at /opt/webwork/webwork2/lib/WebworkWebservice.pm line 230. 
End error message

I posted the debug code in case that might help in diagnosing the problem.

Andrew
In reply to Andrew Bayliss

Re: Unable to embed Question in html

by Michael Gage -
Hi Andrew,

My apologies for not understanding the problem. I didn't read the very bottom
of your post.

 First I'm assuming that 
the problem does work when you post it at my server https://hosted2.webwork.rochester.edu/webwork2/html2xml?

That means that the snippet you copied is working correctly. (Beware extra
blank spaces, for example after ='s signs.  They can cause trouble.)

hosted2 is running the develop branch from github, not the release-2.11 version.
hosted2 also has a course "daemon_course"   with a user with ta privileges or greater named "daemon"  and that user's password is "daemon". (I think the permission level of daemon only needs to be 2, but the level 5 of ta's is certainly enough.)

If you are running the release-2.11 version you do get an error message about authentication. You will also get that error message if the daemon_course and user have not been set up.

Take care,

Mike


In reply to Michael Gage

Re: Unable to embed Question in html

by Andrew Bayliss -
I have the daemon course set up with the user, password daemon, and user rights as a professor.  But I still get the same error.

I read a few threads back that Webwork 2.10 on needs to have an SSL cert installed.  So far I haven't had any problems without it, but could that be causing a problem? 

I also tried running setfilepermissions, in case it was a permissions problems.  Still no good.

Andrew
In reply to Michael Gage

Re: Unable to embed Question in html

by Andras Balogh -
I get this same error with our server running release-2.11, while it works with hosted2.webwork.rochester.edu

------
Unable to decode problem text Error message for command: renderProblem
faultcode: Server
faultstring: Unknown exception when trying to verify authentication. at /app/webwork/webwork2/lib/WebworkWebservice.pm line 230.
End error message
------

And we have a valid server certificate.

So if I understand correctly, release-2.11 does not have this capability.

Andras
In reply to Andras Balogh

Re: Unable to embed Question in html

by Michael Gage -
Andras. You are correct.  The feature is not in release-2.11. 

This feature, of embedding in HTML pages, requires
the "develop" branch.  Release-2.11 is not enough.  The feature embed html feature will be standard in release-2.12 but it didn't quite make it in to release-2.11.

hosted2 is running the "develop" branch and you are  welcome to use it for the time being.  It won't be 100% reliable because some development takes place on it  but it will be 80% reliable.

-- Mike