[LON-CAPA-cvs] cvs: loncom /homework lonsimpleproblemedit.pm

raeburn raeburn at source.lon-capa.org
Sun Dec 14 19:50:20 EST 2014


raeburn		Mon Dec 15 00:50:20 2014 EDT

  Modified files:              
    /loncom/homework	lonsimpleproblemedit.pm 
  Log:
  - Coding style:
   - keys()
   - for readability eliminate use of $_
  
  
Index: loncom/homework/lonsimpleproblemedit.pm
diff -u loncom/homework/lonsimpleproblemedit.pm:1.36 loncom/homework/lonsimpleproblemedit.pm:1.37
--- loncom/homework/lonsimpleproblemedit.pm:1.36	Mon Jul 15 16:13:12 2013
+++ loncom/homework/lonsimpleproblemedit.pm	Mon Dec 15 00:50:20 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Simple Problem Parameter Setting "Editor"
 #
-# $Id: lonsimpleproblemedit.pm,v 1.36 2013/07/15 16:13:12 bisitz Exp $
+# $Id: lonsimpleproblemedit.pm,v 1.37 2014/12/15 00:50:20 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -218,11 +218,11 @@
 		$env{'form.newopt'}=~s/\'/\\\'/g;
                 $curoptions{$env{'form.newopt'}}=$env{'form.newopt'};
 	    }
-            $env{'form.options'}="('".join("','",keys %curoptions)."')";
+            $env{'form.options'}="('".join("','",keys(%curoptions))."')";
 	}
 	$env{'form.hiddenparts'}='!'.$env{'form.questiontype'};
-        foreach (keys %env) {
-	    if ($_=~/^form\.(\w+)$/) {
+        foreach my $envkey (keys(%env)) {
+	    if ($envkey=~/^form\.(\w+)$/) {
                 my $parm=$1;
 		$storecontent{$prefix.$parm}=$env{'form.'.$parm};
                 $storecontent{$prefix.$parm}=~s/^\s+//s;




More information about the LON-CAPA-cvs mailing list