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

damieng damieng at source.lon-capa.org
Fri Dec 9 15:12:10 EST 2016


damieng		Fri Dec  9 20:12:10 2016 EDT

  Modified files:              
    /loncom/homework	structuretags.pm 
  Log:
  using button instead of input for resetdata so that Daxe (which does not have access to &mt) can use that parameter
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.550 loncom/homework/structuretags.pm:1.551
--- loncom/homework/structuretags.pm:1.550	Wed Sep 14 02:42:43 2016
+++ loncom/homework/structuretags.pm	Fri Dec  9 20:12:09 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.550 2016/09/14 02:42:43 raeburn Exp $
+# $Id: structuretags.pm,v 1.551 2016/12/09 20:12:09 damieng Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -676,7 +676,7 @@
             }
             $env{'form.'.$Apache::inputtags::part.'.rndseed'}=$rndseed;
         }
-	if ( ($env{'form.resetdata'} eq &mt('New Problem Variation')
+	if ( ($env{'form.resetdata'} eq 'new_problem_variation'
 	      && $env{'form.submitted'} eq 'yes')  ||
 	    $env{'form.newrandomization'} eq &mt('New Randomization')) {
 	    srand(time);
@@ -953,7 +953,8 @@
      </div>
      <input type="submit" name="changeproblemmode" value="'.&mt("Change View").'" />
      <input type="submit" name="clear_style_file" accesskey="d" value="'.&mt('Show Default View').'" />
-     <input type="submit" name="resetdata" accesskey="r" value="'.&mt('Reset Submissions').'" />
+     <button type="submit" name="resetdata" accesskey="r" value="reset_submissions">
+     '.&mt('Reset Submissions').'</button>
    </div>
    <hr />
    <div class="LC_edit_problem_header_randomize_row">
@@ -1018,8 +1019,8 @@
 	|| $Apache::lonhomework::type eq 'practice') {
 	
 	my $namespace = $symb || $env{'request.uri'};
-	if ($env{'form.resetdata'} eq &mt('Reset Submissions') ||
-	    ($env{'form.resetdata'} eq &mt('New Problem Variation')
+	if ($env{'form.resetdata'} eq 'reset_submissions' ||
+	    ($env{'form.resetdata'} eq 'new_problem_variation'
 	     && $env{'form.submitted'} eq 'yes') ||
 	    $env{'form.newrandomization'} eq &mt('New Randomization')) {
 	    &Apache::lonnet::tmpreset($namespace,'',$domain,$name);
@@ -1587,8 +1588,8 @@
 	    ($symb eq '' || $Apache::lonhomework::type eq 'practice')) {
 	    $form_tag_start.='<input type="hidden" name="rndseed" value="'.
 		$rndseed.'" />'.
-		    '<input type="submit" name="resetdata"
-                             value="'.&mt('New Problem Variation').'" />';
+		    '<button type="submit" name="resetdata"
+                        value="new_problem_variation">'.&mt('New Problem Variation').'</button>';
 	    if (exists($env{'form.username'})) {
 		$form_tag_start.=
 		    '<input type="hidden" name="username"
@@ -1749,9 +1750,9 @@
 		    $result.= &problem_web_to_edit_header($env{'form.rndseed'});
                 }
                 if ($Apache::lonhomework::type eq 'practice') {
-                    $result.= '<input type="submit" name="resetdata" '.
-                              'value="'.&mt('New Problem Variation').'" />'.
-                              &practice_problem_header().'<hr />';
+                    $result.= '<button type="submit" name="resetdata" '.
+                        'value="new_problem_variation">'.&mt('New Problem Variation').'</button>'.
+                        &practice_problem_header().'<hr />';
                 }
 	    }
 	    # if we are viewing someone else preserve that info
@@ -2062,9 +2063,9 @@
 		  '<input type="hidden" name="submitted" value="yes" />';
 	$result.=&problem_web_to_edit_header($rndseed);
         if ($Apache::lonhomework::type eq 'practice') {
-            $result.= '<input type="submit" name="resetdata" '.
-                      'value="'.&mt('New Problem Variation').'" />'.
-                      &practice_problem_header().'<hr />';
+            $result.= '<button type="submit" name="resetdata" '.
+                'value="new_problem_variation">'.&mt('New Problem Variation').'</button>'.
+                &practice_problem_header().'<hr />';
         }
     }
     return $result;




More information about the LON-CAPA-cvs mailing list