Knowls

This shows how to use intervals in a problem.

Complete Code

Download file: Knowls.pg

PG problem file

Explanation

DOCUMENT();
loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl');

Preamble

These standard macros need to be loaded.
BEGIN_PGML
Here is a knowl
[@ knowlLink("click me", value =>
  'This is the inside of a knowl.  If you click again, I will go away') @]*

Here is another knowl
[@ knowlLink("click me",
  url=>'https://openwebwork.org') @]*


[@ knowlLink("a math knowl",
value=>escapeSolutionHTML(EV3P("the sine function is \\(\\frac{2}{3}\\)")), base64=>1);
@]*
END_PGML

ENDDOCUMENT();

Statement

Knowls appear in the text section of the problem file. You can specify a value, as in the first example, which gives the text to appear in the Knowl, or the URL of a file with the HTML content for the knowl, as shown in the second example here.

To include math text in the knowl, it is necessary to pipe the text through EV3P and escapeSolution HTML, as shown in the third example.