+ -
<display> the intervening perl script is
evaluated in the safe space and the return value of the
script replaces the entire tag
@@ -253,7 +459,9 @@
-
<randomlist> the enclosed tags are parsed in
- a stable random order
+ a stable random order, optional argument show
+ restricts the number of tags indie that are actually
+ parsed the no more than show.
-
<solved> everything inside the tag is
@@ -330,7 +538,7 @@
- open_date(), due_date(), answer_date()
- sub_string()
- array_moments(array)
- - format(x,y)
+ - format(x,y),prettyprint(x,y)
- map(...)
- caparesponse_check
- caparesponse_check_list
@@ -351,14 +559,6 @@
Differences (if any)
- |
- sin(x), cos(x), tan(x) |
- &sin($x), &cos($x), &tan($x) |
- Trigonometric functions where x is in radians. $x
- can be a pure number, i.e., you can call &sin(3.1415) |
-   |
-
-
sin(x), cos(x), tan(x) |
&sin($x), &cos($x), &tan($x) |
@@ -458,6 +658,20 @@
+ /DIS($x,"nn") |
+ &format($x,"nn") |
+ Display or format $x as nn where nn is nF or nE and n is an integer. |
+ The difference is obvious. |
+
+
+
+ Not in CAPA |
+ &prettyprint($x,"nn") |
+ Display or format $x as nn where nn is nF or nE and n is an integer. In E mode it will attempt to generate a pretty x10^3 rather than a E3 following the number |
+ |
+
+
+
roundto(x,n) |
&roundto($x,$n) |
Rounds a real number to n decimal points. $x and
@@ -523,6 +737,64 @@
|
+ /MAP(seed;w,x,y,z;a,b,c,d) |
+ Option 1 - &map($seed,[\$w,\$x,\$y,\$z],[$a,$b,$c,$d]) or
+ Option 2 - &map($seed,\@mappedArray,[$a,$b,$c,$d])
+ Option 3 - @mappedArray = &map($seed,[$a,$b,$c,$d])
+ Option 4 - ($w,$x,$y,$z) = &map($seed,\@a)
+ where $a='A'
+ $b='B'
+ $c='B'
+ $d='B'
+ $w, $x, $y, and $z are variables |
+ Assigns to the variables $w, $x, $y and $z the values of the
+ $a, $b, $c and $c (A, B, C and D). The precise value for $w .. depends
+ on the seed. (Option 1 of calling map).
+ In option 2, the values of $a, $b .. are mapped into the array, @mappedArray. The two
+ options illustrate the different grouping. Options 3 and 4 give a consistent
+ way (with other functions) of mapping the items. For each option, the group can
+ be passed as an array, for example, [$a,$b,$c,$d] => \@a. |
+ In CAPA, the arguments are divided into three groups separated
+ by a semicolon ;. In LON-CAPA, the separation is done by using [] brackets or
+ using an array @a. Note the backslash (\) before the arguments in the
+ second and third groups. |
+
+
+
+
+ rmap(seed;a,b,c,d;w,x,y,z) |
+ Option 1 - &rmap($seed,[\$w,\$x,\$y,\$z],[$a,$b,$c,$d]) or
+ Option 2 - &rmap($seed,\@rmappedArray,[$a,$b,$c,$d])
+ Option 3 - @rmapped_array = &rmap($seed,[$a,$b,$c,$d])
+ Option 4 - ($w,$x,$y,$z) = &rmap($seed,\@a)
+ where $a='A'
+ $b='B'
+ $c='B'
+ $d='B'
+ $w, $x, $y, and $z are variables |
+ The rmap functions does the reverse action of map if the same seed
+ is used in calling map and rmap. |
+ In CAPA, the arguments are divided into
+ three groups separated by a semicolon ;. In LON-CAPA, the
+ separation is done by using [] brackets (with create an
+ unamed vector reference) or using an array @a. Note the
+ backslash (\) before the arguments in the second and
+ third groups (Which cause Perl to send to variable
+ locations rather than the variable values, similar to a C
+ pointer). |
+
+
+
+ NOT IMPLEMENTED IN CAPA |
+ $a=&xmlparse($string) |
+ Runs the internal parser over the
+ argument parsing for display. Warning This will
+ result in different strings in different targets. Don't use
+ the results of this function as an answer. |
+ New to LON-CAPA |
+
+
+
tex(a,b), tex("a","b") |
&tex($a,$b), &tex("a","b") |
Returns a if the output mode is in tex otherwise
@@ -713,13 +985,13 @@
| New to LON-CAPA |
- NOT IMPLEMENTED IN CAPA |
- @return_array=&random_multivariate_normal ($item_cnt,$seed,@mean,@covar)
- NOTE: @mean should be a length p array of real numbers. @covar should be a length
- p array of references to length p arrays or real numbers (i.e. a p by p matrix. |
+ NOT DOCUMENTED IN CAPA |
+ @return_array=&random_multivariate_normal ($item_cnt,$seed,\@mean,\@covar)
+ NOTE: @mean should be of length p array of real numbers. @covar should be a length
+ p array of references to length p arrays of real numbers (i.e. a p by p matrix. |
Generate $item_cnt deviates of multivariate_normal distribution with
mean vector @mean and variance-covariance matrix. |
- New to LON-CAPA |
+ Note the backslash before the @mean and @covar arrays. |
NOT IMPLEMENTED IN CAPA |
@@ -785,7 +1057,7 @@
-
$external::part - set to the id of the current problem
- <part>; zero if there are now <part>
+ <part>; zero if there are no <part>
-
$external::gradestatus - set to the value of the current
@@ -793,7 +1065,7 @@
-
$external::datestatus - set to the current status of the clock
- either CLOSED, CAN_ANSWER, CANNOT_ANSWER, or SHOW_ANSWER
+ either CLOSED, CAN_ANSWER, CANNOT_ANSWER, SHOW_ANSWER, or UNCHECKEDOUT
-
$external::randomseed - set to the number that was used to
@@ -803,12 +1075,74 @@
- $rad2deg - converts radians to degrees
- $deg2rad - converts degrees to radians
-
+
+ Form internals
+ Form elements used for homework editing/response
+ the form is named lonhomework
+ Viewing a problem (either CSTR or RES space)
+
+ -
+ grade_target, grade_username, grade_domain, grade_symb - the
+ vaules take precedence over the the normal ENV settings of
+ these, use &Apache::lonxml::whichuser() to get back the
+ correct vaues of the items
+
+ -
+ HWVAL_response:number - the name of the input elements for each response. The response is the response's ID, and the :number part exists only for response with multiple foils, and is a unique number in order of the submission
+
+ -
+ changerandseed - the 'Change' button, only exists right after
+ the Change button is clicked
+
+ -
+ problemmode - in CSTR, it is either 'View','Edit','EditXML' or
+ 'Analyze' depending on the desired view
+
+ -
+ rndseed - the currently requested random seed
+
+ -
+ showallfoils - if it exists, and we are in CSTR space, the
+ problem should ignore <conceptgroup> and the response's
+ max setting and show all possible foils
+
+ -
+ submit - the name of the Submit button
+
+ -
+ submitted - a hidden form parameter that can be used to tell
+ if the student has submitted answers or not, if it is set,
+ there should be answers to grade.
+
+
+ Editing a problem (Edit mode)
+ tagdepth referes to the current value of the xmlparsers tagdepth couter ($Apache::lonxml::currentdepth)
+ Note: the file edit.pm has many helper functions for creating the standard elements for editing a tag and it's attributes, all of those functions follow these conventions
+
+ -
+ tagdepth_argname - I.E. 1_3.max, a parameter editing value,
+ max is the name of the parameter and it is for the third tag
+ inside the first tag
+
+ -
+ delete_tagdepth - if set to yes, delete tag tagdepth and all
+ tags inside of it
+
+ -
+ homework_edit_tagdepth - used by both &Apache::edit::editline
+ and &Apache::edit::editfield for the <textarea> and
+ <input> form elements they create
+
+ -
+ insert_tagdepth - used to request an tag insert, it is set to
+ the id number of the requested tag in the
+ %Apache::lonxml::insertlist
+
Guy Albertelli
-Last modified: Tue June 12 15:25 EDT 2001
+Last modified: Thu Jun 6 03:15:56 EDT 2002