Diff for /loncom/html/adm/help/tex/Spreadsheet_Functions.tex between versions 1.9 and 1.10

version 1.9, 2010/08/23 16:16:18 version 1.10, 2016/01/03 04:45:45
Line 1 Line 1
 \label{Spreadsheet_Functions}  \label{Spreadsheet_Functions}
 The following special functions are available in the spreadsheet.  The following special functions are available in the spreadsheet.
 Please see Referencing Cells (\ref{Spreadsheet_Referencing_Cells})  Please see \textbf{Referencing Cells} (\ref{Spreadsheet_Referencing_Cells})
 for information on specifying cells and ranges.  for information on specifying cells and ranges.
   
 \begin{itemize}  \begin{itemize}
Line 41  for information on specifying cells and Line 41  for information on specifying cells and
 \index{SUMMIN}  \index{SUMMIN}
   
 \item \texttt{\&EXT(expression)} - access to EXT function in lonnet.  \item \texttt{\&EXT(expression)} - access to EXT function in lonnet.
 Use \texttt{\&EXT('system.time')} to retrieve the current time.  Use \texttt{\&EXT(`system.time')} to retrieve the current time.
 \index{EXT}  \index{EXT}
   
 \item \texttt{\&PARM(parameter)} - get the value of a specific parameter   \item \texttt{\&PARM(parameter)} - get the value of a specific parameter 
Line 66  can be entered as well, if prefixed by \ Line 66  can be entered as well, if prefixed by \
   
 \begin{itemize}  \begin{itemize}
   
 \item \texttt{\&SUMSEQ('Z','Chapter 1');}  \item \texttt{\&SUMSEQ(`Z',`Chapter 1');}
   
 \item \texttt{\&SUMSEQ('Z','Chapter 1','Chapter 2','Chapter 3');}  \item \texttt{\&SUMSEQ(`Z',`Chapter 1',`Chapter 2',`Chapter 3');}
   
 \item \texttt{\&SUMSEQ('Z','all');} - sum over all sequences.  \item \texttt{\&SUMSEQ(`Z',`all');} - sum over all sequences.
   
 \item \texttt{\&SUMSEQ('Z','regexp:Large Biomolecules');} -  \item \texttt{\&SUMSEQ(`Z',`regexp:Large Biomolecules');} -
  sum over all sequences which match the regular expression    sum over all sequences which match the regular expression 
 /Large Biomolecules/.  /Large Biomolecules/.
   
Line 80  can be entered as well, if prefixed by \ Line 80  can be entered as well, if prefixed by \
   
 \end{itemize}  \end{itemize}
   
 In addition, most non-IO Perl functions work in cells.  \noindent
   In addition, most non-IO Perl functions work in cells. Perl offers a compact \texttt{if} structure using the logic
   \texttt{TEST\char`_EXPR?IF\char`_TRUE\char`_EXPR\char`:IF\char`_FALSE\char`_EXPR;}. The \texttt{if} statements can be nested. For example, to scale the points awarded on the assessment spreadsheet (by default in \texttt{Z0}) with the number of tries (by default in \texttt{C0}), the adjusted score can be programmed in an empty cell in assessment spreadsheet row 0, where\\
   
   \noindent
   \texttt{C0$>$2 ? (0.5*Z0) \char`: (C0$>$1 ? (0.75*Z0) \char`: Z0);}\\
   
   \noindent
   is equivalent to
    
   \begin{verbatim}
   if (C0 > 2) {
     $cellvalue = 0.5*Z0; 
   } elsif (C0 > 1) {
     $cellvalue = 0.75*Z0;
   } else {$cellvalue = Z0;}
   $cellvalue;
   \end{verbatim}
   
   Use of parantheses is usually necessary in the compact \texttt{if} statement to assure correct precedence.

Removed from v.1.9  
changed lines
  Added in v.1.10


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>