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

raeburn raeburn at source.lon-capa.org
Mon Apr 4 17:50:33 EDT 2016


raeburn		Mon Apr  4 21:50:33 2016 EDT

  Modified files:              
    /loncom/homework	inputtags.pm 
  Log:
  - Bug 6808. New course container -- "Placement" for Placement Tests.
    - Submit button in same location, regardless of number of tries. 
  
  
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.340 loncom/homework/inputtags.pm:1.341
--- loncom/homework/inputtags.pm:1.340	Sat Apr  2 04:30:39 2016
+++ loncom/homework/inputtags.pm	Mon Apr  4 21:50:32 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # input  definitons
 #
-# $Id: inputtags.pm,v 1.340 2016/04/02 04:30:39 raeburn Exp $
+# $Id: inputtags.pm,v 1.341 2016/04/04 21:50:32 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1684,7 +1684,13 @@
 		    $trial.="/".$Apache::inputtags::params{'maxtries'};
 		}
 	    }
-	    $trystr = '<td class="'.$tdclass.'"><span class="LC_nobreak">'.&mt($tries_text.' [_1]',$trial).'</span></td>';
+            
+            unless (($env{'request.state'} ne "construct") && 
+                    ($env{'course.'.$env{'request.course.id'}.'.type'} eq 'Placement') && 
+                    (!$env{'request.role.adv'})) {
+                $trystr = '<span class="LC_nobreak">'.&mt($tries_text.' [_1]',$trial).'</span>';
+            }
+	    $trystr = '<td class="'.$tdclass.'">'.$trystr.'</td>';
 	}
     }
 
@@ -1751,11 +1757,7 @@
 	}
 
     }
-    my $output= $previousmsg.$latemessage.$message;
-    my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'};
-    unless ($crstype eq 'Placement') {
-        $output .= $trystr;
-    }
+    my $output= $previousmsg.$latemessage.$message.$trystr;
     if ($output =~ /^\s*$/) {
 	return $button;
     } else {
@@ -1764,7 +1766,9 @@
 	} else {
 	    $output =
 		'<table><tr><td>'.$button.'</td>'.$output;
-	    if ((!$no_previous) && ($crstype ne 'Placement')) {
+	    if ((!$no_previous) &&
+                (($env{'course.'.$env{'request.course.id'}.'.type'} ne 'Placement') ||
+                 ($env{'request.role.adv'}))) {
 		$output.='<td class="'.$tdclass.'">'.&previous_tries($id,$target).'</td>';
 	    }
 	    $output.= '</tr></table>';




More information about the LON-CAPA-cvs mailing list