[LON-CAPA-cvs] cvs: loncom /html/adm/help/tex Spreadsheet_Functions.tex Spreadsheet_Referencing_Parameters.tex /interface/spreadsheet Spreadsheet.pm

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 23 Jan 2007 01:48:37 -0000


albertel		Mon Jan 22 20:48:37 2007 EDT

  Modified files:              
    /loncom/interface/spreadsheet	Spreadsheet.pm 
    /loncom/html/adm/help/tex	Spreadsheet_Functions.tex 
                             	Spreadsheet_Referencing_Parameters.tex 
  Log:
  - add a &PARM() routine to SPRS
  - document &PARM(), &MAXPARM(), &MINPARM()
  
  
Index: loncom/interface/spreadsheet/Spreadsheet.pm
diff -u loncom/interface/spreadsheet/Spreadsheet.pm:1.74 loncom/interface/spreadsheet/Spreadsheet.pm:1.75
--- loncom/interface/spreadsheet/Spreadsheet.pm:1.74	Mon Jan 22 20:36:26 2007
+++ loncom/interface/spreadsheet/Spreadsheet.pm	Mon Jan 22 20:48:16 2007
@@ -1,5 +1,5 @@
 #
-# $Id: Spreadsheet.pm,v 1.74 2007/01/23 01:36:26 albertel Exp $
+# $Id: Spreadsheet.pm,v 1.75 2007/01/23 01:48:16 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -675,6 +675,21 @@
     return $max;
 }
 
+
+=pod
+
+=item PARM(parametername)
+
+Returns the value of the parameter matching the input parameter name.
+parametername should be a string such as 'parameter_1_opendate'.
+
+=cut
+
+#-------------------------------------------------------
+sub PARM {
+    return $c{$_[0]};
+}
+
 #-------------------------------------------------------
 
 =pod
Index: loncom/html/adm/help/tex/Spreadsheet_Functions.tex
diff -u loncom/html/adm/help/tex/Spreadsheet_Functions.tex:1.7 loncom/html/adm/help/tex/Spreadsheet_Functions.tex:1.8
--- loncom/html/adm/help/tex/Spreadsheet_Functions.tex:1.7	Tue Oct 14 12:03:51 2003
+++ loncom/html/adm/help/tex/Spreadsheet_Functions.tex	Mon Jan 22 20:48:37 2007
@@ -44,8 +44,21 @@
 Use \&EXT(``system.time'') to retrieve the current time.
 \index{EXT}
 
+\item \texttt{\&PARM(parameter)} - get the value of a specific parameter 
+\index{PARM}
+
+\item \texttt{\&MINPARM(expression)} - get the value of a parameter that 
+matches the expression that is the smallest in value (If one specified 
+'opendate' it would return the smallest opendate set on the problem.)
+\index{MINPARM}
+
+\item \texttt{\&MAXPARM(expression)} -  get the value of a parameter that 
+matches the expression that is the largest in value (If one specified 
+'opendata' it would return the largest opendate set on the problem.)
+\index{MAXPARM}
+
 \item \texttt{\&SUMSEQ(column,sequence1,sequence2,sequence3,...)} -
-sum the given column across the folders or sequences listed.  
+sum the given column across the folders or sequences listed.
 
 When specifying a sequence use the full title.  Instead of a sequence title
 the word ``all'' can be used to sum over all sequences.  Regular expressions
Index: loncom/html/adm/help/tex/Spreadsheet_Referencing_Parameters.tex
diff -u loncom/html/adm/help/tex/Spreadsheet_Referencing_Parameters.tex:1.3 loncom/html/adm/help/tex/Spreadsheet_Referencing_Parameters.tex:1.4
--- loncom/html/adm/help/tex/Spreadsheet_Referencing_Parameters.tex:1.3	Tue Aug  8 13:47:27 2006
+++ loncom/html/adm/help/tex/Spreadsheet_Referencing_Parameters.tex	Mon Jan 22 20:48:37 2007
@@ -1,11 +1,15 @@
 \label{Spreadsheet_Referencing_Parameters}
 
 In the assessment-level spreadsheet, the parameters are available for
-calculation in two ways.
+calculation in three ways.
 
 1. Reference the cell containing the parameter: \texttt{A7}
 
 2. Reference the parameter by name: \texttt{[parameter\_0\_weight]}
 
-In each case, the value of the parameter will replace the reference before the
-Perl code in the cell is executed.
+In each of these two cases, the value of the parameter will replace the
+reference before the Perl code in the cell is executed.
+
+3. Use the &PARM() function, this will get run as part of the perl
+   code evaluation.
+