[LON-CAPA-cvs] cvs: loncom /interface lonpdfupload.pm
raeburn
raeburn at source.lon-capa.org
Fri Feb 6 17:41:57 EST 2026
raeburn Fri Feb 6 22:41:57 2026 EDT
Modified files:
/loncom/interface lonpdfupload.pm
Log:
- WCAG 2 compliance.
- Include landmark for page's main content to support "Skip to main content"
- Include labels for form elements
- Sequential headings
Index: loncom/interface/lonpdfupload.pm
diff -u loncom/interface/lonpdfupload.pm:1.28 loncom/interface/lonpdfupload.pm:1.29
--- loncom/interface/lonpdfupload.pm:1.28 Fri Feb 6 22:01:32 2026
+++ loncom/interface/lonpdfupload.pm Fri Feb 6 22:41:57 2026
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# PDF Form Upload Handler
#
-# $Id: lonpdfupload.pm,v 1.28 2026/02/06 22:01:32 raeburn Exp $
+# $Id: lonpdfupload.pm,v 1.29 2026/02/06 22:41:57 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -65,6 +65,7 @@
$r->print(&Apache::loncommon::start_page('Upload PDF Form',
undef,
{'bread_crumbs' => $brcrum,})
+ .'<div class="LC_landmark" role="main" id="LC_main_content">'
);
if ($env{'request.course.id'}) {
@@ -72,6 +73,7 @@
$r->print('<p class="LC_warning">'.
&mt('Upload of PDF forms is not permitted for this course.').
'</p>'.
+ '</div>'.
&Apache::loncommon::end_page());
return OK;
}
@@ -80,6 +82,7 @@
&mt('Could not determine identity of this course.').' '.
&mt('You may need to [_1]re-select[_2] the course.','<a href="/adm/roles">','</a>').
'</p>'.
+ '</div>'.
&Apache::loncommon::end_page());
return OK;
}
@@ -111,7 +114,7 @@
);
#&dumpenv($r); #debug -> prints the environment
- $r->print(&Apache::loncommon::end_page());
+ $r->print('</div>'.&Apache::loncommon::end_page());
return OK;
}
@@ -147,18 +150,24 @@
my %lt = &Apache::lonlocal::texthash(
'title' => 'Upload a PDF Form with filled Form Fields',
'chFile' => 'File',
+ 'choo' => 'Choose file with filled form fields',
'submit' => 'Upload',
);
my $result =
- '<br />'
+ '<h2 class="LC_heading_2">'.&mt('Submit answers via PDF upload').'</h2>'
+ .'<p>'.&mt('This course allows you to submit your answers to assignments by uploading a PDF containing completed form fields.').'</p>'
+ .'<ul><li>'.&mt('Your PDF must have been originally downloaded via the print utility (with PDF form fields option selected in the Layout options)').'</li>'
+ .'<li>'.&mt('Submissions for past-due problems will be ignored, unless a grace period is in effect').'</li></ul>'
+ .'<br />'
.'<form method="post" enctype="multipart/form-data" onsubmit="return checkFilename(this);" action="">'
.&Apache::lonhtmlcommon::start_pick_box()
.&Apache::lonhtmlcommon::row_headline()
- .'<h2>'.$lt{'title'}.'</h2>'
+ .'<h3 class="LC_heading_3">'.$lt{'title'}.'</h3>'
.&Apache::lonhtmlcommon::row_closure()
.&Apache::lonhtmlcommon::row_title($lt{'chFile'})
- .'<input type="file" name="file" id="filename" />'
+ .'<input type="file" name="file" id="filename" aria-label="'
+ .&HTML::Entities::encode($lt{'choo'},'"&<>').'" />'
.&Apache::lonhtmlcommon::row_closure(1)
.&Apache::lonhtmlcommon::end_pick_box()
.'<p>'
@@ -293,7 +302,7 @@
}
#$result .= $debug;
- $result .= '<h3>'.&mt('Result of PDF Form upload').'</h3>';
+ $result .= '<h2 class="LC_heading_2">'.&mt('Result of PDF Form upload').'</h2>';
if (keys(%problems) > 0) {
$result .= &Apache::loncommon::start_data_table()
More information about the LON-CAPA-cvs
mailing list