--- loncom/html/adm/help/tex/all_functions_table.tex 2004/10/18 18:44:12 1.4
+++ loncom/html/adm/help/tex/all_functions_table.tex 2020/05/27 19:46:44 1.19
@@ -34,14 +34,30 @@ sinh(x), cosh(x), tanh(x) &\&sinh(\$x),
\hline
asinh(x), acosh(x), atanh(x) &\&asinh(\$x), \&acosh(\$x), \&atanh(\$x) &Inverse hyperbolic functions. \$x can be a pure number & \\
\hline
-/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. \\
- \hline
-Not in CAPA &\&prettyprint(\$x,'nn','optional target') &Display or format \$x as nn where nn is nF or nE and n is an integer. Also supports the first character being a \$, it then will format the result with a a call to \&dollarformat() described below. If the first character is a , it will format it wiht commas grouping the thousands. In E mode it will attempt to generate a pretty x10\^{}3 rather than a E3 following the number, the 'optional target' argument is optional but can be used to force \&prettyprint to generate either 'tex' output, or 'web' output, most people do not need to specify this argument and can leave it blank. & \\
+/DIS(\$x,''nn'') &\&format(\$x,'nn') &Display or format \$x as nn where nn is nF or nE or nS and n is an integer. & The difference is obvious. \\
+ \hline
+Not in CAPA &\$expr=\&math\_calculus\_expression() & Creates Math::Calculus::Expression object. Methods are: \$expr->addVariable('x'), \$expr->setExpression('f(x)'), \$expr->simplify, \$expr->getExpression -- see Math::Calculus::Expression documentation at cpan.org for details. & \\
+ \hline
+Not in CAPA &(\$a,\$u)=\&conv\_eng\_format(\$x,\$b) & Converts numerical value \$x and base unit \$b to answer \$a and corresponding unit \$u in engineering format, i.e., the answer is scaled by powers of ten, and an appropriate prefix from: m u n p f a z y k M G T P E Z Y precedes the base unit. Called in a script block to generate variables to assign to answer and unit attributes of numericalresponse tag. & \\
+ \hline
+Not in CAPA &\&prettyprint(\$x,'nn','optional target') &Display or format \$x as nn where nn is nF or nE or nS and n is an integer. Also supports the first character being a \$, it then will format the result with a a call to \&dollarformat() described below. If the first character is a , it will format it with commas grouping the thousands. In S mode it will fromat the number to the specified number of significant figures and display it in F mode. In E mode it will attempt to generate a pretty x10\^{}3 rather than a E3 following the number, the 'optional target' argument is optional but can be used to force \&prettyprint to generate either 'tex' output, or 'web' output, most people do not need to specify this argument and can leave it blank. & \\
\hline
Not in CAPA &\&dollarformat(\$x,'optional target') &Reformats \$x to have a \$ (or $\backslash$\$ if in tex mode) and to have , grouping thousands. The 'optional target' argument is optional but can be used to force \&prettyprint to generate either 'tex' output, or 'web' output, most people do not need to specify this argument and can leave it blank. & \\
+ \hline
+Not in CAPA &\parbox{6.49cm}{
+Option 1 - \$best = \&languages() \\
+Option 2 - @all = \&languages() \\
+Option 3 - \$best = \&languages($\backslash$@desired\_languages) \\
+Option 4 - @all = \&languages($\backslash$@desired\_languages) \\
+}& Returns the best language to use, in the first two options returns the languages codes in the preference order of the user. In the second two examples returns the best matches from a list of desired language possibilities. & \\
\hline
roundto(x,n) &\&roundto(\$x,\$n) &Rounds a real number to n decimal points. \$x and \$n can be pure numbers & \\
- \hline
+ \hline
+&\&cas(\$s,\$e,\$l)&Evaluates the expression \$e inside the symbolic algebra system \$s. Currently, only the Maxima
+symbolic math system is implemented. \$l is an optional comma-separated list of libraries. Example: \&cas('maxima','6*7')&\\
+ \hline
+Not in CAPA&\&implicit\_multiplication(\$f)&Adds mathematical multiplication operators to the formula expression \$f where only implicit multiplication is used. Example: \&implicit\_multiplication('2(b+3c)') returns 2*(b+3*c)&\\
+ \hline
web(``a'',''b'',''c'') or web(a,b,c) &\&web(``a'',''b'',''c'') or \&web(\$a,\$b,\$c) &Returns either a, b or c depending on the output medium. a is for plain ASCII, b for tex output and c for html output & \\
\hline
html(``a'') or html(a) &\&html(``a'') or \&html(\$a) &Output only if the output mode chosen is in html format & \\
@@ -84,12 +100,31 @@ var\_in\_tex(a) &\&var\_in\_tex(\$a) &Eq
\hline
to\_string(x), to\_string(x,y) &\&to\_string(\$x), \&to\_string(\$x,\$y) &If x is an integer, returns a string. If x is real than the output is a string with format given by y. For example, if x = 12.3456, \&to\_string(x,''.3F'') = 12.345 and \&to\_string(x,''.3E'') = 1.234E+01. & \\
\hline
-capa\_id(), class(), section(), set(), problem() &\&class(), \§ion() &Returns null string, class descriptive name, section number, set number and null string. &capa\_id(), set() and problem() are no longer used. Currently, they return a null value. \\
+capa\_id(), class(), section(), set(), problem() &\&class(), \&sec() &Returns null string, class descriptive name, section number, set number and null string. &capa\_id(), set() and problem() are no longer used. Currently, they return a null value. \\
\hline
name(), student\_number() &\&name(), \&student\_number() &Return the full name in the following format: lastname, firstname initial. Student\_number returns the student 9-alphanumeric string. If undefined, the functions return null. & \\
\hline
-open\_date(), due\_date(), answer\_date() &\&open\_date(), \&due\_date(), \&answer\_date() &Problem open date, due date and answer date. The time is also included in 24-hr format. &Output format for time is changed slightly. If pass noon, it displays ..pm else it displays ..am. So 23:59 is displayed as 11:59 pm. \\
+NOT IMPLEMENTED IN CAPA &\&check\_status(\$partid) &Returns a number identifying the current status of a part. True values mean that a part is ``done'': either unanswerable because of tries exhaustion, or fully correct, or only partially correct (and retries not permitted). A false value means that a part can still be attempted. If \$part is unspecified, it will check either the current $<$part$>$'s status or if outside of a $<$part$>$, check the status of previous $<$part$>$. The full set of return codes are: 'undef' means it is unattempted, 0 means it is attempted but still has tries, and is either wrong (or partially correct, retries allowed), 1 means it is fully correct or partially correct (no retries), 2 means the user has exceeded the maximum number of tries, and 3 means it is after the answer date & \\
\hline
+open\_date(), due\_date(), answer\_date() &\&open\_date(\$partid), \&due\_date(\$partid), \&answer\_date(\$partid) &Problem open date, due date and answer date. The time is also included in 24-hr format. &Output format for time is changed slightly. If pass noon, it displays ..pm else it displays ..am. So 23:59 is displayed as 11:59 pm. \\
+ \hline
+&\&open\_date\_epoch(\$partid), \&due\_date\_epoch(\$partid), \&answer\_date\_epoch(\$partid) &Problem open date, due date and answer date in seconds after the epoch. These numbers can be used in calculations.&\\
+\hline
+&\&submission(\$partid,\$responseid,\$version,
+\$encode,\$cleanupnum) & Returns what the student submitted for response \$responseid in part \$part. You can get these IDs from the XML-code of the problem. Use 0 as \$partid for problems without parts. \$version is optional and returns the \$version-th submission of the student that was graded. If \$version is 0 or ommitted, the latest submission is returned.
+\$encode is also optional and allows the author to explicitly encode the returned string. It's up to the author to take care of properly escaping all characters which might be interpreted by the browser.
+\$cleanupnum is also optional, and supports clean-up of the retrieved submission. It is a reference to a hash, with one or more of the following:
+exponent =$>$ 1,
+comma =$>$ 1,
+letterforzero =$>$ 1,
+spaces =$>$ 1,
+format =$>$ 'ns'
+(where n is an integer, i.e., number of significant digits). For example, to convert a student submission of
+11,300 to 11300 include \{ comma =$>$ 1, \} as the fifth arg.&\\
+\hline
+
+&\¤tpart() & Returns the ID of the current part.&\\ \hline
+
get\_seed(), set\_seed() &Not implemented &Get and set the random seed. & \\
\hline
sub\_string(a,b,c) &\&sub\_string(\$a,\$b,\$c)