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

raeburn raeburn at source.lon-capa.org
Mon Jan 27 22:57:08 EST 2025


raeburn		Tue Jan 28 03:57:08 2025 EDT

  Modified files:              
    /loncom/homework	inputtags.pm 
  Log:
  - WCAG 2 compliance
  
  
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.361 loncom/homework/inputtags.pm:1.362
--- loncom/homework/inputtags.pm:1.361	Sun Jan 26 07:17:02 2025
+++ loncom/homework/inputtags.pm	Tue Jan 28 03:57:08 2025
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # input  definitons
 #
-# $Id: inputtags.pm,v 1.361 2025/01/26 07:17:02 raeburn Exp $
+# $Id: inputtags.pm,v 1.362 2025/01/28 03:57:08 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -244,9 +244,13 @@
                                                     'externalresponse')) {
                 $textareaclass = 'class="LC_richDetectHtml spellchecked"';
             }
+            my $labeltext = &mt('Enter answer');
+            if ($Apache::lonhomework::type =~ /survey/) {
+                $labeltext = &mt('Enter response');
+            }
 	    $result.= '<textarea wrap="hard" name="'.$tagident.'" id="'.$itemid.'" ' .
 		      'rows="'.$rows.'" cols="'.$cols.'" '.$textareaclass
-		      .'>'.
+		      .' aria-label="'.$labeltext.'">'.
                       &HTML::Entities::encode($oldresponse,'<>&"');
 	    if ($oldresponse ne '') {
 
@@ -470,8 +474,8 @@
 		if ($Apache::inputtags::status[-1] eq 'CANNOT_ANSWER') {
 		    $name = "none";
 		}
-        	my $labeltext = &mt('Enter answer');
-        	if ($Apache::lonhomework::type =~ /survey/) {
+		my $labeltext = &mt('Enter answer');
+		if ($Apache::lonhomework::type =~ /survey/) {
 		    $labeltext = &mt('Enter response');
 		}
 		$result.= '<input onkeydown="javascript:setSubmittedPart(\''.$partid.'\');"'
@@ -686,9 +690,9 @@
     }
     if ($which eq 'uploadonly' || $which eq 'both') {
         my $free_space = $maxfilesize * 1048576;
-        $result .= &mt('Submit a file: (only one file per submission)').
+        $result .= '<label>'.&mt('Submit a file: (only one file per submission)').
             ' <br /><input type="file" size="50" name="HWFILE'.$jspart.'_'.$id.
-            '" id="HWFILE'.$jspart.'_'.$id.'" class="LC_flUpload LC_hwkfile" />'.
+            '" id="HWFILE'.$jspart.'_'.$id.'" class="LC_flUpload LC_hwkfile" /></label>'.
             '<input type="hidden" id="LC_free_space_'.$jspart.'_'.$id.'"'.
             ' value="'.$free_space.'" /><br />';
     }
@@ -708,10 +712,10 @@
                 $showsymb = $symb;
             }
         }
-	$result.=$extratext.'<a href='."'".'javascript:void(window.open("/adm/portfolio?mode=selectfile&fieldname='.$env{'form.request.prefix'}.'HWPORT'.$jspart.'_'.$id.'&symb='.$showsymb.'","cat","height=600,width=800,scrollbars=1,resizable=1,menubar=2,location=1"))'."'".'>'.
+	$result.=$extratext.'<label><a href='."'".'javascript:void(window.open("/adm/portfolio?mode=selectfile&fieldname='.$env{'form.request.prefix'}.'HWPORT'.$jspart.'_'.$id.'&symb='.$showsymb.'","cat","height=600,width=800,scrollbars=1,resizable=1,menubar=2,location=1"))'."'".'>'.
 	    &mt('Select Portfolio Files: (one or more files per submission)').'</a><br />'.
 	    '<input type="text" size="50" name="HWPORT'.$jspart.'_'.$id.'" value="" />'.
-	    '<br />';
+	    '</label><br />';
     }
     $result.=&Apache::lonhtmlcommon::row_closure(1);
     return $result;




More information about the LON-CAPA-cvs mailing list