[LON-CAPA-cvs] cvs: loncom /interface lonaccesstimes.pm
raeburn
raeburn at source.lon-capa.org
Sat Jan 24 12:22:29 EST 2026
raeburn Sat Jan 24 17:22:29 2026 EDT
Modified files:
/loncom/interface lonaccesstimes.pm
Log:
- WCAG 2 compliance
- Include landmark for page's main content to support "Skip to main content"
- Sequential headings
Index: loncom/interface/lonaccesstimes.pm
diff -u loncom/interface/lonaccesstimes.pm:1.2 loncom/interface/lonaccesstimes.pm:1.3
--- loncom/interface/lonaccesstimes.pm:1.2 Tue Jan 31 18:55:03 2017
+++ loncom/interface/lonaccesstimes.pm Sat Jan 24 17:22:29 2026
@@ -2,7 +2,7 @@
# Display first access times for timed (interval) items for active
# students in a course.
#
-# $Id: lonaccesstimes.pm,v 1.2 2017/01/31 18:55:03 raeburn Exp $
+# $Id: lonaccesstimes.pm,v 1.3 2026/01/24 17:22:29 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -162,14 +162,18 @@
text=>'Results'});
$r->print(
&Apache::loncommon::start_page('Display first access times').
- &Apache::lonhtmlcommon::breadcrumbs('First access times'));
+ &Apache::lonhtmlcommon::breadcrumbs('First access times')."\n".
+ '<div class="LC_landmark" role="main" id="LC_main_content">'."\n");
&print_results($r,$crstype);
+ $r->print('</div>');
} else {
my $js = &Apache::lonblockingmenu::details_javascript();
$r->print(
&Apache::loncommon::start_page('Filters for first access times',$js).
- &Apache::lonhtmlcommon::breadcrumbs('First access times'));
+ &Apache::lonhtmlcommon::breadcrumbs('First access times')."\n".
+ '<div class="LC_landmark" role="main" id="LC_main_content">'."\n");
&print_selectors($r,$crstype);
+ $r->print('</div>');
}
$r->print(&Apache::loncommon::end_page());
return OK;
@@ -192,7 +196,15 @@
# ------------------------------------------------------------- Display selectors
- $r->print('<form name="accessform" method="post" action="/adm/accesstimes">');
+ my %lt = &Apache::lonlocal::texthash(
+ 'legend' => 'Choose students',
+ );
+ if ($crstype eq 'Community') {
+ $lt{'legend'} = &mt('Choose members');
+ }
+ $r->print('<fieldset class="LC_borderless" style="display:block;"><legend class="LC_visually_hidden">'
+ .$lt{'legend'}.'</legend>'
+ .'<form name="accessform" method="post" action="/adm/accesstimes">');
if ((ref($current_members) eq 'ARRAY') && (@{$current_members} > 0) && (keys(%intervals) > 0)) {
my %titles = &Apache::lonlocal::texthash(
@@ -217,12 +229,12 @@
$r->print('<p class="LC_error">'.&mt('Failed to retrieve course contents').'</p>');
} else {
my $parmcount = 0;
- $r->print('<h4>'.$titles{'intervals'}.'</h4>'.
+ $r->print('<h2 class="LC_heading_2">'.$titles{'intervals'}.'</h2>'.
&Apache::lonblockingmenu::create_interval_form(\%intervals,$parmcount,$navmap,'accesstimes').
'<hr />');
my %default;
$r->print(
- '<h4>'.$titles{'active'}.'</h4>'.
+ '<h3 class="LC_heading_3">'.$titles{'active'}.'</h3>'.
&Apache::lonselstudent::render_student_list( $current_members,
'accessform',
'current',
@@ -253,7 +265,7 @@
$r->print('<p class="LC_info">'.&mt('No timed interval settings currently apply to course, folder(s) or resource(s)').'</p>');
}
}
- $r->print('</form>');
+ $r->print('</form></fieldset>');
}
sub print_results {
@@ -316,7 +328,7 @@
}
if ($symb) {
if ($title) {
- $r->print('<h3>'.$title.'</h3>');
+ $r->print('<h2 class="LC_heading_2">'.$title.'</h2>');
}
my @students = &Apache::loncommon::get_env_multiple('form.firstaccess_forminput');
if (@students) {
@@ -347,8 +359,8 @@
$r->print('<p class="LC_warning">'.&mt('No valid users selected to check for first access times').'</p>');
} else {
if (@hasaccess > 0) {
- $r->print('<h4>'.&mt("Access times found for [quant,_1,$usertype]",scalar(@hasaccess)).'</h4>'.
- '<p>'.&Apache::loncommon::start_data_table().
+ $r->print('<h3 class="LC_heading_3">'.&mt("Access times found for [quant,_1,$usertype]",scalar(@hasaccess)).'</h3>'.
+ &Apache::loncommon::start_data_table().
&Apache::loncommon::start_data_table_header_row().
'<th>'.&mt('User').'</th><th>'.&mt('Fullname').'</th>'.
'<th>'.&mt('First access time').'</th>'.
@@ -365,8 +377,8 @@
$r->print(&Apache::loncommon::end_data_table().'</p>');
}
if (@noaccess > 0) {
- $r->print('<h4>'.&mt("No access times found for [quant,_1,$usertype]",scalar(@noaccess)).'</h4>'.
- '<p>'.&Apache::loncommon::start_data_table().
+ $r->print('<h3 class="LC_heading_3">'.&mt("No access times found for [quant,_1,$usertype]",scalar(@noaccess)).'</h3>'.
+ &Apache::loncommon::start_data_table().
&Apache::loncommon::start_data_table_header_row().
'<th>'.&mt('User').'</th><th>'.&mt('Fullname').'</th>'.
&Apache::loncommon::end_data_table_header_row());
More information about the LON-CAPA-cvs
mailing list