Difference between revisions of "Knowls"

From WeBWorK_wiki
Jump to navigation Jump to search
Line 57: Line 57:
 
</td>
 
</td>
 
<td style="background-color:#ffcccc;padding:7px;">
 
<td style="background-color:#ffcccc;padding:7px;">
As another example here is the last line of the definition of helpLink() where the knowl
+
As another example, here is the last line of the definition of helpLink() where the knowl
 
containing the help message is created after defining the variables which contain the url for the help file.
 
containing the help message is created after defining the variables which contain the url for the help file.
   

Revision as of 18:09, 3 June 2014

Knowls


This code fragment shows how to apply a javascript-enabled popup bit of knowledge (a knowl).

Problem Techniques Index

PG problem file Explanation

$PAR
Here is a knowl
\{ knowlLink("click me", value=>'This is the inside of a knowl.  If you click again, I will go away') \}
$PAR

$PAR
Here is another knowl
\{ knowlLink("click me", url=>'url_of_file_with_information') \}
$PAR

Instead of specifying a value, you can specify the url of a file with html in it, and that html will appear in the knowl. Then you can use one file in multiple places.

return knowlLink($display_text, url=>$envir{'localHelpURL'}.$infoRef);

As another example, here is the last line of the definition of helpLink() where the knowl containing the help message is created after defining the variables which contain the url for the help file.

Templates by Subject Area


Problem Techniques Index