WebWork Text Display Languages
-
Original way using
TEXT(EV3())
Example:
Remark:
-
In the example two
pg
macros were usedTEXT()
andEV3()
. Both macros are defined inPGbasicmacros.pl
. (See the document on text macros) for more information) -
The expression
<<'END_TEXT'
is a string holder which holds strings end up to the indicatorEND_TEXT
. The ending indicator has to be adjusted to the left. -
The single quotes about a
END_TEXT
indicates that no interpolation takes place. Using double quotes or no quotes allows interpolation. (See Basic Perl syntax for more information.)
-
-
A more commonly seen method uses
BEGIN_TEXT/END_TEXT
which will be translated into the construction in the above example byPGtranslator.pm
.Example:
-
Supported by
PGML.pl
, the usageBEGIN\_PGML/END\_PGML
provides a markdown alike formats for text. (For more information see Introduction to PGML.)Example:
Hyperlinks
It should be helpful to insert video link or example to WebWork Questions. There are several formating macros in PGbasicmacros.pl
that can do the job
One basic macro is
Examples:
-
Link to a local file example.pdf. Upload the local file example.pdf to the same folder as where the question pg file is. The option
TARGET=’\_blank’
tells the function to open the file in a new windows. -
Link to a webpage address which contains no special characters.
-
Link to a webpage using javascript.
First include the following customized function in the header (before BEGIN_TEXT after
loadMacros()
).Then we call the function by
An alternative solution is to move
var url = "http://webwork.maa.org/";
from the definition ofwindowpopup()
tohtmlLink()
For more details, please check the MAA webpage on htmlLink.
Remark:
-
It depends on which language you use to display text, the function should be placed in different environment.
-
In
BEGIN\_TEXT … END\_TEXT
, the function should be placed as
There must be a blank space after
\{
or\}
.-
In
BEGIN\_PGML … END\_PGML
, the function should be placed as
Here
[@ command @]*
tells the system to not escape HTML special characters. -
-
Use
[| protect_underbar() |]
whenever underscore appears in a string outside of math mode. (See )Example: