WeBWorK Main Forum

htmlLink(s), hints and solutions

htmlLink(s), hints and solutions

by Zak Zarychta -
Number of replies: 2
Is it possible to include htmlLinks in hints and solutions? I've tried this without success with the following:

Context()->normalStrings;
SOLUTION(EV3(<<'END_SOLUTION'));
$BR SOLUTION:$BR
Take a look at this image of the Lennard-Jones potential
\{htmlLink("http://commons.wikimedia.org/wiki/File:12-6-Lennard-Jones-Potential.png","Lennard-Jones_Potential")\}
END_SOLUTION
Context()->normalStrings;

the following warning are given
  • ERROR in old_safe_ev, PGbasicmacros.pl:
  • ## There is an error occuring inside evaluation brackets \{ ...code... \}
  • ## somewhere in an EV2 or EV3 or BEGIN_TEXT block.
  • ## Code evaluated:
  • ## htmlLink(http://commons.wikimedia.org/wiki/File:12-6-Lennard-Jones-Potential.png,"Lennard-Jones Potential")
  • ##syntax error at line 2 of (eval 60002), near "http:"
  • ##
  • at (eval 544) line 1453
Any help is greatly appreciated,
Zak

In reply to Zak Zarychta

Re: htmlLink(s), hints and solutions

by Michael Gage -
The short answer is yes.

Your code above works fine for me. You can also start the section
with

BEGIN_SOLUTION

if you prefer -- which is clearer and more foolproof than
TEXT(EV3.....). It is translated to the code you have entered above.

It looks like the contents of the "http://...." quote is being evaluated before the contents of the \{ ..... \} clause. I've tried a couple of variants but haven't been able to reproduce the error you describe above.

If you can reproduce this error, let us know what system (flavor of linux) you are running under.

Take care,
Mike
In reply to Michael Gage

Re: htmlLink(s), hints and solutions

by Zak Zarychta -
I've tried some variants like declaring the url in a variable and various combinations of escaping double quotes and the like. All to no avail.

I am reliably informed that is running under Scientific Linux 5 which is a CentOS 5 variant. Could this really be a problem ?