--- loncom/html/adm/help/tex/Problem_LON-CAPA_Functions.tex 2007/05/24 06:45:57 1.9 +++ loncom/html/adm/help/tex/Problem_LON-CAPA_Functions.tex 2008/03/20 16:59:13 1.13 @@ -53,13 +53,24 @@ erf = 2/sqrt(pi) integral (0,x) et-sq an \&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 - + +\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) & Rounds a real number to n decimal points. \$x and \$n can be pure numbers \\ \hline -&\&cas(\$s,\$e)&Evaluates the expression \$e inside the symbolic algebra system \$s. Currently, only the Maxima symbolic math system is implemented. Example: \&cas('maxima','6*7')&\\ +\&cas(\$s,\$e)&Evaluates the expression \$e inside the symbolic algebra system \$s. Currently, only the Maxima symbolic math system is implemented. Example: \&cas('maxima','6*7')\\ \hline +\&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) & 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 @@ -88,7 +99,7 @@ Option 1 - \&map(\$seed,[$\backslash$\$w \$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] =$>$ $\backslash$@a. And Option 5 is the same as option 4 the array of results are saved into a signle array rather than an array opf scalar variables.\\ + \$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] =$>$ $\backslash$@a. And Option 5 is the same as option 4, where the array of results is saved into a single array rather than an array of scalar variables.\\ \hline \parbox{6.49cm}{Option 1 - \&rmap(\$seed,[$\backslash$\$w,$\backslash$\$x,$\backslash$\$y,$\backslash$\$z],[\$a,\$b,\$c,\$d]) or \\