Skip to content

Commit

Permalink
MDL-69863 tool_brickfield: Ensure language strings use correct case.
Browse files Browse the repository at this point in the history
  • Loading branch information
mchurchward authored and stronk7 committed May 4, 2021
1 parent b8c7cf9 commit ce9258a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 83 deletions.
5 changes: 0 additions & 5 deletions admin/tool/brickfield/classes/accessibility.php
Expand Up @@ -125,12 +125,7 @@ public static function get_title(local\tool\filter $filter, int $countdata): str

if ($filter->courseid != 0) {
$thiscourse = get_fast_modinfo($filter->courseid)->get_course();
$tmp->type = get_string('course');
$tmp->name = $thiscourse->fullname;
} else if ($filter->categoryid != 0) {
$category = $DB->get_record('course_categories', ['id' => $filter->categoryid]);
$tmp->type = get_string('category');
$tmp->name = $category->name;
} else {
$langstr = 'title' . $filter->tab . 'all';
}
Expand Down
82 changes: 20 additions & 62 deletions admin/tool/brickfield/lang/en/tool_brickfield.php
Expand Up @@ -28,7 +28,7 @@
$string['pluginname'] = 'Accessibility toolkit';
$string['accessibility'] = 'Accessibility';
$string['accessibilitydisabled'] = 'The Brickfield accessibility toolkit is not enabled on this site. Contact your site administrator to enable.';
$string['accessibilityreport'] = 'Accessibility Report';
$string['accessibilityreport'] = 'Accessibility report';
$string['analysistype'] = 'Enable analysis requests';
$string['analysistypedisabled'] = 'Content analysis is disabled';
$string['analysistype_desc'] = 'Prevent content analysis from being requested';
Expand Down Expand Up @@ -63,9 +63,9 @@
$string['contactadmin'] = 'Please contact your administrator to complete the registration.';
$string['contextid'] = 'Contextid';
$string['core_course'] = 'Course';
$string['core_question'] = 'Question Banks';
$string['core_question'] = 'Question banks';
$string['count'] = 'Count';
$string['coursecount'] = 'Num of Courses';
$string['coursecount'] = 'Num of courses';
$string['deletehistoricaldata'] = 'Delete historical checks results';
$string['dependency'] = 'Dependent on';
$string['emptycategory'] = 'No courses found for category {$a}';
Expand All @@ -84,15 +84,7 @@
$string['failed'] = 'Failed';
$string['failedcount'] = 'Failed: {$a}';
$string['tools'] = 'Reports';
$string['formcorrectlysubmitted'] = 'Check Process successfully added';
$string['formdescription'] = 'This will add a new check process record which will run as a scheduled task';
$string['formtitle'] = 'Add Check Process';
$string['fullcachedone'] = 'Disable to rerun caching';
$string['googleapikey'] = 'Google API Key';
$string['googleapikeydesc'] = 'Allows access to check Google YouTube video captioning data, see
<a href="https://developers.google.com/youtube">Google Developers Guide</a>';
$string['grouppercentage'] = 'Percentage passed/not per check group';
$string['groupratio'] = 'Ratio of area instances passed/not per check group';
$string['hideshow'] = 'Hide/show';
$string['innercontextid'] = 'Inner contextid';
$string['invalidaccessibilitytool'] = 'Invalid accessibility subplugin requested.';
Expand All @@ -101,23 +93,8 @@
$string['invalidlinkphrases'] = 'click|click here|here|more|more here|info|info here|information|information here|read more|read more here|further information|further information here|further details|further details here';
$string['module'] = 'Module';
$string['modulename'] = 'Name';
$string['linkdesc:advanced'] = 'There are many more tools available with a premium subscription. Information here.';
$string['linkdesc:activityresults'] = 'View your rates of accessibility compliance across Moodle activity types';
$string['linkdesc:checkdescriptions'] = 'Details of accessibility checks conducted';
$string['linkdesc:checkresults'] = 'View your rates of accessibility compliance across each accessibility check';
$string['linkdesc:checktyperesults'] = 'View your rates of accessibility compliance across each HTML content type';
$string['linkdesc:coursecategories'] = 'View your rates of accessibility compliance across each top level category';
$string['linkdesc:courses'] = 'View your rates of accessibility compliance across each course';
$string['linkdesc:coursetags'] = 'View your rates of accessibility compliance across each course tag';
$string['linkdesc:errors'] = 'Review your accessibility error findings, and find and fix them quickly';
$string['linkdesc:printable'] = 'Review and download your course\'s accessibility transcript.';
$string['managetools'] = 'Manage tools';
$string['lookuppending'] = 'Lookup pending';
$string['noerrorsfound'] = 'No common accessibility errors were found for your search parameters, congratulations!';
$string['norecords'] = 'No relevant records were found for your search parameters.';
$string['excludedcategories'] = 'Excluded category IDs';
$string['excludedcategoriesdesc'] = 'Comma separated string of excluded category IDs,
to limit all processing to exclude courses within these categories and sub-categories';
$string['notregistered'] = 'Your accessibility toolkit needs to be registered.';
$string['notvalidated'] = 'Your accessibility toolkit is still being validated.';
$string['numinstances'] = 'Number of instances';
Expand All @@ -131,7 +108,6 @@
$string['perpage'] = 'Items to show per page';
$string['privacy:metadata'] = 'The Accessibility checks report plugin does not store any personal data.';
$string['processanalysisrequests'] = 'Process content analysis requests';
$string['processlinktitle'] = 'Process Link Title';
$string['registernow'] = 'Please register now.';
$string['registrationinfo'] = '<p>This registration process allows you to use the Brickfield accessibility toolkit freemium version
for your registered Moodle site.</p>
Expand All @@ -140,34 +116,16 @@
$string['remaining'] = ' ({$a} errors remaining)';
$string['response:0'] = 'This URL doesn\'t point anywhere';
$string['response:404'] = 'This URL page was not found';
$string['returntomain'] = 'Return to Overview';
$string['schedule:blocknotscheduled'] = '<p>This course has not yet been scheduled for analysis, to find common accessibility issues.</p><p>Please view the <a href="{$a}">Accessibility toolkit help page</a> for further details.</p>';
$string['schedule:notscheduled'] = '<p>This course has not yet been scheduled for analysis, to find common accessibility issues.</p><p>By clicking on the "Submit for analysis" button, you confirm that you want all your relevant course HTML content, such as course section descriptions, activity descriptions, questions, pages, and more, to be scheduled for analysis.</p><p>This analysis will conduct multiple common accessibility checks on your course HTML content, and those results will then display on these Accessibility toolkit report pages.</p><p>Please view the <a href="{$a}">Accessibility toolkit help page</a> for further details.</p><p>This analysis will be processed in the background, by the Moodle scheduled tasks, so its speed of completion will depend on task timings and task run schedules.';
$string['schedule:requestanalysis'] = 'Submit for analysis';
$string['schedule:scheduled'] = 'This course has been scheduled for analysis.';
$string['schedule:sitenotscheduled'] = 'The global (course independent) content has not yet been scheduled for analysis, to find common accessibility issues.</p><p>By clicking on the "Submit for analysis" button, you confirm that you want all your relevant global (course independant) content to be scheduled for analysis.</p><p>This analysis will conduct multiple common accessibility checks on this content, and those results will then display on these Accessibility toolkit report pages.</p><p>Please view the <a href="{$a}">Accessibility toolkit help page</a> for further details.</p><p>This analysis will be processed in the background, by the Moodle scheduled tasks, so its speed of completion will depend on task timings and task run schedules.';
$string['schedule:sitescheduled'] = 'The global (course independent) content has been scheduled for analysis.';
$string['setting:checktypestr'] = 'Explanation display for checktype chart';
$string['setting:pertargetstr'] = 'Explanation display for per activity chart';
$string['tabamount'] = 'Display Amount';
$string['taberrors'] = 'Check Errors';
$string['taberrortotal'] = 'Display Error Totals';
$string['tabpassrate'] = 'Display Pass Rate';
$string['tabpercheck'] = 'Per Check Results';
$string['tabpercent'] = 'Display Percentage';
$string['tabpercourse'] = 'Courses breakdown';
$string['tabpertag'] = 'Course tags breakdown';
$string['tabpertarget'] = 'Per Activity Results';
$string['tabpertype'] = 'Checktype Results';
$string['tabresults'] = 'Overview';
$string['tabshowerrors'] = 'Show Checks With Errors';
$string['tabshowall'] = 'Show All Checks';
$string['tabtags'] = 'Tags';
$string['tagnotshowing'] = 'If your course tag is not showing here, check with your Moodle administrator to add it to the configured tags for this report';
$string['tagnotshowingadmin'] = 'Click here to add or remove configured tags';
$string['targetavetitle'] = 'Average errors per activity';
$string['targetpercentage'] = 'Percentage of instances passed/not per activity';
$string['targetratio'] = 'Activity Pass Ratio';
$string['targetratio'] = 'Activity pass ratio';
$string['tblcheck'] = 'Check';
$string['tblcheckexample'] = 'Example';
$string['tblcheckfailed'] = 'Checks failed';
Expand All @@ -184,17 +142,17 @@
$string['tblupdateto'] = 'Update to';
$string['termsandconditions'] = '<p>These are the terms and conditions you agree to... blah blah...</p>';
$string['termsandconditionslink'] = 'terms and conditions';
$string['titleerrorscount'] = 'Error details:&nbsp;(Showing first {$a} errors)';
$string['titleactivityresultsall'] = 'Results per activity: All reviewed courses ({$a->count} courses)';
$string['titleactivityresultspartial'] = 'Results per activity: {$a->type} {$a->name}';
$string['titleall'] = 'Error details: All reviewed courses ({$a->count} courses)';
$string['titlechecktyperesultsall'] = 'Results per content type: All reviewed courses ({$a->count} courses)';
$string['titlechecktyperesultspartial'] = 'Results per content type: {$a->type} {$a->name}';
$string['titleerrorsall'] = 'Error details: All reviewed courses ({$a->count} courses)';
$string['titleerrorspartial'] = 'Error details: {$a->type} {$a->name}';
$string['titlepartial'] = 'Error details: {$a->type} {$a->name}';
$string['titleprintableall'] = '{$a->type} {$a->name}';
$string['titleprintablepartial'] = '{$a->type} {$a->name}';
$string['titleerrorscount'] = 'Error details:&nbsp;(showing first {$a} errors)';
$string['titleactivityresultsall'] = 'Results per activity: all reviewed courses ({$a->count} courses)';
$string['titleactivityresultspartial'] = 'Results per activity: course {$a->name}';
$string['titleall'] = 'Error details: all reviewed courses ({$a->count} courses)';
$string['titlechecktyperesultsall'] = 'Results per content type: all reviewed courses ({$a->count} courses)';
$string['titlechecktyperesultspartial'] = 'Results per content type: course {$a->name}';
$string['titleerrorsall'] = 'Error details: all reviewed courses ({$a->count} courses)';
$string['titleerrorspartial'] = 'Error details: course {$a->name}';
$string['titlepartial'] = 'Error details: course {$a->name}';
$string['titleprintableall'] = 'Course {$a->name}';
$string['titleprintablepartial'] = 'Course {$a->name}';
$string['toptargets'] = 'Failed activities';
$string['toperrors'] = 'Top errors';
$string['totalactivities'] = 'Total activities';
Expand All @@ -206,7 +164,7 @@
$string['messageprovider:warningcheckid'] = 'Warning of invalid checkids';
$string['warningcheckidbody'] = 'There is an issue with a Brickfield check
which is active but not listed in the database. Please investigate.';
$string['warningcheckidsubject'] = 'Brickfield Toolkit CheckID warning';
$string['warningcheckidsubject'] = 'Brickfield Toolkit checkID warning';
$string['warningscontact'] = 'Email address for receiving warnings';
$string['warningscontact_desc'] = 'An email address to receive any Brickfield Toolkit warnings';

Expand Down Expand Up @@ -247,7 +205,7 @@
$string['activate'] = 'Activate';
$string['activated'] = 'The plugin is activated and ready to use.';
$string['activationform'] = 'Brickfield registration';
$string['activationheader'] = 'Brickfield Activation';
$string['activationheader'] = 'Brickfield activation';
$string['activationinfo'] = 'In order to use this plugin, you must be registered, or have a valid code for this platform. If you are not already registered, please {$a}register your details</a>. <br />After registration, <b>you will then have online access to the keys</b> that you must submit in this form. <br />Registration validation is then triggered by running the Accessibility toolkit cron scheduled tasks.';
$string['automatedsentdaily'] = '';
$string['country'] = 'Country';
Expand All @@ -272,11 +230,11 @@
$string['numusers'] = 'Number of users ({$a})';
$string['privacy'] = 'Privacy notice and data processing agreement';
$string['privacy_help'] = 'Access the link to read the entire policy';
$string['privacydesc'] = 'I agree to the <a href="{$a}" target="_blank">Privacy notice and data processing agreement</a> for someurl.com';
$string['privacydesc'] = 'I agree to the <a href="{$a}" target="_blank">privacy notice and data processing agreement</a> for someurl.com';
$string['registerplugin'] = 'Register with {$a}';
$string['registration'] = 'Registration Form';
$string['registration'] = 'Registration form';
$string['registrationheader'] = 'Register here';
$string['registrationheaderinfo'] = '<p>This registration process allows you to use the Brickfield accessibility toolkit freemium version for your registered Moodle site.</p> <p>This usage is subject to the terms and conditions as stated here and which you agree to, by using this product.</p>';
$string['registrationheaderinfo'] = '<p>This registration process allows you to use the Brickfield accessibility toolkit version for your registered Moodle site.</p> <p>This usage is subject to the terms and conditions as stated here and which you agree to, by using this product.</p>';
$string['release'] = 'Moodle release ({$a})';
$string['secretkey'] = 'API key';
$string['secretkey_help'] = 'This code is received by email after registration.';
Expand Down
14 changes: 3 additions & 11 deletions admin/tool/brickfield/tests/accessibility_test.php
Expand Up @@ -42,22 +42,14 @@ public function test_get_title() {

// Testing the else statement.
$output = $object->get_title($filter, 0);
$this->assertEquals($output, 'Error details: All reviewed courses (0 courses)');
$this->assertEquals($output, 'Error details: all reviewed courses (0 courses)');
$output = $object->get_title($filter, 5);
$this->assertEquals($output, 'Error details: All reviewed courses (5 courses)');
$this->assertEquals($output, 'Error details: all reviewed courses (5 courses)');

// Testing the if statement.
$filter->courseid = 1;
$output = $object->get_title($filter, 0);
$this->assertEquals($output, 'Error details: Course PHPUnit test site');

// Testing the else if statement.
$filter->categoryid = 1;
$filter->courseid = 0;
$output = $object->get_title($filter, 0);
$this->assertEquals($output, 'Error details: Category Miscellaneous');
$output = $object->get_title($filter, 2);
$this->assertEquals($output, 'Error details: Category Miscellaneous');
$this->assertEquals($output, 'Error details: course PHPUnit test site');
}

/**
Expand Down
10 changes: 5 additions & 5 deletions admin/tool/brickfield/tests/behat/accessresults.feature
Expand Up @@ -29,19 +29,19 @@ Feature: Brickfield activityresults
And I run the scheduled task "\tool_brickfield\task\bulk_process_courses"
And I run the scheduled task "\tool_brickfield\task\bulk_process_caches"
And I navigate to "Accessibility toolkit" in current page administration
And I should see "Error details: Course Course 1"
And I should see "Error details: course Course 1"
And I should see "Overall page content length"
And I should see "\"Bold\" (b) elements should not be used"
And I should see "Link text should be descriptive"
And I follow "Activity breakdown"
Then I should see "Results per activity: Course Course 1"
Then I should see "Results per activity: course Course 1"
And I navigate to "Plugins > Admin tools > Accessibility > Brickfield registration" in site administration
And I set the field "id_key" to "123456789012345678901234567890ab"
And I set the field "id_hash" to "ab123456789012345678901234567890"
And I press "Activate"
And I navigate to "Plugins > Admin tools > Accessibility > Reports" in site administration
And I should see "Error details: All reviewed courses (2 courses)"
And I should see "Error details: all reviewed courses (2 courses)"
And I follow "Activity breakdown"
Then I should see "Results per activity: All reviewed courses (2 courses)"
Then I should see "Results per activity: all reviewed courses (2 courses)"
And I follow "Content types"
Then I should see "Results per content type: All reviewed courses (2 courses)"
Then I should see "Results per content type: all reviewed courses (2 courses)"

0 comments on commit ce9258a

Please sign in to comment.