Skip to content

Commit

Permalink
a11y fixes:
Browse files Browse the repository at this point in the history
fix contrast on red text
use aria-expanded on block toggle
use id instead of name anchor on course page
  • Loading branch information
drlippman committed Dec 6, 2016
1 parent 97732fe commit 0b822a2
Show file tree
Hide file tree
Showing 30 changed files with 107 additions and 87 deletions.
2 changes: 1 addition & 1 deletion admin/ccexport.php
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ function getiteminfo($itemid) {
echo 'If you do not see the LTI key setting in your course settings, then your system administrator does ';
echo 'not have LTI enabled on your system, and you cannot use this feature.</p>';
if ($enablebasiclti==false) {
echo '<p style="color:red">Note: Your system does not currenltly have LTI enabled. Contact your system administrator</p>';
echo '<p class="noticetext">Note: Your system does not currenltly have LTI enabled. Contact your system administrator</p>';
}
echo '<form id="qform" method="post" action="ccexport.php?cid='.$cid.'&create=true">';
?>
Expand Down
5 changes: 4 additions & 1 deletion assessment/mathtest.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ div.cpmid {
margin-bottom: 10px;
border-radius: 4px;
}
.noticetext {
color: #db0000;
}
.mceContentBody {
font-family: "Times New Roman", Times, serif;
font-size: medium;
Expand Down Expand Up @@ -516,7 +519,7 @@ ul#navlist li a:hover
background-color: #369;
color: #fff;
}
div.pagetitle h2 {
div.pagetitle h2, div.pagetitle h1 {
margin: 10px 0px;
}
.clear {
Expand Down
8 changes: 4 additions & 4 deletions assessment/showtest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@
$msgcnt = $stm->fetchColumn(0);
echo "<a href=\"$imasroot/msgs/msglist.php?cid=$cid\" onclick=\"return confirm('", _('This will discard any unsaved work.'), "');\">", _('Messages'), " ";
if ($msgcnt>0) {
echo '<span style="color:red;">('.$msgcnt.' new)</span>';
echo '<span class="noticetext">('.$msgcnt.' new)</span>';
}
echo '</a> ';
}
Expand Down Expand Up @@ -2457,7 +2457,7 @@
$testsettings['intro'] .= "<p>" . _('Total Points Possible: ') . totalpointspossible($qi) . "</p>";
}
if ($testsettings['isgroup']>0) {
$testsettings['intro'] .= "<p><span style=\"color:red;\">" . _('This is a group assessment. Any changes affect all group members.') . "</span><br/>";
$testsettings['intro'] .= "<p><span class=noticetext >" . _('This is a group assessment. Any changes affect all group members.') . "</span><br/>";
if (!$isteacher || isset($sessiondata['actas'])) {
$testsettings['intro'] .= _('Group Members:') . " <ul>";

Expand Down Expand Up @@ -3443,7 +3443,7 @@ function showscores($questions,$attempts,$testsettings) {
echo "$average % </b></p>\n";

if ($outmsg!='') {
echo "<p style=\"color:red;font-weight: bold;\">$outmsg</p>";
echo "<p class=noticetext style=\"font-weight: bold;\">$outmsg</p>";
if ($endmsg['commonmsg']!='' && $endmsg['commonmsg']!='<p></p>') {
echo $endmsg['commonmsg'];
}
Expand All @@ -3456,7 +3456,7 @@ function showscores($questions,$attempts,$testsettings) {
} else {
$reqscore = ($testsettings['minscore']-10000).'%';
}
echo "<p><span style=\"color:red;\"><b>", sprintf(_('A score of %s is required to receive credit for this assessment'), $reqscore), "<br/>", _('Grade in Gradebook: No Credit (NC)'), "</span></p> ";
echo "<p><span class=noticetext><b>", sprintf(_('A score of %s is required to receive credit for this assessment'), $reqscore), "<br/>", _('Grade in Gradebook: No Credit (NC)'), "</span></p> ";
}
} else {
echo "<p><b>", _('Your scores have been recorded for this assessment.'), "</b></p>";
Expand Down
2 changes: 1 addition & 1 deletion assessment/testutil.php
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ function showqinfobar($qn,$inreview,$single,$showqnum=0) {
echo sprintf(_('Question %d of %d'), $qn+1, count($questions)).'<br/>';
}
if ($qi[$questions[$qn]]['withdrawn']==1) {
echo '<span class="red">', _('Question Withdrawn'), '</span> ';
echo '<span class="noticetext">', _('Question Withdrawn'), '</span> ';
}
if ($attempts[$qn]<$qi[$questions[$qn]]['attempts'] || $qi[$questions[$qn]]['attempts']==0) {
$pointsremaining = getremainingpossible($qn,$qi[$questions[$qn]],$testsettings,$attempts[$qn]);
Expand Down
8 changes: 4 additions & 4 deletions bltilaunch.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ function reporterror($err) {
echo "<form method=\"post\" action=\"{$_SERVER['PHP_SELF']}?launch=true\" ";
if ($sessiondata['ltiitemtype']==0 && $sessiondata['ltitlwrds'] != '') {
echo "onsubmit='return confirm(\"This assessment has a time limit of {$sessiondata['ltitlwrds']}. Click OK to start or continue working on the assessment.\")' >";
echo "<p style=\"color:red;\">This assessment has a time limit of {$sessiondata['ltitlwrds']}.</p>";
echo "<p class=noticetext>This assessment has a time limit of {$sessiondata['ltitlwrds']}.</p>";
} else {
echo ">";
}
Expand Down Expand Up @@ -364,7 +364,7 @@ function updateloginarea() {
$nologo = true;
require("header.php");
if (isset($infoerr)) {
echo '<p style="color:red">'.$infoerr.'</p>';
echo '<p class=noticetext>'.$infoerr.'</p>';
}

echo "<form method=\"post\" action=\"{$_SERVER['PHP_SELF']}?userinfo=set\" ";
Expand Down Expand Up @@ -1615,7 +1615,7 @@ function findfolder($items,$n,$loc) {
echo "<form method=\"post\" action=\"{$_SERVER['PHP_SELF']}?launch=true\" ";
if ($sessiondata['ltiitemtype']==0 && $sessiondata['ltitlwrds'] != '') {
echo "onsubmit='return confirm(\"This assessment has a time limit of {$sessiondata['ltitlwrds']}. Click OK to start or continue working on the assessment.\")' >";
echo "<p style=\"color:red;\">This assessment has a time limit of {$sessiondata['ltitlwrds']}.</p>";
echo "<p class=noticetext>This assessment has a time limit of {$sessiondata['ltitlwrds']}.</p>";
} else {
echo ">";
}
Expand Down Expand Up @@ -1804,7 +1804,7 @@ function updateloginarea() {
$flexwidth = true;
require("header.php");
if (isset($infoerr)) {
echo '<p style="color:red">'.$infoerr.'</p>';
echo '<p class=noticetext>'.$infoerr.'</p>';
}

echo "<form method=\"post\" action=\"{$_SERVER['PHP_SELF']}?userinfo=set\" ";
Expand Down
2 changes: 1 addition & 1 deletion course/addoutcomes.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ function removeoutcomegrp(el) {

echo '<div class="cpmid"><a href="outcomemap.php?cid='.$cid.'">'._('View Outcomes Map').'</a> | <a href="outcomereport.php?cid='.$cid.'">'._('View Outcomes Report').'</a></div>';

echo '<div class="breadcrumb">'._('Use colored boxes to drag-and-drop order and move outcomes inside groups.').' <input type="button" id="recchg" disabled="disabled" value="', _('Save Changes'), '" onclick="submitChanges()"/><span id="submitnotice" style="color:red;"></span></div>';
echo '<div class="breadcrumb">'._('Use colored boxes to drag-and-drop order and move outcomes inside groups.').' <input type="button" id="recchg" disabled="disabled" value="', _('Save Changes'), '" onclick="submitChanges()"/><span id="submitnotice" class=noticetext></span></div>';

echo '<ul id="qviewtree" class="qview">';
printoutcome($outcomes);
Expand Down
2 changes: 1 addition & 1 deletion course/addquestions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,7 @@ function addtoassessmentlist($items) {
<?php
}
?>
<span id="submitnotice" style="color:red;"></span>
<span id="submitnotice" class=noticetext></span>
<div id="curqtbl"></div>

</form>
Expand Down
20 changes: 10 additions & 10 deletions course/course.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@
$stm->execute(array(':msgto'=>$userid, ':courseid'=>$cid));
$msgcnt = $stm->fetchColumn(0);
if ($msgcnt>0) {
$newmsgs = " <a href=\"$imasroot/msgs/newmsglist.php?cid=$cid\" style=\"color:red\">" . sprintf(_('New (%d)'), $msgcnt) . "</a>";
$newmsgs = " <a href=\"$imasroot/msgs/newmsglist.php?cid=$cid\" class=noticetext>" . sprintf(_('New (%d)'), $msgcnt) . "</a>";
} else {
$newmsgs = '';
}
Expand Down Expand Up @@ -367,7 +367,7 @@
$newpostcnts[$row[0]] = $row[1];
}
if (array_sum($newpostcnts)>0) {
$newpostscnt = " <a href=\"$imasroot/forums/newthreads.php?cid=$cid\" style=\"color:red\">" . sprintf(_('New (%d)'), array_sum($newpostcnts)) . "</a>";
$newpostscnt = " <a href=\"$imasroot/forums/newthreads.php?cid=$cid\" class=noticetext>" . sprintf(_('New (%d)'), array_sum($newpostcnts)) . "</a>";
} else {
$newpostscnt = '';
}
Expand Down Expand Up @@ -411,7 +411,7 @@
}
}

$placeinhead = "<script type=\"text/javascript\" src=\"$imasroot/javascript/course.js?v=071416\"></script>";
$placeinhead = "<script type=\"text/javascript\" src=\"$imasroot/javascript/course.js?v=120516\"></script>";
if (isset($tutorid) && isset($sessiondata['ltiitemtype']) && $sessiondata['ltiitemtype']==3) {
$placeinhead .= '<script type="text/javascript">$(function(){$(".instrdates").hide();});</script>';
}
Expand Down Expand Up @@ -480,7 +480,7 @@ function additem(blk,tb) {
echo '<span class="padright hideinmobile">';
}
if (isset($guestid)) {
echo '<span class="red">', _('Instructor Preview'), '</span> ';
echo '<span class="noticetext">', _('Instructor Preview'), '</span> ';
}
if (!isset($usernameinheader)) {
echo $userfullname;
Expand Down Expand Up @@ -514,7 +514,7 @@ function additem(blk,tb) {
?>
<p><b><?php echo _('Tools'); ?></b><br/>
<a href="listusers.php?cid=<?php echo $cid ?>" class="essen"><?php echo _('Roster'); ?></a><br/>
<a href="gradebook.php?cid=<?php echo $cid ?>" class="essen"><?php echo _('Gradebook'); ?></a> <?php if (($coursenewflag&1)==1) {echo '<span class="red">', _('New'), '</span>';}?><br/>
<a href="gradebook.php?cid=<?php echo $cid ?>" class="essen"><?php echo _('Gradebook'); ?></a> <?php if (($coursenewflag&1)==1) {echo '<span class="noticetext">', _('New'), '</span>';}?><br/>
<a href="coursereports.php?cid=<?php echo $cid ?>">Reports</a><br/>
<a href="managestugrps.php?cid=<?php echo $cid ?>"><?php echo _('Groups'); ?></a><br/>
<a href="addoutcomes.php?cid=<?php echo $cid ?>"><?php echo _('Outcomes'); ?></a><br/>
Expand Down Expand Up @@ -598,7 +598,7 @@ function additem(blk,tb) {
?>

<p>
<a href="gradebook.php?cid=<?php echo $cid ?>" class="essen"><?php echo _('Gradebook'); ?></a> <?php if (($coursenewflag&1)==1) {echo '<span class="red">', _('New'), '</span>';}?>
<a href="gradebook.php?cid=<?php echo $cid ?>" class="essen"><?php echo _('Gradebook'); ?></a> <?php if (($coursenewflag&1)==1) {echo '<span class="noticetext">', _('New'), '</span>';}?>
</p>
<?php
if (!isset($sessiondata['ltiitemtype'])) { //don't show in LTI embed
Expand Down Expand Up @@ -696,7 +696,7 @@ function changeshift() {
<span class=column>
<?php echo generateadditem($_GET['folder'], 'BB') ?>
<a href="listusers.php?cid=<?php echo $cid ?>"><?php echo _('Roster'); ?></a><br/>
<a href="gradebook.php?cid=<?php echo $cid ?>"><?php echo _('Show Gradebook'); ?></a> <?php if (($coursenewflag&1)==1) {echo '<span class="red">', _('New'), '</span>';}?><br/>
<a href="gradebook.php?cid=<?php echo $cid ?>"><?php echo _('Show Gradebook'); ?></a> <?php if (($coursenewflag&1)==1) {echo '<span class="noticetext">', _('New'), '</span>';}?><br/>
<a href="course.php?cid=<?php echo $cid ?>&stuview=0"><?php echo _('Student View'); ?></a><br/>
<a href="course.php?cid=<?php echo $cid ?>&quickview=on"><?php echo _('Quick View'); ?></a></span>
<span class=column>
Expand Down Expand Up @@ -741,7 +741,7 @@ function changeshift() {
}
?>
<a href="<?php echo $imasroot ?>/help.php?section=usingimas">Help Using <?php echo $installname;?></a><br/>
<a href="gradebook.php?cid=<?php echo $cid ?>"><?php echo _('Gradebook'); ?></a> <?php if (($coursenewflag&1)==1) {echo '<span class="red">', _('New'), '</span>';}?><br/>
<a href="gradebook.php?cid=<?php echo $cid ?>"><?php echo _('Gradebook'); ?></a> <?php if (($coursenewflag&1)==1) {echo '<span class="noticetext">', _('New'), '</span>';}?><br/>
<a href="../actions.php?action=logout"><?php echo _('Log Out'); ?></a><br/>
<a href="<?php echo $imasroot ?>/help.php?section=usingimas"><?php printf(_('Help Using %s'), $installname); ?></a><br/>
<?php
Expand Down Expand Up @@ -844,13 +844,13 @@ function makeTopMenu() {
} else {
echo _('Use colored boxes to drag-and-drop order.'),' ',_('Click the B next to a block to expand or collapse it. Click an item title to edit it in place.'), ' <input type="button" id="recchg" disabled="disabled" value="', _('Save Changes'), '" onclick="submitChanges()"/>';
}
echo '<span id="submitnotice" style="color:red;"></span>';
echo '<span id="submitnotice" class=noticetext></span>';
echo '<div class="clear"></div>';
echo '</div>';

}
if (($coursenewflag&1)==1) {
$gbnewflag = ' <span class="red">' . _('New') . '</span>';
$gbnewflag = ' <span class="noticetext">' . _('New') . '</span>';
} else {
$gbnewflag = '';
}
Expand Down
Loading

0 comments on commit 0b822a2

Please sign in to comment.