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

raeburn raeburn at source.lon-capa.org
Sat Jan 25 18:24:23 EST 2025


raeburn		Sat Jan 25 23:24:23 2025 EDT

  Modified files:              
    /loncom/homework	rankresponse.pm 
  Log:
  - WCAG 2 compliance
  
  
Index: loncom/homework/rankresponse.pm
diff -u loncom/homework/rankresponse.pm:1.74 loncom/homework/rankresponse.pm:1.75
--- loncom/homework/rankresponse.pm:1.74	Thu Jun  7 15:58:11 2018
+++ loncom/homework/rankresponse.pm	Sat Jan 25 23:24:23 2025
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # rank style response
 #
-# $Id: rankresponse.pm,v 1.74 2018/06/07 15:58:11 raeburn Exp $
+# $Id: rankresponse.pm,v 1.75 2025/01/25 23:24:23 raeburn Exp $
 # Copyright Michigan State University Board of Trustees
 #
 # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
@@ -408,6 +408,7 @@
         }
         foreach my $name (@whichfoils) {
 	    my $lastopt=$lastresponse{$name};
+            my $text=$Apache::response::foilgroup{$name.'.text'};
 	    my $optionlist='';
 	    if ($target ne 'tex') {
                 $optionlist = "<option value=\"\"></option>\n";
@@ -433,16 +434,16 @@
 		} 
 	    }
 	    if ($target ne 'tex' && $Apache::lonhomework::type ne 'exam') {
+                my $labeltext = &mt('Choose ranking for:').' '.$text;
 		$optionlist='<select onchange="javascript:setSubmittedPart(\''.
 		  $part.'\');" name="HWVAL_'.
-		    $Apache::inputtags::response[-1].':'.$temp.'">'.
+		    $Apache::inputtags::response[-1].':'.$temp.'" aria-label="'.$labeltext.'">'.
 		        $optionlist."</select>\n";
 	    } elsif ($env{'form.pdfFormFields'} eq 'yes') {
                 #do nothing
             } else {
 		$optionlist=' '.$temp.' '.$optionlist.' ';
 	    }
-	    my $text=$Apache::response::foilgroup{$name.'.text'};
 	    if ($target ne 'tex') {
                 $result .= '<div class="LC_rankfoil">';
 		if ($Apache::lonhomework::type ne 'exam') {




More information about the LON-CAPA-cvs mailing list