[LON-CAPA-cvs] cvs: loncom /interface loncourserespicker.pm

raeburn raeburn at source.lon-capa.org
Mon Jun 29 15:28:12 EDT 2026


raeburn		Mon Jun 29 19:28:12 2026 EDT

  Modified files:              
    /loncom/interface	loncourserespicker.pm 
  Log:
  - WCAG 2 compliance
    - Include labels for form elements.
    - Use <th> tags for column headings and row headings in data table
      with scope="row" attribute for latter.
    - For form elements in data table cells use aria-labelledby to reference 
      appropriate column and row headers.
  - Satisfy w3c validation.
  
  
Index: loncom/interface/loncourserespicker.pm
diff -u loncom/interface/loncourserespicker.pm:1.26 loncom/interface/loncourserespicker.pm:1.27
--- loncom/interface/loncourserespicker.pm:1.26	Tue Jan 13 03:18:22 2026
+++ loncom/interface/loncourserespicker.pm	Mon Jun 29 19:28:12 2026
@@ -1,6 +1,6 @@
 # The LearningOnline Network
 #
-# $Id: loncourserespicker.pm,v 1.26 2026/01/13 03:18:22 raeburn Exp $
+# $Id: loncourserespicker.pm,v 1.27 2026/06/29 19:28:12 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -435,9 +435,9 @@
     $display .= &Apache::loncommon::start_data_table()
                .&Apache::loncommon::start_data_table_header_row();
     if ($context eq 'imsexport') {
-        $display .= '<th>'.&mt('Export content item?').'</th>';
+        $display .= '<th id="contentcolumn">'.&mt('Export content item?').'</th>';
         if ($numdisc > 0) {
-            $display .= '<th>'.&mt('Export discussion posts?').'</th>';
+            $display .= '<th id="discussioncolumn">'.&mt('Export discussion posts?').'</th>';
         }
     } elsif ($context eq 'examblock') {
         $display .= '<th>'.&mt('Access blocked?').'</th>';
@@ -511,8 +511,15 @@
                                 '<td> </td>'."\n";
                 }
             } elsif ($context ne 'passback') {
-                my $labeltext = ' aria-label="'.&mt('copy item').'"';
-                $display .= '<td><input type="checkbox" name="'.$chkname.'" value="'.$count.'" ';
+                my $labeltext;
+                if ($context eq 'imsexport') {
+                    $labeltext = ' aria-labelledby="contentcolumn row'.$count.'"';
+                    $display .= '<th class="LC_rowheader" id="row'.$count.'">';
+                } else {
+                    $labeltext = ' aria-label="'.&mt('copy item').'"';
+                    $display .= '<td>';
+                }
+                $display .= '<input type="checkbox" name="'.$chkname.'" value="'.$count.'" ';
                 if ($is_map) {
                     $display .= 'onclick="javascript:checkFolder(document.'.$formname.','."'$currelem'".')" ';
                     if ($currmaps{$mapurl}) {
@@ -618,14 +625,19 @@
                                 '<td colspan="5">'.$showitem.'</td>';
                 }
             } else {
-                $display .= $showitem.'</td>'."\n";
+                $display .= $showitem;
+                if ($context eq 'imsexport') {
+                    $display .= '</th>'."\n";
+                } else {
+                    $display .= '</td>'."\n";
+                }
             }
             if ($context eq 'imsexport') {
 # Existing discussion posts?
                 if ($discussiontime{$ressymb} > 0) {
                     $boards ++;
                     $display .= '<td align="right">'
-                               .'<input type="checkbox" name="discussion" value="'.$count.'" />'
+                               .'<input type="checkbox" name="discussion" value="'.$count.'" aria-labelledby="discussioncolumn row'.$count.'" />'
                                .'</td>'."\n";
                 } elsif ($numdisc > 0) {
                     $display .= '<td> </td>'."\n";
@@ -666,7 +678,7 @@
     $display .= &Apache::loncommon::end_data_table();
     if ($context eq 'imsexport') {
         if ($numprobs > 0) {
-            $display .= '<p><fieldset style="display: inline">'.
+            $display .= '<fieldset style="display: inline">'.
                         '<legend>'.&mt('Export format for LON-CAPA problems').'</legend>'.
                         '<span class="LC_nobreak">'.
                         '<label><input type="radio" name="format" value="xml" checked="checked" />'.
@@ -674,7 +686,7 @@
                         '<label><input type="radio" name="format" value="html" />'.
                         ' '.&mt('HTML').'</label>'.(' ' x3).
                         '<label><input type="radio" name="format" value="plaintext" />'.
-                        ' '.&mt('Text').'</label></span></fieldset></p>';
+                        ' '.&mt('Text').'</label></span></fieldset><br />';
         }
     }
     my $numcount;




More information about the LON-CAPA-cvs mailing list