From raeburn at source.lon-capa.org Mon Jan 26 12:34:25 2026 From: raeburn at source.lon-capa.org (raeburn) Date: Mon, 26 Jan 2026 17:34:25 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface loncommon.pm londependencies.pm londocs.pm Message-ID: raeburn Mon Jan 26 17:34:25 2026 EDT Modified files: /loncom/interface londependencies.pm londocs.pm loncommon.pm Log: - WCAG 2 compliance - Include landmark for page's main content to support "Skip to main content" - Sequential headings - Include labels for form elements - Group form elements in fieldset with legend for screenreaders - Include empty alt tag for icons - Satisfy w3c validation: balance opening

with

, remove duplicate " -------------- next part -------------- Index: loncom/interface/londependencies.pm diff -u loncom/interface/londependencies.pm:1.5 loncom/interface/londependencies.pm:1.6 --- loncom/interface/londependencies.pm:1.5 Sun Aug 13 20:52:59 2017 +++ loncom/interface/londependencies.pm Mon Jan 26 17:34:25 2026 @@ -2,7 +2,7 @@ # Handler to manage dependencies for HTML files uploaded directly # to a course. # -# $Id: londependencies.pm,v 1.5 2017/08/13 20:52:59 raeburn Exp $ +# $Id: londependencies.pm,v 1.6 2026/01/26 17:34:25 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -132,10 +132,11 @@ } my $js = &Apache::loncommon::ask_embedded_js(); my $output = &Apache::loncommon::start_page($title,$js, - {'only_body' => 1}); + {'only_body' => 1}). + '
'; if ($earlyout) { $r->print($output.&mt('Cannot display dependency information - invalid file: [_1].',$url). - &Apache::loncommon::end_page()); + '
'.&Apache::loncommon::end_page()); return OK; } if ($action eq 'modifyhrefs') { @@ -156,13 +157,13 @@ } else { $output .= &mt('Cannot display dependency information - invalid file: [_1].',$url); } - $output .= '

'.&mt('Close window').''; + $output .= '

'.&mt('Close window').'

'; } if (($action eq 'modifyhrefs') && ($numrefchanges > 0)) { $output .= '

'. - &mt('Close pop-up window and reload page').''; + &mt('Close pop-up window and reload page').'

'; } - $output .= &Apache::loncommon::end_page(); + $output .= ''.&Apache::loncommon::end_page(); $r->print($output); return OK; } @@ -209,11 +210,11 @@ } } if ($outcome ne '') { - $output .= '

'.&mt('Deleted unused files').'

'. + $output .= '

'.&mt('Deleted unused files').'

'. ''; } if ($error ne '') { - $output .= '

'.&mt('Error(s) deleting unused files').'

'. + $output .= '

'.&mt('Error(s) deleting unused files').'

'. '

'.$error.'

'; } } @@ -222,7 +223,7 @@ &Apache::loncommon::upload_embedded($context,$destination,$cnum,$cdom, $dir_root,$url_root,undef,undef,undef, $state,'/adm/dependencies'); - $output .= '

'.&mt('Uploaded files').'

'. + $output .= '

'.&mt('Uploaded files').'

'. $result; unless ($numpathchgs) { if ($context eq 'syllabus') { Index: loncom/interface/londocs.pm diff -u loncom/interface/londocs.pm:1.736 loncom/interface/londocs.pm:1.737 --- loncom/interface/londocs.pm:1.736 Tue Jan 13 03:18:22 2026 +++ loncom/interface/londocs.pm Mon Jan 26 17:34:25 2026 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.736 2026/01/13 03:18:22 raeburn Exp $ +# $Id: londocs.pm,v 1.737 2026/01/26 17:34:25 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -7517,6 +7517,9 @@ &Apache::lonnet::update_supp_caches($coursedom,$coursenum); undef($suppchanges); } + if ($uploadphase) { + $r->print('
'); + } $r->print($upload_output); } elsif ($env{'form.phase'} eq 'upload_embedded') { # Process file upload - phase two - upload embedded objects @@ -7533,7 +7536,8 @@ &Apache::loncommon::upload_embedded('coursedoc',$destination, $docuname,$docudom,$dir_root,$url_root,undef,undef,undef,$state, $actionurl); - $r->print($result.&return_to_editor()); + $r->print('
'. + $result.&return_to_editor()); } elsif ($env{'form.phase'} eq 'check_embedded') { # Process file upload - phase three - modify references in HTML file $uploadphase = 'modified_orightml'; @@ -7544,14 +7548,17 @@ &Apache::loncommon::modify_html_refs('coursedoc',$destination, $docuname,$docudom,undef, $dir_root); - $r->print($result.&return_to_editor()); + $r->print('
'. + $result.&return_to_editor()); } elsif ($env{'form.phase'} eq 'decompress_uploaded') { $uploadphase = 'decompress_phase_one'; - $r->print(&decompression_phase_one(). + $r->print('
'. + &decompression_phase_one(). &return_to_editor()); } elsif ($env{'form.phase'} eq 'decompress_cleanup') { $uploadphase = 'decompress_phase_two'; - $r->print(&decompression_phase_two(). + $r->print('
'. + &decompression_phase_two(). &return_to_editor()); } } @@ -8494,6 +8501,8 @@ &Apache::lonnet::gettitle($r->uri).'

'. &mt('It is recommended that you use an up-to-date virus scanner before handling this file.')."

". &entryline(0,&mt("Click to download or use your browser's Save Link function"),$showdoc).'
'); + } elsif ($uploadphase) { + $r->print('
'); } } unless ($noendpage) { Index: loncom/interface/loncommon.pm diff -u loncom/interface/loncommon.pm:1.1503 loncom/interface/loncommon.pm:1.1504 --- loncom/interface/loncommon.pm:1.1503 Sat Jan 24 02:20:56 2026 +++ loncom/interface/loncommon.pm Mon Jan 26 17:34:25 2026 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.1503 2026/01/24 02:20:56 raeburn Exp $ +# $Id: loncommon.pm,v 1.1504 2026/01/26 17:34:25 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -13571,7 +13571,7 @@ next if ($embed_file =~ m{^\w+://}); } $upload_output .= &start_data_table_row(). - ' '. + ' '. ''.$embed_file.''; unless ($mapping{$embed_file} eq $embed_file) { $upload_output .= '
'. @@ -13603,7 +13603,7 @@ my ($size,$mtime) = &get_dependency_details(\%currfile,\%currsubfile,$embed_file); $modify_output .= &start_data_table_row(). ''. - ''. + ''. ' '.$embed_file.''. ''.$size.''. ''.$mtime.''. @@ -13619,7 +13619,7 @@ $counter ++; } else { $upload_output .= &start_data_table_row(). - ' '. + ' '. ''.$embed_file.''. ''.&mt('Already exists').''. &Apache::loncommon::end_data_table_row()."\n"; @@ -13629,7 +13629,7 @@ foreach my $oldfile (sort {lc($a) cmp lc($b)} keys(%unused)) { my ($size,$mtime) = &get_dependency_details(\%currfile,\%currsubfile,$oldfile); $delete_output .= &start_data_table_row(). - ''. + ''. ' '.$oldfile.''. ''.$size.''. ''.$mtime.''. @@ -13643,12 +13643,21 @@ $delidx ++; } if ($upload_output) { - $upload_output = &start_data_table(). + $upload_output = '
'. + ''.&mt('Upload files').''."\n". + &start_data_table(). + &start_data_table_header_row(). + ''.&mt('File').''. + ''.&mt('Upload?').''. + &end_data_table_header_row(). $upload_output. - &end_data_table()."\n"; + &end_data_table()."\n". + '

'."\n"; } if ($modify_output) { - $modify_output = &start_data_table(). + $modify_output = '
'. + ''.&mt('Modify files').''."\n". + &start_data_table(). &start_data_table_header_row(). ''.&mt('File').''. ''.&mt('Size (KB)').''. @@ -13656,10 +13665,13 @@ ''.&mt('Upload replacement?').''. &end_data_table_header_row(). $modify_output. - &end_data_table()."\n"; + &end_data_table()."\n". + '

'."\n"; } if ($delete_output) { - $delete_output = &start_data_table(). + $delete_output = '
'. + ''.&mt('Delete files').''."\n". + &start_data_table(). &start_data_table_header_row(). ''.&mt('File').''. ''.&mt('Size (KB)').''. @@ -13667,7 +13679,8 @@ ''.&mt('Delete?').''. &end_data_table_header_row(). $delete_output. - &end_data_table()."\n"; + &end_data_table()."\n". + '

'."\n"; } my $applies = 0; if ($numremref) { @@ -13681,28 +13694,29 @@ } if ($counter || $numunused) { $output = '
'."\n". - $state.'

'.$heading.'

'; + ' method="post" enctype="multipart/form-data">'."\n".$state; if ($actionurl eq '/adm/dependencies') { + $output .= '

'.$heading.'

'; if ($numnew) { - $output .= '

'.&mt('Missing dependencies').'

'. + $output .= '

'.&mt('Missing dependencies').'

'. '

'.&mt('The following files need to be uploaded.').'

'."\n". $upload_output.'
'."\n"; } if ($numexisting) { - $output .= '

'.&mt('Uploaded dependencies (in use)').'

'. + $output .= '

'.&mt('Uploaded dependencies (in use)').'

'. '

'.&mt('Upload a new file to replace the one currently in use.').'

'."\n". $modify_output.'
'."\n"; $buttontext = &mt('Save changes'); } if ($numunused) { - $output .= '

'.&mt('Unused files').'

'. + $output .= '

'.&mt('Unused files').'

'. '

'.&mt('The following uploaded files are no longer used.').'

'."\n". $delete_output.'
'."\n"; $buttontext = &mt('Save changes'); } } else { - $output .= $upload_output.'
'."\n"; + $output .= '

'.$heading.'

'."\n". + $upload_output.'
'."\n"; } $output .= ''."\n"; @@ -13829,7 +13843,9 @@ (ref($codebase) eq 'HASH')); my $output; if (($context eq 'upload_embedded') && ($type ne 'delete')) { - $output = ''."\n"; + my $labeltext = &mt('Choose file for embedded item [_1]', + &HTML::Entities::encode($embed_file,'"&<>')); + $output = ''."\n"; } $output .= ''; @@ -13880,7 +13896,7 @@ sub ask_embedded_js { return <<"END"; -
+

'."\n"; + $output .= '
'."\n"; return $output; } From raeburn at source.lon-capa.org Fri Jan 30 20:16:46 2026 From: raeburn at source.lon-capa.org (raeburn) Date: Sat, 31 Jan 2026 01:16:46 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonfeedback.pm Message-ID: raeburn Sat Jan 31 01:16:46 2026 EDT Modified files: /loncom/interface lonfeedback.pm Log: - Fix typos in rev. 1.394 Index: loncom/interface/lonfeedback.pm diff -u loncom/interface/lonfeedback.pm:1.394 loncom/interface/lonfeedback.pm:1.395 --- loncom/interface/lonfeedback.pm:1.394 Fri Jan 30 18:20:34 2026 +++ loncom/interface/lonfeedback.pm Sat Jan 31 01:16:46 2026 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.394 2026/01/30 18:20:34 raeburn Exp $ +# $Id: lonfeedback.pm,v 1.395 2026/01/31 01:16:46 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3075,13 +3075,13 @@ } if (keys(%discoptions)) { if ($discoptions{'nonanon'}) { - $discussoptions='
'. + $discussoptions='
'. '
'; } if ($discoptions{'anon'}) { - $discussoptions .= '
'. + $discussoptions .= '
'. ' '. From raeburn at source.lon-capa.org Fri Jan 30 20:38:41 2026 From: raeburn at source.lon-capa.org (raeburn) Date: Sat, 31 Jan 2026 01:38:41 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonfeedback.pm Message-ID: raeburn Sat Jan 31 01:38:41 2026 EDT Modified files: /loncom/interface lonfeedback.pm Log: - Satisfy w3c validation. Index: loncom/interface/lonfeedback.pm diff -u loncom/interface/lonfeedback.pm:1.395 loncom/interface/lonfeedback.pm:1.396 --- loncom/interface/lonfeedback.pm:1.395 Sat Jan 31 01:16:46 2026 +++ loncom/interface/lonfeedback.pm Sat Jan 31 01:38:41 2026 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.395 2026/01/31 01:16:46 raeburn Exp $ +# $Id: lonfeedback.pm,v 1.396 2026/01/31 01:38:41 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1021,7 +1021,7 @@ ENDDISCUSS if ($env{'form.origpage'}) { $postingform .= ''."\n"; + &HTML::Entities::encode($env{'form.origpage'},'"<>&').'" />'."\n"; foreach my $att (@{$currnewattach}) { $postingform .= ''."\n"; @@ -2059,19 +2059,13 @@ $r->print(< -END -$r->print(&Apache::lonhtmlcommon::start_pick_box()); -$r->print(< $textareaheader -

+$quote
$latexHelp
END - - + $r->print(&Apache::lonhtmlcommon::start_pick_box()); $r->print(&Apache::lonhtmlcommon::row_title('')); $r->print('&'); + } $r->print(< - + END @@ -3801,7 +3798,7 @@ sub generate_attachments_button { my ($idx,$attachnum,$ressymb,$now,$currnewattach,$deloldattach, $numoldver,$mode,$blockblog) = @_; - my $origpage = $ENV{'REQUEST_URI'}; + my $origpage = &HTML::Entities::encode($ENV{'REQUEST_URI'},'"<>&'); my $att=$attachnum.' '.&mt("attachments"); my %lt = &Apache::lonlocal::texthash( 'clic' => 'Add/remove attachments', From raeburn at source.lon-capa.org Fri Jan 30 20:55:01 2026 From: raeburn at source.lon-capa.org (raeburn) Date: Sat, 31 Jan 2026 01:55:01 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonfeedback.pm Message-ID: raeburn Sat Jan 31 01:55:01 2026 EDT Modified files: /loncom/interface lonfeedback.pm Log: - Behavior of feedback icon/link in links/icons on right side of header consistent with behavior of "Post Discussion" and Feedback links in footer: when "This discussion is closed" shown in footer - Warning shown when no message can be sent reflects context, i.e., launch from Footer (just discussion or just feedback), or from header (either) Index: loncom/interface/lonfeedback.pm diff -u loncom/interface/lonfeedback.pm:1.396 loncom/interface/lonfeedback.pm:1.397 --- loncom/interface/lonfeedback.pm:1.396 Sat Jan 31 01:38:41 2026 +++ loncom/interface/lonfeedback.pm Sat Jan 31 01:55:01 2026 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.396 2026/01/31 01:38:41 raeburn Exp $ +# $Id: lonfeedback.pm,v 1.397 2026/01/31 01:55:01 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2755,9 +2755,19 @@ sub fail_redirect { my ($r,$feedurl,$delay) = @_; if ($feedurl=~/^\/adm\//) { $feedurl.='?register=1' }; + my $msg; my %lt = &Apache::lonlocal::texthash( 'sorr' => 'Sorry, no recipients ...', + 'this' => 'This discussion is closed.', + 'none' => 'No recipients for feedback and discussion is closed', ); + if ($env{'form.sendmessageonly'}) { + $msg = $lt{'sorr'}; + } elsif ($env{'form.editdisc'} || $env{'form.replydisc'}) { + $msg = $lt{'this'}; + } else { + $msg = $lt{'none'}; + } my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif'); my %parms=('only_body' => 1); if ($delay !~ /^\d+(|\.\d+)$/) { @@ -2782,7 +2792,7 @@ } $r->print(< -

$lt{'sorr'}

+

$msg

ENDFAILREDIR @@ -3030,7 +3040,27 @@ my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; my $realsymb = &get_realsymb($symb); - if (!$blocked && &discussion_open(undef,$realsymb) && + my $status = undef; + if (($feedurl=~/$LONCAPA::assess_re/) || + (($symb =~ /ext\.tool$/) && + (&Apache::lonnet::EXT('resource.0.gradable',$symb) =~ /^yes$/i))) { + my $type; + if ($feedurl =~ /\.task$/) { + $type = 'Task'; + } elsif ($symb =~ /ext\.tool$/) { + $type = 'tool'; + } else { + $type = 'problem'; + } + if ($type eq 'tool') { + ($status) = + &Apache::lonhomework::check_slot_access('0',$type,$symb,['0']); + } else { + ($status) = + &Apache::lonhomework::check_slot_access('0',$type,$symb); + } + } + if (!$blocked && &discussion_open($status,$realsymb) && (&Apache::lonnet::allowed('pch', $env{'request.course.id'}. ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')) || From raeburn at source.lon-capa.org Fri Jan 30 21:43:24 2026 From: raeburn at source.lon-capa.org (raeburn) Date: Sat, 31 Jan 2026 02:43:24 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonfeedback.pm Message-ID: raeburn Sat Jan 31 02:43:24 2026 EDT Modified files: /loncom/interface lonfeedback.pm Log: - WCAG 2.2 compliance - Include landmark for page's main content to support "Skip to main content" for Add/remove attachments page - Include labels for form elements Satisfy minimum size for touch targets Index: loncom/interface/lonfeedback.pm diff -u loncom/interface/lonfeedback.pm:1.397 loncom/interface/lonfeedback.pm:1.398 --- loncom/interface/lonfeedback.pm:1.397 Sat Jan 31 01:55:01 2026 +++ loncom/interface/lonfeedback.pm Sat Jan 31 02:43:24 2026 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.397 2026/01/31 01:55:01 raeburn Exp $ +# $Id: lonfeedback.pm,v 1.398 2026/01/31 02:43:24 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1039,10 +1039,11 @@ $postingform .= &add_blog_checkbox($crstype); } $postingform .= "\n"; - $postingform .= &generate_attachments_button('',$attachnum,$ressymb, - $now,$currnewattach, - $currdelold,'',$mode, - $blockblog); + $postingform .= '
'. + &generate_attachments_button('',$attachnum,$ressymb, + $now,$currnewattach, + $currdelold,'',$mode, + $blockblog); if ((ref($currnewattach) eq 'ARRAY') && (@{$currnewattach} > 0)) { $newattachmsg = '
'.$lt{'newa'}.'
'; if (@{$currnewattach} > 1) { @@ -1057,7 +1058,7 @@ $newattachmsg .= ''.$1.'
'."\n"; } } - $postingform .= $newattachmsg; + $postingform .= $newattachmsg.'
'; $postingform .= '
'. &generate_preview_button(). '
'; @@ -2150,7 +2151,10 @@ $r->print("$newattachmsg"); } } - $r->print(&generate_attachments_button($postidx,$attachnum,$ressymb,$now,\@currnewattach,\@currdelold,$numoldver,'',$blockblog)); + $r->print('
'. + &generate_attachments_button($postidx,$attachnum,$ressymb,$now,\@currnewattach, + \@currdelold,$numoldver,'',$blockblog). + '
'); } $r->print('
'. &generate_preview_button().'
'. @@ -3732,17 +3736,17 @@ } $r->print(< $toolarge
- -

$lt{'clic'}

+

$lt{'clic'}

END $r->print(&Apache::lonhtmlcommon::start_pick_box()); $r->print(&Apache::lonhtmlcommon::row_title(&mt('Subject'))); $r->print(''.$subject.''); $r->print(&Apache::lonhtmlcommon::row_closure()); - $r->print(&Apache::lonhtmlcommon::row_title($lt{'adda'})); - $r->print('' + $r->print(&Apache::lonhtmlcommon::row_title('')); + $r->print('' .'' .' '.$attachmaxtext); @@ -3792,6 +3796,7 @@ $r->print(< +
$end_page END return;