Subject: [LON-CAPA-dev] Re: [LON-CAPA-users] Mac and JME

From: Guy Albertelli II <[email-masked]>
Date: Tue, 24 May 2005 23:43:57 -0400 (EDT)

Hi Mark, Gerd,

> >>> I was working on a mac just a few minutes ago under safari and
> >>> netscape.
> >>>
> >>> JME was not loading the answer box when submitted.

Can you test your mac on this page:

http://developer.apple.com/internet/safari/samples/ColorBlockApplet.html

> Right. I have just installed 10.4 (Tiger), I'll check tomorrow if  
> stuff is working now.

The 10.4 mac in the LITE Lab for some reason still has both 1.3.1 and
1.4.2 installed.

And the browsers pickup the 1.3.1 one.

-- 
[email-masked]  LON-CAPA Developer  0-7-2-6-

---

From: Jim Maxka <[email-masked]>
Date: Tue, 24 May 2005 21:32:20 -0700

Hi Mark Gerd and Guy -- Shawn uses a mac.  I passed your posts by him 
and he replied:  He has tested out both jmol and jme with OS X. We had 
problems with system 9, 8.5 worked if I remember correctly.
Here is his reply:
 >
 >--Jim
 >
 >10.4 adds java 1.5 (you have to download from the apple downloads  
page http://www.apple.com/downloads/macosx/apple/ 
 >java2se50release1.html) once installed you can then specify it as the  
default java used or it will use 1.4.2 (which is installed by >default  
on 10.4) /Applications/Utilities/Java/J2SE 5.0/Java Pref. allows you  do 
to this. It is suppose to just automatically switch to >1.5 if the  app 
uses it, but I switched mine to 1.5 and sites such as peoplesoft  work a 
lot better. Im not sure though about 10.3 with >java 1.3 and  1.4.2 
installed if they included a way to do this. Im sure a command  line way 
is possible. Also I found a way to install >1.5 on 10.3.
 >http://www.macosxhints.com/article.php? 
story=2005043002313964&query=java+1.5
 >It worked fine for me when I tried it.
 >shawn--

---

From: Gerd Kortemeyer <[email-masked]>
Date: Wed, 25 May 2005 06:48:45 -0400

> And the browsers pickup the 1.3.1 one.

The above color page works out of the box without having to do any  
configurations on my 10.4 laptop.

- Gerd.

---

From: Guy Albertelli II <[email-masked]>
Date: Wed, 25 May 2005 14:28:53 -0400 (EDT)

Hi Gerd,

> configurations on my 10.4 laptop.

Weird, so that page works fine, but the JME doesn't work?

Can you test the JME stuff against s10?

---

From: Gerd Kortemeyer <[email-masked]>
Date: Wed, 25 May 2005 15:07:07 -0400

Hi Guy,

> Can you test the JME stuff against s10?

Just did. This is what I get when I press "Insert Answer" on FireFox:

Error: document.applets.JME.jmeFile is not a function
Source File: http://s10.lite.msu.edu/~kortemey/test/jmetest.problem
Line: 1

- Gerd.

---

From: Jim Maxka <[email-masked]>
Date: Wed, 25 May 2005 12:22:14 -0700

We are working on it here too.  This is where we are today:
JME opens in safari and IE not camino.
javascript is broken to different extents for each one.
For example opening Ertl's example with text boxes on the same page.  
javascript is completely broken in IE  -- doesn't even write to text box.

In safari and camino, Ertl' example page is good but we can't write back 
to the opener window.  So, doesn't work.

Jmol is messed up too.  We are working on this right now.

Gerd Kortemeyer wrote:

> _______________________________________________
> LON-CAPA-dev mailing list
> [email-masked]
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-dev

---

From: Jim Maxka <[email-masked]>
Date: Wed, 25 May 2005 12:40:02 -0700

JMOL  -- jmol <not in loncapa> works in all browsers on 10.4  I will 
have to code test how I am calling jmol in the loncapa problems to make 
sure that they all work on the macs.  Here is a link from Bill Reusch to 
test
http://www.cem.msu.edu/~reusch/VirtualText/Questions/Stereocem/cnfgprb.htm
<http://www.cem.msu.edu/%7Ereusch/VirtualText/Questions/Stereocem/cnfgprb.htm>
Is there anyway I can help on the JME editor?  --jim

Jim Maxka wrote:

> In safari and camino, Ertl' example page is good but we can't write 
> back to the opener window.  So, doesn't work.
>

---

From: Guy Albertelli II <[email-masked]>
Date: Wed, 25 May 2005 15:46:14 -0400 (EDT)

> Source File: http://s10.lite.msu.edu/~kortemey/test/jmetest.problem

Can you figure out what version of Java you have on this machine and
what version is being used?

(The only way I know of doing this is finding the Java Plugin settings
box (which I can only find by doing a search on the machine) and
turning the Java Console on. Then when a java applet loads it prints
to the Javaconsole the version being run)

I personally can't find where the heck the 1.31 runtime files sit on
the machines I have played with.
-- 
[email-masked]  LON-CAPA Developer  0-7-2-6-

---

From: Gerd Kortemeyer <[email-masked]>
Date: Wed, 25 May 2005 16:36:42 -0400

> what version is being used?

Java(TM) Plug-in: Version 1.4.2_07
Using JRE version 1.4.2_07 Java HotSpot(TM) Client VM

The JME Editor Applet actually does run from s10, but "Insert Answer"  
is kaputt. After doing the geek hack with the debug menu (BTW, really  
cool!), this is the info I am getting when pressing "Insert Answer":

java.net.MalformedURLException: no protocol
undefined

- Gerd.

---

From: Guy Albertelli II <[email-masked]>
Date: Wed, 25 May 2005 16:44:49 -0400 (EDT)

Hi Gerd,

> java.net.MalformedURLException: no protocol

Blah, that is just a freaking weird error.

Okay, I am giving up hope on Safari with java 1.4.2

And I can't convince Mozilla/Firefox to use something other that Java 1.3.1

Opera it is. (They ship their own java implementation with their browser.)

---

From: Guy Albertelli II <[email-masked]>
Date: Wed, 25 May 2005 16:46:53 -0400 (EDT)

Hi Gerd,

My Safari's are doing odd things with 

win=window.open('/adm/rat/empty.html'...)
win.open(...)
win.writeln()

They seem to be ignoring the .wirteln (at lesat the window statys
empty)

I found that removing the /adm/rat/empty.html from the window.open
seems to fix it.

Do you know of any reason I should do that?

---

From: Guy Albertelli II <[email-masked]>
Date: Wed, 25 May 2005 16:52:22 -0400 (EDT)

Hi Jim,

> to the opener window.  So, doesn't work.

Which example page are you playing with here?

What version of Java are using for this?

As far as I can tell all version up to and including Java 1.4.2_07
don't work with either 
http://www.molinspiration.com/cgi-bin/properties
(The drop down menu should insert objects into the Java applet)
Or the Draw Molecule button for and <organicresponse>.

Both of them fail in Safari with really odd Java (not Javascript)
errors showing up in the Javascript (Not Java) error console.

And can I once again shoot whom ever named it javascript?

---

From: Guy Albertelli II <[email-masked]>
Date: Wed, 25 May 2005 16:54:37 -0400 (EDT)

Hi Jim,

> JMOL  -- jmol <not in loncapa> works in all browsers on 10.4

Is this just that the applet displays/works, or have you actually
succesfully had Javascript do something or get some info from the Jmol
applet?

> Is there anyway I can help on the JME editor?  --jim

Yeah, Rewrite the LiveConnect support in the Java engine that Apple
ships so it actually works.

---

From: Gerd Kortemeyer <[email-masked]>
Date: Wed, 25 May 2005 17:09:58 -0400

> Do you know of any reason I should do that?

In the previous version in CVS, it was misspelled to say '/rat/adm/'  
- just to explain my most recent commit.

There are browsers that need something in the open statement, I  
believe Internet Explorer to be one of them. I believe there is a  
function in lonhtmlcommon or loncommon which does the right thing for  
each browser to get a new empty window.

- Gerd.

---

From: Jim Maxka <[email-masked]>
Date: Wed, 25 May 2005 14:13:14 -0700

Yeah Guy -- I am not sure how apple implements the LiveConnect.  I have 
previous jme problems that I tested today and get the same kind of 
behavior, but I don't have a mac and my student assistant doesn't know 
how to debug either the java or the javascript.  So, I have no idea how 
to fix it right now.

Maybe this why apple's stock went up??

For jmol, would you try this page and tell me what you see:
/res/nau/jim/chm238/ch17-alcohols/naming.problem
This is not converted to jmol.js yet = uses <applet> tags.

Here is a jmol.js problem:
/res/nau/jim/chm235/ch4-conformation/butane.problem

thanks --

---

From: Guy Albertelli II <[email-masked]>
Date: Wed, 25 May 2005 17:15:56 -0400 (EDT)

Hi Gerd,

> - just to explain my most recent commit.

Aye.

> each browser to get a new empty window.

I can't find anything releate to window.open(), I found
document.open() and something that returns 'javascript:void(0)'

---

From: Gerd Kortemeyer <[email-masked]>
Date: Wed, 25 May 2005 17:25:32 -0400

> document.open() and something that returns 'javascript:void(0)'

I think the latter one. If I remember correctly, on IE, strange  
things happen if nothing is in the open-statement; something stupid  
like the opening page gets loaded into that window or so.

Syntax:
             my $nothing = &Apache::lonhtmlcommon::javascript_nothing();

             window.open('.$nothing.');

- Gerd.

---

From: "rlight" <[email-masked]>
Date: Thu, 26 May 2005 15:26:29 -0400

Jim,

Is   /res/nau/jim/chm235/ch4-conformation/butane.problem  supposed to have
structures next to the drop down boxes?  I don't see anything there on
either IE or firefox on a windows XP machine.  The IE on my laptop pops up a
window reporting some errors as the page loaded:

Line: 187
Char: 13
Error:  Object expected
Code: 0
URL: (the path to the problem is here)

Then as I clicked OK another error appears, then another, then another, etc.
All are the same except the number by Line changes (210, 226, 242, 259 in
one series.  Slightly different numbers the next time the problem is
opened).  I'm using Java 1.5.

Interestingly the IE on my desktop loads the page, also without the figures,
but gives no error popups.

Robley

PS  Do I interpret your source code correctly in that in the jmol.js the
applet is loaded with:

<script type="text/javascript">
          jmolSetAppletColor("skyblue");
          jmolApplet(400, "load molfiles/butane_anti.mol;");
</script>

Whereas in the other there is an opening and closing applet code with a
bunch of 

<param value ="" name="" /> tags, including load, progressbar,
progresscolor, boxmessage, etc?

What is the advantage of the javascript method, other than the code being
shorter?

*************************************************************
Robley J. Light                         Professor Emeritus, Chemistry and
Biochemistry
Department of Chemistry          		Phone:   (850) 644-3844 
   and Biochemistry                   	Email:  [email-masked]   
Florida State University             	Fax:      (850) 644-8281
Tallahassee, FL 32306-4390    Home Page:
http://www.chem.fsu.edu/editors/rlight    

> -----Original Message-----
> From: [email-masked] 
> [mailto:[email-masked]] On Behalf Of Jim Maxka
> Sent: Wednesday, May 25, 2005 5:13 PM
> To: [email-masked]
> Subject: Re: [LON-CAPA-dev] Re: [LON-CAPA-users] Mac and JME
> 
> Yeah Guy -- I am not sure how apple implements the 
> LiveConnect.  I have previous jme problems that I tested 
> today and get the same kind of behavior, but I don't have a 
> mac and my student assistant doesn't know how to debug either 
> the java or the javascript.  So, I have no idea how to fix it 
> right now.
>

---

From: Jim Maxka <[email-masked]>
Date: Thu, 26 May 2005 12:41:30 -0700

Hi Robley -- many of my problems use jmol.js.  This has to be installed 
on your server.  I refer to
http://jmol.sourceforge.net/jslibrary/#Why%20should%20you%20use%20Jmol.js?
I have a modified version of the supplied jmol.js.  The main change is 
to comment out a check for already loaded jmol apps that occurs onLoad, 
which gave javascript errors in LonCapa version last fall.

So you need a copy?  --jim
rlight wrote:

>>>succesfully had Javascript do something or get some info 
>>>      
>>>
>>from the Jmol 
>>    
>>
>>>applet?
>>>
>>> 
>>>
>>>      
>>>

---

From: Jim Maxka <[email-masked]>
Date: Thu, 26 May 2005 13:27:23 -0700

Hi Guy -- Had to skip this one yesterday.  I know you are near the code 
lockdown.  We need to do some things with the <organicresponse>
Where is the best way to do this discussion.  On htis list or as a bug.
(1) organicresponse now requires answers in jme strings.  This is new 
and most of my questions still do not have answers.  Do we want to 
require that the question has answers before publishing.  If so, I am 
screwed.
To undo your change, I check to see if there is an answer.  If not, I 
give a screen that says that you have to use the jme editor to see your 
last answer. The easiest way to fix this is to use a system that writes 
structures from smiles strings.  I have a lot of candidates for this, 
but I am not totally convinced of the best way to go.
(2)  There should be the same type of graphical analysis for the pgrade 
submissions.  Not many of the future users are going to be able to read 
smiles and they will not know what the hell the students are saying. We 
are going to have to do something here to adopt users.
(3) When there is more than one <organicresponse> on a page, the 
students complain that weird things happen.  I told you a year ago that 
their previous answers sometimes don't show up.  It is this case and 
when the system is overloaded, the previous answer string does not pass 
properly.
(4)  Students have asked for a button that lets them reload a previous 
answer.  The molecular editor is more tedious than other answer entries 
and is an issue. Scenario goes like this:  They have something close but 
not exact.  They go way off on the next try and then want to recover the 
previous structure, but have to start from scratch.
(5)  Here is a tough one.  Students complain that if they don't click 
submit, their answer disappears when they log out or their browser 
closes, because it is not written to LonCapa -- just a text field in the 
form.  This is really about having more than one <organicresponse> in 
the <problem>.  They solve one, but can't tell how to do the next one 
and don't want to submit, but then lose the first one.  I have looked at 
this, but it requires a whole new stored entry.
(6)  There is the functional group template function. The one you refer 
to as 

In the second course, the students really like it.
It works with windows, I don't know other OS.  We looked at it with Mac 
yesterday, but I didn't test whether it inserts.  It is not needed.  
Just a shortcut.

Please refer me to the most resonable process for these points.  --jim

---

From: "rlight" <[email-masked]>
Date: Thu, 26 May 2005 17:12:09 -0400

Jim,

I don't know where we stand on this.  Hon Kie installed jmol, but I'm not
sure about jmol.js.  I'm copying this to him to let him tell you what we
have, and maybe you can explain to him what goes where and what gets
changed.  I just haven't taken the time yet to digest the stuff on the
jmol.js page.  

But is it the javascript that is mucking up the MAC's?

I presume this will not break the problems I've already written with the
applet code.

Robley

> Sent: Thursday, May 26, 2005 3:42 PM
> Hi Robley -- many of my problems use jmol.js.  This has to be 
> installed on your server.  I refer to 
> I have a modified version of the supplied jmol.js.  The main 
> change is to comment out a check for already loaded jmol apps 
> that occurs onLoad, which gave javascript errors in LonCapa 
> version last fall.
> 
> >either IE or firefox on a windows XP machine.  The IE on my 
> laptop pops 
> >up a window reporting some errors as the page loaded:
> >
> >Line: 187
> >Char: 13
> >Error:  Object expected
> >Code: 0
> >All are the same except the number by Line changes (210, 
> 226, 242, 259 
> >in one series.  Slightly different numbers the next time the 
> problem is 
> >Interestingly the IE on my desktop loads the page, also without the 
> >figures, but gives no error popups.
> >
> >Robley
> >
> >PS  Do I interpret your source code correctly in that in the jmol.js 
> >the applet is loaded with:
> >
> >What is the advantage of the javascript method, other than the code 
> >being shorter?
> >
> >
> >
> >>Yeah Guy -- I am not sure how apple implements the LiveConnect.  I 
> >>have previous jme problems that I tested today and get the 
> same kind 
> >>of behavior, but I don't have a mac and my student 
> assistant doesn't 
> >>know how to debug either the java or the javascript.  So, I have no 
> >>idea how to fix it right now.
> >>

---

From: Guy Albertelli II <[email-masked]>
Date: Thu, 26 May 2005 17:28:36 -0400 (EDT)

Hi Jim,

> require that the question has answers before publishing.  If so, I am 

Okay done:
http://mail.lon-capa.org/pipermail/lon-capa-cvs/Week-of-Mon-20050523/010319.html

If jmeanswer is unspcified the 'Draw Molecule' button is replaced wiht
a 'Show Your Last Molecule' button.

> are going to have to do something here to adopt users.

Okay done:
http://mail.lon-capa.org/pipermail/lon-capa-cvs/Week-of-Mon-20050523/010321.html

> when the system is overloaded, the previous answer string does not pass 

As the bug report for this says:
http://bugs.loncapa.org/show_bug.cgi?id=3292

I need you to provide me with mroe info to figure out what is up

> previous structure, but have to start from scratch.

Would be nice. Please file it as a bug report.

> this, but it requires a whole new stored entry.

Essayresponse has the idea of a 'Draft' submission perhaps we could
use the same thing here...

File as a seperate bug report.

(BTW are you often doing multiple <organicresponse> in a single <part> ?)

> yesterday, but I didn't test whether it inserts.  It is not needed.  

http://bugs.loncapa.org/show_bug.cgi?id=3957

Please read my comment on that bug and preform the required actions
and I will commit it for 2.0.

---

From: Guy Albertelli II <[email-masked]>
Date: Thu, 26 May 2005 17:33:47 -0400 (EDT)

Hi Robley,

> But is it the javascript that is mucking up the MAC's?

It is trying to get Javascript talking to Java and vice versa that
isn't working well. And yes this screws up jmol.js

> I presume this will not break the problems I've already written with the

Correct.