WeBWorK Main Forum

Difficulties with CSUOhio appletDemonstrationProblems

Difficulties with CSUOhio appletDemonstrationProblems

by Stéphanie Lanthier -
Number of replies: 13
Dear forum members,

New to WeBWorK, I installed its version 2.5 on a CentOS 5 server. It's going well in general.

But I'm running into difficulties while I want to use the problems that contain applets, in particular, the problems that can be found in the Library/CSUOhio/appletDemonstrationProblems/ section.

Let's say that I added the graphLimits3.pg problem to my homework set.

When I want to try it, I am getting those warnings :

Warning messages

  • findAppletCodebase Error: Graph_Limit.swf not found after searching http://webwork.moodle.uqam.ca/webwork2_files/applets, http://webwork.moodle.uqam.ca/webwork2_files/applets/geogebra_stable, http://webwork.moodle.uqam.ca/webwork2_course_files/PIF2000/applets, http://webwork.moodle.uqam.ca/webwork2_files/applets/Xgraph, http://webwork.moodle.uqam.ca/webwork2_files/applets/PointGraph, http://webwork.moodle.uqam.ca/webwork2_files/applets/Xgraph, http://webwork.moodle.uqam.ca/webwork2_files/applets/liveJar, http://webwork.moodle.uqam.ca/webwork2_files/applets/Image_and_Cursor_All at [PG]/lib/PGalias.pm line 805
Moreover, I cannot see any graphical function, neither a grill. Only a grey box.

Maybe I forgot something during my set up?

Any hint will be welcome.

Best regards,

Stéphanie

In reply to Stéphanie Lanthier

Re: Difficulties with CSUOhio appletDemonstrationProblems

by Jason Aubrey -
Hi Stéphanie,

There is one configuration item that has to be done to get these problems working - I'll document this and add it to the svn as well so it works automatically. Here's what you can do to get it working right now:

1) On the server go to your webwork2/htdocs/applets directory, and create a symlink to the libraries/NationalProblemLibrary/CSUOhio/htdocs/applets/ directory. From within webwork2/htdocs/applets, I did

ln -s /opt/webwork/libraries/NationalProblemLibrary/CSUOhio/htdocs/applets/ flashapplets

2) Edit global.conf to put the that symlink in the applet search path. In global.conf, I edited my $pg{directories}{appletPath}, so that it looks like this:

$pg{directories}{appletPath} = [
"$webworkURLs{htdocs}/applets",
"$webworkURLs{htdocs}/applets/geogebra_stable",
"$courseURLs{html}/applets",
"$webworkURLs{htdocs}/applets/Xgraph",
"$webworkURLs{htdocs}/applets/PointGraph",
"$webworkURLs{htdocs}/applets/Xgraph",
"$webworkURLs{htdocs}/applets/liveJar",
"$webworkURLs{htdocs}/applets/Image_and_Cursor_All",
"$webworkURLs{htdocs}/applets/flashapplets",
];

Then restart the server and the problems should work as advertised.

Hope this helps,
Jason
In reply to Jason Aubrey

Re: Difficulties with CSUOhio appletDemonstrationProblems

by Stéphanie Lanthier -
Dear Jason, and lists members,

The steps provided by Jason had the consequence that I now can see the grid. But the draw of the function still does not appear.

I attached the picture of the situation as a pdf file.

Does it look like I still had forgotten a step during my WeBWorK installation?

Best regards,

Stéphanie
In reply to Stéphanie Lanthier

Re: Difficulties with CSUOhio appletDemonstrationProblems

by Barbara Margolius -
Hi Stéphanie,

Are you looking at the problem in the library browser or in a problem set?

If you are looking at it in the library browser, try adding it to a problem set and see if it works properly there.  It looks like what you are seeing is the applet without any communication from the problem.  The library browser just displays the uninitialized applets without problem data.  Once they are in a problem set though (I think and hope) the problem gets configured.

Barbara
In reply to Barbara Margolius

Re: Difficulties with CSUOhio appletDemonstrationProblems

by Stéphanie Lanthier -
Hi Barbara, and all forum members,

Yes, I was already looking to the applet problems throught a problem set.

Your post gave me the idea to try to create a new problem set - I hadn't try to create a new problem since I applied Jason's recommandations on the symbolic links-.

Dispite my hopes, the situation is still the same : I can see only the grid of the graphLimits3.pg problem.

I had other problems to my new set. I'm attaching theirs display as pdf files, hoping that their view could inspire some WeBWorK guru in this supporting process.

For the soligWW.pg problem, note that the left parts did not changed from their initial views, even if I had rotated the figure.

All the cases are taken from the CSUOhio appletDemonstrationProblems

Best regards,

Stéphanie

In reply to Stéphanie Lanthier

Re: Difficulties with CSUOhio appletDemonstrationProblems

by Barbara Margolius -
Well the good news is that it is the same problem -- a failure of communication between WeBWorK and the applet.  The bad news is that I'm not sure why that is happening or more precisely, failing to happen.

Does the derivativeDraw applet work?  There the communication goes from the applet to WeBWorK once the submit button is hit.

For these that you mention WeBWorK needs to configure the applet and is not doing so.


In reply to Stéphanie Lanthier

Re: Difficulties with CSUOhio appletDemonstrationProblems

by L. Felipe Martins -
Hi Stephanie. Would it be possible for you to send me the source of the page where you are experiencing the problem? By this I mean, open the page in your browser and open a "view source" window. The PC, you can open this pressing Ctrl-U, and in the Mac it is Option-Command-U. 

Then you will be able to "Save As" the contents of the window and post it to the forum as an attachment. I want to see what the WeBWorK server is returning to you, to see if I can spot the problem.
In reply to L. Felipe Martins

Re: Difficulties with CSUOhio appletDemonstrationProblems

by Stéphanie Lanthier -
Hi Felipe, and all forum members,

As Felipe kindly proposed, I attach the source code of the web page on which the situation arise.

Best regards,

Stéphanie

In reply to Stéphanie Lanthier

Re: Difficulties with CSUOhio appletDemonstrationProblems

by Michael Gage -
Stéphanie,

Which version of webwork are you using?

You or someone else can type 

svn info

in the webwork2 directory.

If you are using 2.5.0 or the trunk version you might like to update
since there have been some recent bug fixes to the 2.5.0 code which
might affect displaying applets.  if you are using 2.4.9 then this is probably
not the case.

Before you do any updates -- check the following file for the theme you are using -- I've illustrated it for math2 which is the most tested theme.

look at    conf/templates/math2/system.template

and look for the <body>  tag.  If it looks like
<body>  -- that is likely the problem
if it looks like
<body bgcolor="white" onload="if (typeof(initializeWWquestion) == 'function') {initializeWWquestion()}">

then you have a different problem then the one I've just fixed, at least temporarily.

For a test you can just fix the body tag to include the initialization function, but for a more  secure fix it would be wise to update.



To update 

cd webwork2
svn update

-- then make any needed adjustments to global.conf

----------------------------------------
if you want to make a minimal amount of adjustment

cd webwork2/conf/templates
svn update

then
cd webwork2/htdocs/css

construct links to the various css documents  e.g.

mv math2.css math2.save
ln -s ../../conf/templates/math2/math2.css math2.css

and so on for other themes that you use.  (math2 is the most tested
at the moment)

you should also update Problem.pm

cd webwork2/lib/WeBWorK/ContentGenerator/
svn update Problem.pm

-----------------------------
it's always risky doing partial updates -- but I think this will work.


-----------------------------------------------------

Hope this helps.

-- Mike
In reply to Michael Gage

Re: Difficulties with CSUOhio appletDemonstrationProblems

by Stéphanie Lanthier -
Dear Michael, and forum's members,

I am using version 2.5.0.

I updated this morning (nothing to lose!)

Here is the result of the command :

# svn info

Chemin : .

URL : http://svn.webwork.maa.org/system/trunk/webwork2

Racine du dépôt : http://svn.webwork.maa.org/system UUID du dépôt : c0722133-6baf-4dd8-8699-98d999cd4f06

Révision : 7065

Type de nud : répertoire

Tâche programmée : normale

Auteur de la dernière modification : gage Révision de la dernière modification : 7065 Date de la dernière modification: 2011-10-02 10:14:34 -0400 (dim 02 oct 2011)

And... the display problem persist. (I am using the math2 template).

I noticed that a behavior had changed. Now, when I want to acceed a problem, a pop-up window opens, saying "Oops, applet is not ready. 1 tries left".

I then push the "OK" button, and then, antoher message in a pop-up box :"We haven't been able to verify that the applet *name of the applet* is loaded. We'll try to use it anyway but it might not work."

Effectively, it doesn't work.

That was the bulletin of the day!

Thank you very much for all your attention,

Stéphanie


In reply to Stéphanie Lanthier

Re: Difficulties with CSUOhio appletDemonstrationProblems

by Michael Gage -
Hi Stéphanie,

OK.  that's an improvement.  Now at least it's communicating that it can't load the applet.  Unfortunately there could be many reasons why the applet can't be loaded, from incorrect addresses to certain browsers or systems blocking certain kinds of applets.

The next thing I would try is to see whether it's just these applets that can't viewed, or just applets in webwork (perhaps all applets are being blocked).

there are a number of simple flash applets in the course
https://test.webwork.maa.org/webwork2/2010geogebra_at_ithaca/PointAndGraph_AppletDemos/?effectiveUser=practice1&user=practice1&key=8TP1N4GDHEhJj9vyt3qFlM2syE8UqLWh

We can try to install them in your course and see if those run.
There is also information at:
http://webwork.maa.org/wiki/SolidsWW_Flash_Applet_Sample_Problem_1

I like to having something working and then move from there to things that are not working whenever I can.

If you need help we can probably do that but we'll need professor access to the course.

-- Mike


In reply to Stéphanie Lanthier

Re: Difficulties with CSUOhio appletDemonstrationProblems

by L. Felipe Martins -
Hi Stephanie. I respondent to your posting a couple days ago, but I replied to the email message, so it never made to the forum. Here is a copy of my original posting. Some of it has been already mentioned here, so it seems you have a wrong system.template for math2. I thought this issue had been resolved a couple of weeks ago. I'm at a conference now, later this afternoon I'll check the files that are in the current distribution.

--------
Here is my original posting:

Hi, I think I can see what is the problem. Did you, by any chance,
install/update WeBWorK about three weeks ago? There was glitch that crept
into some of the versions around that time that probably was fixed by now.
So, if you (or your administrator) update WW now, it probably will be
working correctly.

Here is a little more information, if you want to check if this is what
causing the problem before you go through the updating process. This is
probably more technical information than you care to know, but it may help
making sure that the problem is what I am thinking.

Here is how you may be able to see if this is indeed the problem. Go to
Course Configuration and check the "Theme" entry. You probably have "math2"
there. Change it to "math" and click Save Changes. Then, try to open one of
the problems with applets. It is possible that it will work in the new them.
If it does, you probably have one of the versions with the bug. Of course,
you want to be able to use math2 or math3, since they look much better.

To do further a further check, if you have access to the WeBWorK
installation in your site, you can do the following.

The problem stems from the line:

<body bgcolor="white">

in the source code for the problem web page. This is where the applets
should be initialized. This line is introduced from a file called
system.template. You can go to the directory
/opt/webwork/webwork2/conf/templates, which contain a subdirectory for each
theme. Each one of these subdirectories has a file called system.template.
If you go to the directory math2 and open the system.template file there,
and search for a line starting with <body, you will probably find:

<body bgcolor="white">

Now go to the directory for the theme math, and open the system.template
there. If you were able to open the applets correctly with the theme math,
the corresponding line in system.template will be:

<body bgcolor="white" onload="if (typeof(initializeWWquestion) ==
'function') {initializeWWquestion()}">
In reply to L. Felipe Martins

Re: Difficulties with CSUOhio appletDemonstrationProblemss

by Stéphanie Lanthier -
Dear everyone who followed this discussion,

The problem is now solved; I will explain how below. Before I go further, please remember that even if those last steps have been performed before, lots of the sharing that happened here would have been necessary, due to the fact that I, at first, had installed a version of webwork 2.5 that was causing little problem with the applets.

So. Here are the steps that I performed yesterday.

1) I updated my CentOS 5 system (but that I don't feel that this is the point that solved the problem)

2) I had set in the past (and forgot it) some testing parameters in my httpd.conf file so that only one httpd process could run. Those parameters were "StartServers 1" and "MinSpareServer 1". I corrected them so that they are now respectively 8 and 5.

3) I realized yesterday that the memory was erraticly used by the server, credibly since an big bad event happened on the SAN connected to it. I rebooted my server to correct the use of the memory.

Since then, I have no more difficulties with CSUOhio appletDemonstrationProblems.

Warm thanks to all participants for their support.

Stéphanie
In reply to Stéphanie Lanthier

Re: Difficulties with CSUOhio appletDemonstrationProblemss

by L. Felipe Martins -
Hi Stephanie, thanks for pointing out this problem, and I am glad that you have finally been able to solve it. 

We realized, however, that there still is a problem searching applets through the Library Browser for users that do not have access to a shell account to the server. The purpose of this followup is to point to a workaround that requires only to have "professor" permissions, and requires not server configuration.

The procedure is somewhat time-consuming, but has to be done only for a single course per WeBWorK installation. Here is a link to the file in the wiki:


Again, thanks for pointing this out and for your patience in dealing with the problem.