version 1.3, 2002/05/03 18:34:20
|
version 1.7, 2002/10/21 20:31:06
|
Line 23
|
Line 23
|
<i>$Apache::lonxml::debug</i> - debugging control |
<i>$Apache::lonxml::debug</i> - debugging control |
</li> |
</li> |
<li> |
<li> |
<i>@Apache::lonxml::pwd</i> - path to the directory containing the file currently being processed |
<i>@Apache::lonxml::pwd</i> - path to the directory containing |
|
the file currently being processed |
</li> |
</li> |
<li> |
<li> |
<i>@Apache::lonxml::outputstack</i> <br /> |
<i>@Apache::lonxml::outputstack</i> <br /> |
Line 41
|
Line 42
|
(images, and links) |
(images, and links) |
</li> |
</li> |
<li> |
<li> |
<i>#Apache::lonxml::metamode</i> - some output is turned off, |
<i>$Apache::lonxml::metamode</i> - some output is turned off, |
the meta target wants a specific subset, use <output> to |
the meta target wants a specific subset, use <output> to |
guarentee that the catianed data will be in the parsing output |
guarentee that the catianed data will be in the parsing output |
</li> |
</li> |
<li> |
<li> |
<i>#Apache::lonxml::evaluate</i> - controls whether |
<i>$Apache::lonxml::evaluate</i> - controls whether |
run::evaluate actually derefences variable references |
run::evaluate actually derefences variable references |
</li> |
</li> |
<li> |
<li> |
Line 62
|
Line 63
|
<i>$Apache::lonxml::registered</i> - set to 1 once the remote |
<i>$Apache::lonxml::registered</i> - set to 1 once the remote |
has been updated to know what resource we are looking at. |
has been updated to know what resource we are looking at. |
</li> |
</li> |
|
<li> |
|
<i>$Apache::lonxml::request</i> - current Apache request |
|
object, or undef |
|
</li> |
|
<li> |
|
<i>$Apache::lonxml::curdepth</i> - current depth of the |
|
overall parse depth. Will be a string like: 2_3_1 (first tag |
|
in the third second level tag in the second toplevel tag). It |
|
gets set by callsub, and can be used in Perl tag |
|
implementations. It relies upon the internal globals: |
|
<i>@Apache::lonxml::depthcounter</i>, |
|
<i>$Apache::lonxml::depth</i>, |
|
<i>$Apache::lonxml::olddepth</i> |
|
</li> |
|
<li> |
|
<i>$Apache::lonxml::prevent_entity_encode</i> - By default the |
|
xmlparser will try to rencode any 8-bit characters into HTML |
|
Entity Codes, If this is set to a true value it will be |
|
prevented. |
|
</li> |
|
<li> |
|
<i>$Apache::lonxml::errorcount</i> - keeps count of the number |
|
of errors generated in a parse |
|
</li> |
|
<li> |
|
<i>$Apache::lonxml::warningcount</i> - keeps count of the |
|
number of errors generated in a parse |
|
</li> |
|
<li> |
|
<i>$Apache::lonxml::counter</i> <br /> |
|
<i>$Apache::lonxml::counter_changed</i> - a counter used to |
|
keep track of the number of questions asked, used currently to |
|
track bubble numbers, Initialized off of $ENV{'form.counter'}, |
|
and writes this value to the environment if counter_changed is |
|
true, should use the &increment_counter() function to |
|
increment this value. |
|
</li> |
|
<li> |
|
<i>$Apache::lonxml::default_homework_loaded</i> - a boolean on |
|
wherethe the default_homework.lcpm file has been loaded into |
|
the Safe Space, the function |
|
&Apache::lonxml::default_homework_load() |
|
</li> |
</ul> |
</ul> |
|
|
|
<p> |
|
In common usage, <i>$Apache::lonxml::prevent_entity_encode</i>, |
|
<i>$Apache::lonxml::evaluate</i>, |
|
<i>$Apache::lonxml::metamode</i>, |
|
<i>$Apache::lonxml::import</i>, should never be set to a value |
|
directly, but rather incremented when you want the effect on, |
|
and decremented when you want the effect off. |
|
</p> |
|
|
<h3>Notable Perl subroutines</h3> |
<h3>Notable Perl subroutines</h3> |
<p> |
<p> |
If not specified these functions are in Apache::lonxml |
If not specified these functions are in Apache::lonxml |
</p> |
</p> |
<ul> |
<ul> |
<li> |
<li> |
<i>xmlparse</i> - see the XMLPARSE figure |
<i>xmlparse</i> - see the XMLPARSE figure - also not callable |
|
from inside a tag, if one needs to restart parsing, either |
|
create add a new LCParser to the parser stack parser using the |
|
newparser function, or call inner_xmlparser, see the xmlparse |
|
function in scripttag.pm |
</li> |
</li> |
<li> |
<li> |
<i>recurse</i> - acts just like <i>xmlparse</i>, except it |
<i>recurse</i> - acts just like <i>xmlparse</i>, except it |
Line 101
|
Line 158
|
for this setup. Uses form.grade_ parameters, if the user is |
for this setup. Uses form.grade_ parameters, if the user is |
allowed to mgr in the course |
allowed to mgr in the course |
</li> |
</li> |
|
<li> |
|
<i>setup_globals</i> - initializes all lonxml globals when |
|
xmlparse is called. If you intend to create a new target you |
|
will likely need to tweak how the globals are setup upon start |
|
up. |
|
</li> |
|
<li> |
|
<i>init_safespace</i> - creates Holes to external functions, |
|
creates some global variables, and set the permitted operators |
|
of the global Safespace intepreter. |
|
</li> |
</ul> |
</ul> |
<h3>Functions Tag Handlers can use</h3> |
<h3>Functions Tag Handlers can use</h3> |
<p> |
<p> |
Line 133
|
Line 201
|
Apache::scripttag::start_script for an example of usage.) |
Apache::scripttag::start_script for an example of usage.) |
</li> |
</li> |
<li> |
<li> |
<i>get_param</i> - 4 arguments, firsth is a scaler sting of |
<i>get_param</i> - 4 arguments, first is a scaler sting of |
|
the argument needed, second is a reference to the parser |
|
arguments stack, third is a reference to the Safe space, and |
|
fourth is an optional "context" value. This subroutine allows |
|
a tag to get a tag argument, after being interpolated inside |
|
the Safe space. This should be used if the tag might use a |
|
safe space variable reference for the tag argument. (See |
|
Apache::scripttag::start_script for an example.) |
|
|
|
This version only handles scalar variables. |
|
</li> |
|
<li> |
|
<i>get_param_var</i> - 4 arguments, first is a scaler sting of |
the argument needed, second is a reference to the parser |
the argument needed, second is a reference to the parser |
arguments stack, third is a reference to the Safe space, and |
arguments stack, third is a reference to the Safe space, and |
fourth is an optional "context" value. This subroutine allows |
fourth is an optional "context" value. This subroutine allows |
a tag to get a tag argument, after being interpolated inside |
a tag to get a tag argument, after being interpolated inside |
the Safe space. This should be used if the tag might use a |
the Safe space. This should be used if the tag might use a |
safe space variable reference for the tag argument. (See |
safe space variable reference for the tag argument. (See |
Apaceh::scripttag::start_script for an example.) |
Apache::scripttag::start_script for an example.) |
|
|
|
This version can handle list or hash variables properly. |
|
</li> |
|
<li> |
|
<i>description</i> - 1 argument, the token object. This will |
|
return the textual decription of the current tag from the |
|
insertlist.tab file. |
|
</li> |
|
<li> |
|
<i>whichuser</i> - 0 arguments. This will take a look at the |
|
current environment setting and return the current $symb, |
|
$courseid, $udom, $uname. You should always use this function |
|
if you want to determine who the current user is. (Since a |
|
instructor might be trying to view a students version of a |
|
resource.) |
|
</li> |
|
<li> |
|
<i>inner_xmlparse</i> - 6 arguments, the target, an array |
|
pointer to the current stack of tags, and array pointer to the |
|
current stack of tag arguments, an array pointer to the |
|
current stack of LCParser's, a pointer to the current Safe |
|
space, a pointer to the hash of current style definitions |
</li> |
</li> |
<li> |
<li> |
<i>newparser</i> - 3 args, first is a reference to the parser |
<i>newparser</i> - 3 args, first is a reference to the parser |
Line 161 sub BEGIN {
|
Line 263 sub BEGIN {
|
} |
} |
</pre> |
</pre> |
Would tell xmlparse that in Apache::scripttag it can find |
Would tell xmlparse that in Apache::scripttag it can find |
handlers for <script> and <display> |
handlers for <script> and <display>, if one |
|
regsiters a tag that was already registered the previous one |
|
is remembered and will be restored on a deregister. |
|
</li> |
|
<li> |
|
<i>deregister</i> - used to remove a previously registered tag |
|
implementation. It will restore the previous registration if |
|
there was one. |
</li> |
</li> |
<li> |
<li> |
<i>startredirection</i> - used when a tag wants to save a |
<i>startredirection</i> - used when a tag wants to save a |
Line 180 sub BEGIN {
|
Line 289 sub BEGIN {
|
a reference to the Safe space, 3 a string to be evaluated |
a reference to the Safe space, 3 a string to be evaluated |
before the first arg. This subroutine will do variable |
before the first arg. This subroutine will do variable |
interpolation and simple function interpolations on the first |
interpolation and simple function interpolations on the first |
argument. (See Apache::lonxml::xmlparse for an example.) |
argument. (See Apache::lonxml::inner_xmlparse for an example.) |
</li> |
</li> |
<li> |
<li> |
<i>Apache::run::run</i> - 2 args, first a string, second a |
<i>Apache::run::run</i> - 2 args, first a string, second a |
Line 216 sub BEGIN {
|
Line 325 sub BEGIN {
|
<address><a href="mailto:albertel@marvin.lite.msu.edu">Guy Albertelli</a></address> |
<address><a href="mailto:albertel@marvin.lite.msu.edu">Guy Albertelli</a></address> |
<!-- Created: Sun May 20 15:47:08 EDT 2001 --> |
<!-- Created: Sun May 20 15:47:08 EDT 2001 --> |
<!-- hhmts start --> |
<!-- hhmts start --> |
Last modified: Fri May 3 14:26:22 EDT 2002 |
Last modified: Mon Oct 21 16:41:56 EDT 2002 |
<!-- hhmts end --> |
<!-- hhmts end --> |
</body> |
</body> |
</html> |
</html> |