User 870ab5b546
03-09-2006 19:58:06
Hi,
We use the following lines in a JSP page:
This code generates HTML that looks like this:
Which in turn ends up looking like this:
Points: 1.0
(1 \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n')" title="View most recent answer">attempt)
Rather than
Points: 1.0
(1 attempt)
The code works fine when userresult[k-1].lastResponse is in MOL format.
Any ideas?
-- Bob
We use the following lines in a JSP page:
Code: |
String lastAnswer = ChemUtils.toAppletParam(userresult[k-1].lastResponse) + ""; s = "Points: <span style=\"font-weight:bold; color:" + statColor + ";\">" + numPts + "</span><br>" + "(" + numAtts + " <a href=\"javascript:showMol('" + lastAnswer + "')\" title=\"View most recent answer\">" + attsStr + "</a>)"; |
This code generates HTML that looks like this:
Code: |
Points: <span style="font-weight:bold; color:#000000;">1.0</span><br>(1 <a href="javascript:showMol('<?xml version=\"1.0\" ?>\n<MDocument>\n <MChemicalStruct>\n <molecule molID=\"m1\">\n <atomArray\n atomID=\"a1 a2 a3 a4 a5 a6\"\n elementType=\"C Br N N C Br\"\n formalCharge=\"0 0 0 1 0 -1\"\n x2=\"-4.550000190734863 -3.0100001907348632 -8.341666221618652 2.799999952316284 4.339999952316284 7.699999809265137\"\n y2=\"0.23333333432674408 0.23333333432674408 0.2916666567325592 0.2916666567325592 0.2916666567325592 0.3499999940395355\"\n />\n <bondArray>\n <bond atomRefs2=\"a1 a2\" order=\"1\" />\n <bond atomRefs2=\"a4 a5\" order=\"1\" />\n </bondArray>\n </molecule>\n </MChemicalStruct>\n <MRectangle id=\"o2\" color=\"#000000\">\n <MPoint x=\"-9.391666412353516\" y=\"1.5166666507720947\" />\n <MPoint x=\"-2.0416667461395264\" y=\"1.5166666507720947\" />\n <MPoint x=\"-2.0416667461395264\" y=\"-1.1666666269302368\" />\n <MPoint x=\"-9.391666412353516\" y=\"-1.1666666269302368\" />\n </MRectangle>\n <MRectangle id=\"o3\" color=\"#000000\">\n <MPoint x=\"1.0500000715255737\" y=\"1.5166666358709335\" />\n <MPoint x=\"8.399999737739563\" y=\"1.5166666358709335\" />\n <MPoint x=\"8.399999737739563\" y=\"-1.166666641831398\" />\n <MPoint x=\"1.0500000715255737\" y=\"-1.166666641831398\" />\n </MRectangle>\n <MPolyline id=\"o4\" color=\"#000000\" headLength=\"0.8\" headWidth=\"0.5\">\n <MRectanglePoint pos=\"5\" rectRef=\"o2\" />\n <MRectanglePoint pos=\"7\" rectRef=\"o3\" />\n </MPolyline>\n <MEFlow id=\"o5\" color=\"#000000\" arcAngle=\"150.0\" headSkip=\"0.15\"\n headLength=\"0.5\" headWidth=\"0.4\" tailSkip=\"0.25\">\n <MAtomSetPoint atomRefs=\"m1.a3\" />\n <MAtomSetPoint atomRefs=\"m1.a3 m1.a1\" weights=\"0.25 0.75\" />\n </MEFlow>\n <MEFlow id=\"o6\" color=\"#000000\" arcAngle=\"-254.995522631729\"\n headSkip=\"0.25\" headLength=\"0.5\" headWidth=\"0.4\" tailSkip=\"0.15\">\n <MAtomSetPoint atomRefs=\"m1.a1 m1.a2\" />\n <MAtomSetPoint atomRefs=\"m1.a2\" />\n </MEFlow>\n</MDocument>\n')" title="View most recent answer">attempt</a>) |
Which in turn ends up looking like this:
Points: 1.0
(1 \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n')" title="View most recent answer">attempt)
Rather than
Points: 1.0
(1 attempt)
The code works fine when userresult[k-1].lastResponse is in MOL format.
Any ideas?
-- Bob