[LON-CAPA-cvs] cvs: loncom /homework default_homework.lcpm /html/adm/help/tex Problem_LON-CAPA_Functions.tex

raeburn raeburn at source.lon-capa.org
Sat Dec 13 21:44:04 EST 2014


raeburn		Sun Dec 14 02:44:04 2014 EDT

  Modified files:              
    /loncom/homework	default_homework.lcpm 
    /loncom/html/adm/help/tex	Problem_LON-CAPA_Functions.tex 
  Log:
  - Add mapalias as an optional sixth arg in LON-CAPA function:
    &submission() used to retrieve student's submission for a specific 
    problem/part/response ID for use in a different problem/part in course. 
  
  
Index: loncom/homework/default_homework.lcpm
diff -u loncom/homework/default_homework.lcpm:1.169 loncom/homework/default_homework.lcpm:1.170
--- loncom/homework/default_homework.lcpm:1.169	Wed Jun 25 16:50:51 2014
+++ loncom/homework/default_homework.lcpm	Sun Dec 14 02:43:59 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # used by lonxml::xmlparse() as input variable $safeinit to Apache::run::run()
 #
-# $Id: default_homework.lcpm,v 1.169 2014/06/25 16:50:51 raeburn Exp $
+# $Id: default_homework.lcpm,v 1.170 2014/12/14 02:43:59 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1228,11 +1228,11 @@
 }
 
 sub submission {
-   my ($partid,$responseid,$subnumber,$encode,$cleanupnum)=@_;
+   my ($partid,$responseid,$subnumber,$encode,$cleanupnum,$mapalias)=@_;
    my $sub='';
    if ($subnumber) { $sub=$subnumber.':'; }
    my $output =
-       &EXT('user.resource.'.$sub.'resource.'.$partid.'.'.$responseid.'.submission');
+       &EXT('user.resource.'.$sub.'resource.'.$partid.'.'.$responseid.'.submission',$mapalias);
    if (ref($output) eq 'ARRAY') {
        my @items = @{$output};
        if ($encode) {
Index: loncom/html/adm/help/tex/Problem_LON-CAPA_Functions.tex
diff -u loncom/html/adm/help/tex/Problem_LON-CAPA_Functions.tex:1.30 loncom/html/adm/help/tex/Problem_LON-CAPA_Functions.tex:1.31
--- loncom/html/adm/help/tex/Problem_LON-CAPA_Functions.tex:1.30	Thu Jun 26 19:04:25 2014
+++ loncom/html/adm/help/tex/Problem_LON-CAPA_Functions.tex	Sun Dec 14 02:44:04 2014
@@ -142,7 +142,7 @@
 \hline
 
 \&submission(\$partid,\$responseid,\$version,
-\$encode,\$cleanupnum) & Returns what the student submitted for response \$responseid in part \$partid. 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,\$cleanupnum,\$mapalias) & Returns what the student submitted for response \$responseid in part \$partid. 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 omitted, 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:
@@ -152,7 +152,9 @@
 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.\\
+11,300 to 11300 include \{ comma =$>$ 1, \} as the fifth arg.
+\$mapalias is also optional, and supports retrieval of the submission for a response item in a different problem in the course, for which a (unique) mapalias has been set.
+The default (mapalias not defined) is to retrieve the submission for the specified part and response IDs in the current problem.\\
 \hline
 
 \&parameter\_setting(\$name,\$partid) & Returns the parameter setting \$name. Partid is optional.\\




More information about the LON-CAPA-cvs mailing list