+
+ + +
+ENDFORM my $linked_id = $env{'user.linkedenv'}; my $sessionfile = $env{'user.environment'}; my $lonidsdir = $perlvar{'lonIDsDir'}; my $lonhost = $perlvar{'lonHostID'}; +my $spooldir = $perlvar{'lonAxeDir'}; my $hostname = &Apache::lonnet::hostname($lonhost); -my $wcag = '22aa'; -my $handle; +my ($handle,$csvlink,$detailslink,$showlevel,$lock); +if ($wcag =~ /^2(0|1|2)(a{1,3})$/) { + $showlevel = "WCAG 2.$1 ".uc($2); +} else { + $wcag = '22aa'; + $showlevel = 'WCAG 2.2 AA'; +} + +my %lt = &Apache::lonlocal::texthash( + ple => 'Please so not switch roles, logout, or quit the browser until accessibility check is complete.', + res => 'Resource', + sta => 'Status', + vio => 'Violations', + cno => 'Could not open files for output', + nor => 'No resources found to check', + com => 'Number of resources in compliance', + not => 'Number of resources not in compliance', + sum => 'Results summary (CSV format)', + det => 'Details for non-compliant resources (plain text)', + err => 'Errors during accessibility checking', + lau => 'Launch of Accessibility checking failed', + pass => 'pass', + fail => 'fail', + invalid => 'Invalid compliance level or invalid URL', + nolistener => 'No listener available to receive URL', +); + +if ($filename =~ m{^\Q$spooldir\E/($env{'user.name'}_$env{'user.domain'}_axe_\d+_.*)\.dat$}) { + my $stem = $1; + $csvlink = "/axespool/$stem.csv"; + $detailslink = "/axespool/$stem.txt"; +} else { + print &Apache::loncommon::end_page(); + exit; +} if ($sessionfile =~ m{^\Q$lonidsdir\E/([^/]+)\.id$}) { $handle = $1; @@ -95,10 +141,18 @@ $cookieid = 'lonID'; $protocol = 'http'; } + my $now = time; + $lock=&Apache::lonnet::set_lock("Checking Accessibility ($now)"); if (&LONCAPA::AxeRunner::launch($cookieid,$handle,$linked_id,$hostname,$wcag) eq 'ok') { my $number_of_files = $nummain + $numsupp; if ($number_of_files) { - my %prog_state = &Apache::lonhtmlcommon::Create_PrgWin('',$number_of_files); + my $preamble = '
'. + '
'. + $lt{'ple'}. + '
'. + '
'; + my %prog_state = &Apache::lonhtmlcommon::Create_PrgWin('',$number_of_files,$preamble); + my (%errors, at passed, at failed); print "
"; if (open(my $fh,'<',$filename)) { my @items; @@ -107,41 +161,90 @@ push(@items,$line); } close($fh); - foreach my $item (@items) { - my ($type,$dest,$title) = split(/\0/,$item); - my $querystr = '?inhibitmenu=yes'; - my $url = $dest; - if ($type eq 'M') { - $querystr .= '&symb='.$dest; - $url = &Apache::lonnet::clutter((&Apache::lonnet::decode_symb($dest))[2]); - } - if ($url ne '') { - my ($violations,$details) = - &LONCAPA::AxeRunner::checkcompliance($protocol.'://'.$hostname.$url.$querystr); - &Apache::lonhtmlcommon::Increment_PrgWin('',\%prog_state,'last resource'); - if ($violations eq -1) { - print "Invalid compliance level or invalid URL\n"; - } elsif ($violations eq '') { - print "No listener available to receive URL\n"; - } elsif ($violations == 0) { - print "No violations for $url\n"; - } else { - print "$violations violations for $url\n".'
'.$details."\n"; + if (@items) { + my ($outfh,$csvfh); + if ((open($outfh,'>',$outfile)) && (open($csvfh,'>',$csvfile))) { + print $csvfh "\"$lt{'res'}\",\"$lt{'sta'}\",\"$lt{'vio'}\"\n"; + foreach my $item (@items) { + my ($type,$dest,$title) = split(/\0/,$item); + my $querystr = '?inhibitmenu=yes'; + my $url = $dest; + if ($type eq 'M') { + $querystr .= '&symb='.$dest; + $url = &Apache::lonnet::clutter((&Apache::lonnet::decode_symb($dest))[2]); + } + if ($url ne '') { + my ($violations,$details) = + &LONCAPA::AxeRunner::checkcompliance($protocol.'://'.$hostname.$url.$querystr); + &Apache::lonhtmlcommon::Increment_PrgWin('',\%prog_state,'last resource'); + if ($violations eq -1) { + push(@{$errors{'invalid'}},$url); + } elsif ($violations eq '') { + push(@{$errors{'nolistener'}},$url); + } elsif ($violations == 0) { + push(@passed,$url); + print $csvfh "\"$url\",\"$lt{'pass'}\",\"0\"\n"; + } else { + push(@failed,$url); + print $outfh &mt('[quant,_1,violation] for[_2]', + $violations,$url)."\n".$details."\n\n"; + print $csvfh "\"$url\",\"$lt{'fail'}\",\"$violations\"\n"; + } + } } + close($csvfh); + close($outfh); + } else { + print ''.$lt{'cno'}.'
'."\n"; } + } else { + print ''.$lt{'nor'}.'
'."\n"; } } &Apache::lonhtmlcommon::Close_PrgWin('',\%prog_state); - print "
"; + print < +// + +ENDCLOSE + if (@passed || @failed) { + print '

'. + &mt('Accessibility checking: compliance status (level [_1])',$showlevel). + '

'."\n". + '
    '."\n". + '
  • '.$lt{'com'}.': '.scalar(@passed).'
  • '."\n". + '
  • '.$lt{'not'}.': '.scalar(@failed).'
  • '."\n". + '
'."\n". + '

'.$lt{'sum'}.'

'; + if (@failed) { + print '

'.$lt{'det'}.'

'; + } + } + if (keys(%errors)) { + print '

'.$lt{'err'}.'

'."\n"; + foreach my $posskey ('invalid','nolistener') { + if ((exists($errors{$posskey})) && (ref($errors{$posskey}) eq 'ARRAY')) { + print '

'.$lt{$posskey}.'

'. + '
    '; + foreach my $url (@{$errors{$posskey}}) { + print '
  • '.$url.'
  • '; + } + print '
'; + } + } + } } } unless (&LONCAPA::AxeRunner::cleanup() eq 'ok') { - print "Did not exit normally.\n"; + &Apache::lonnet::logthis("lonaxe.pl -- AxeRunner::cleanup did not exit normally."); } + if ($lock) { &Apache::lonnet::remove_lock($lock); } } else { - print "Launch failed.\n"; + print '

'.$lt{'lau'}.'

'; unless (&LONCAPA::AxeRunner::cleanup() eq 'ok') { - print "Did not exit normally.\n"; + &Apache::lonnet::logthis("lonaxe.pl -- AxeRunner::cleanup did not exit normally."); } } print &Apache::loncommon::end_page(); Index: loncom/misc/cleanup_file_caches.pl diff -u loncom/misc/cleanup_file_caches.pl:1.5 loncom/misc/cleanup_file_caches.pl:1.6 --- loncom/misc/cleanup_file_caches.pl:1.5 Fri Apr 20 22:00:40 2007 +++ loncom/misc/cleanup_file_caches.pl Tue Jan 13 03:18:25 2026 @@ -1,7 +1,7 @@ #!/usr/bin/perl # The LearningOnline Network # -# $Id: cleanup_file_caches.pl,v 1.5 2007/04/20 22:00:40 banghart Exp $ +# $Id: cleanup_file_caches.pl,v 1.6 2026/01/13 03:18:25 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -58,6 +58,7 @@ my $killtime = $conf->{'lonExpire'}; my $prt_spool_dir = $conf->{'lonPrtDir'}; my $zip_spool_dir = $conf->{'lonZipDir'}; +my $axe_spool_dir = $conf->{'lonAxeDir'}; my $userfile_dir = $conf->{'lonDocRoot'}.'/userfiles'; sub kill_if_old { my $filename = $File::Find::name; @@ -70,4 +71,5 @@ find (\&kill_if_old,$prt_spool_dir); find (\&kill_if_old,$zip_spool_dir); +find (\&kill_if_old,$axe_spool_dir); find (\&kill_if_old,$userfile_dir); Index: loncom/auth/lonacc.pm diff -u loncom/auth/lonacc.pm:1.210 loncom/auth/lonacc.pm:1.211 --- loncom/auth/lonacc.pm:1.210 Mon Aug 28 20:40:00 2023 +++ loncom/auth/lonacc.pm Tue Jan 13 03:18:26 2026 @@ -1,7 +1,7 @@ # The LearningOnline Network # Cookie Based Access Handler # -# $Id: lonacc.pm,v 1.210 2023/08/28 20:40:00 raeburn Exp $ +# $Id: lonacc.pm,v 1.211 2026/01/13 03:18:26 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -906,7 +906,7 @@ # ---------------------------------------------------------------- Check access my $now = time; my ($check_symb,$check_access,$check_block,$access,$poss_symb); - if ($requrl !~ m{^/(?:adm|public|(?:prt|zip)spool)/} + if ($requrl !~ m{^/(?:adm|public|(?:prt|zip|axe)spool)/} || $requrl =~ /^\/adm\/.*\/(smppg|bulletinboard)(\?|$ )/x) { $check_access = 1; } @@ -1062,8 +1062,9 @@ } } } - if ($requrl =~ m|^/prtspool/|) { - my $start='/prtspool/'.$env{'user.name'}.'_'. + if ($requrl =~ m{^/(prt|axe)spool/}) { + my $prefix = $1; + my $start='/'.$prefix.'spool/'.$env{'user.name'}.'_'. $env{'user.domain'}; if ($requrl !~ /^\Q$start\E/) { $env{'user.error.msg'}="$requrl:bre:1:1:Access Denied"; From raeburn at source.lon-capa.org Mon Jan 12 23:11:54 2026 From: raeburn at source.lon-capa.org (raeburn) Date: Tue, 13 Jan 2026 04:11:54 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonhtmlcommon.pm lonpopulate.pm Message-ID: raeburn Tue Jan 13 04:11:54 2026 EDT Modified files: /loncom/interface lonhtmlcommon.pm lonpopulate.pm Log: - WCAG 2 compliance Include scope="row" where tag in data table used as row heading. Index: loncom/interface/lonhtmlcommon.pm diff -u loncom/interface/lonhtmlcommon.pm:1.427 loncom/interface/lonhtmlcommon.pm:1.428 --- loncom/interface/lonhtmlcommon.pm:1.427 Mon Dec 15 05:26:26 2025 +++ loncom/interface/lonhtmlcommon.pm Tue Jan 13 04:11:54 2026 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.427 2025/12/15 05:26:26 raeburn Exp $ +# $Id: lonhtmlcommon.pm,v 1.428 2026/01/13 04:11:54 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2551,7 +2551,7 @@ } my $output = <<"ENDONE"; - + $title Index: loncom/interface/lonpopulate.pm diff -u loncom/interface/lonpopulate.pm:1.94 loncom/interface/lonpopulate.pm:1.95 --- loncom/interface/lonpopulate.pm:1.94 Fri Jan 9 02:22:38 2026 +++ loncom/interface/lonpopulate.pm Tue Jan 13 04:11:54 2026 @@ -1,5 +1,5 @@ # automated enrollment configuration handler -# $Id: lonpopulate.pm,v 1.94 2026/01/09 02:22:38 raeburn Exp $ +# $Id: lonpopulate.pm,v 1.95 2026/01/13 04:11:54 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -307,7 +307,7 @@
-
+ '); foreach my $task (@{$tasksref}) { if (($task eq $action) && ($state eq 'choose')) { @@ -583,6 +583,7 @@

+
'.&mt('Failsafe threshold').'