Skip to content

Commit 3c8f80b

Browse files
authored
Merge pull request #399 from ucfopen/dev/v2-4-0
Releasing version 2.4.0
2 parents 3188848 + 7f23c1a commit 3c8f80b

File tree

23 files changed

+481
-91
lines changed

23 files changed

+481
-91
lines changed

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ assets/js/vendor/
1414

1515
config/log.log
1616

17-
docker/nginx.conf
18-
docker/nginx.crt
19-
docker/nginx.key
17+
docker/etc/nginx/nginx.conf
18+
docker/var/ssl/nginx.crt
19+
docker/var/ssl/nginx.key

DOCKER.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ $ docker-machine ip udoit
2828

2929
### NGINX Configuration
3030

31-
If `docker/nginx.conf` doesn't exist, create it using a copy of the template:
31+
If `docker/etc/nginx/nginx.conf` doesn't exist, create it using a copy of the template:
3232

3333
```
34-
$ cp docker/nginx.template.conf docker/nginx.conf
34+
$ cp docker/etc/nginx/nginx.template.conf docker/etc/nginx/nginx.conf
3535
```
3636

37-
Edit `docker/nginx.conf`' to point to the UDOIT docker-machine's IP address by replacing both instances of
37+
Edit `docker/etc/nginx/nginx.conf`' to point to the UDOIT docker-machine's IP address by replacing both instances of
3838

3939
```
4040
localhost
@@ -49,7 +49,7 @@ with
4949
Generate SSL certificates according to the naming scheme located in the nginx.conf file (`nginx.key` and `nginx.crt`) or use your own SSL certificates:
5050

5151
```
52-
$ sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout docker/nginx.key -out docker/nginx.crt
52+
$ sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout docker/var/ssl/nginx.key -out docker/var/ssl/nginx.crt
5353
```
5454

5555
## Start Services using Docker-Compose

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,19 @@ In order for UDOIT to scan YouTube videos for closed captioning, you will need t
164164
4. Create an ***API key*** credential.
165165
5. Add the key to `config/localConfig.php` in the `define('GOOGLE_API_KEY', '');` statement. For example, if your API key is `heythisisanapikey`, that line should look like `define('GOOGLE_API_KEY', 'heythisisanapikey');` when you're done.
166166

167+
If you do not provide a Google API key, a warning log will be recorded in `config/log.log` and all YouTube videos will be marked for manual inspection by the user.
168+
167169
### Vimeo API Key
168170
In order for UDOIT to scan Vimeo videos for closed captioning, you will need to create a Vimeo API key. Follow the instructions below:
169171

170172
1. [Create a new App on Vimeo Developer API](https://developer.vimeo.com/apps/new?source=getting-started), please note you must have a Vimeo Developer account.
171173
2. On your applications "Authentication" page, Generate a new Access Token. (Select the `Public` and `Private` checkboxes for Scopes.)
172174
3. Add the key to `config/localConfig.php` in the `define('VIMEO_API_KEY', '');` statement. For example, if your API key is `heythisisanapikey`, that line should look like `define('VIMEO_API_KEY', 'heythisisanapikey');` when you're done.
173175

176+
If you do not provide a Vimeo API key, a warning log will be recorded in `config/log.log` and all Vimeo videos will be marked for manual inspection by the user.
177+
174178
### Google Analytics
175-
If you would like to use Google Analytics for tracking usage of UDOIT, create a new tracking code and add it to `config/localConfig.php` in the `define('GA_TRACKING_CODE', '');` statement. For example, if your tracking code is `UA-12345678-1`, that line should look like `define('GA_TRACKING_CODE, 'UA-12345678-1');` when you're done.
179+
If you would like to use Google Analytics for tracking usage of UDOIT, create a new tracking code and add it to `config/localConfig.php` in the `define('GA_TRACKING_CODE', '');` statement. For example, if your tracking code is `UA-12345678-1`, that line should look like `define('GA_TRACKING_CODE', 'UA-12345678-1');` when you're done.
176180

177181
### Installing the LTI in Canvas
178182
Log into Canvas to add UDOIT:
@@ -191,10 +195,10 @@ Log into Canvas to add UDOIT:
191195
#### LTI Config URL Notes
192196
The URL of your UDOIT LTI config depends on your webserver install. The file is located the `public` directory. The examples below should give you are some possible values:
193197

194-
* `http://<DOMAIN>/udoit.xml.php`
195-
* `http://<DOMAIN>/public/udoit.xml.php`
196-
* `http://<DOMAIN>/udoit/udoit.xml.php`
197-
* `http://<DOMAIN>/udoit/public/udoit.xml.php`
198+
* `https://<DOMAIN>/udoit.xml.php`
199+
* `https://<DOMAIN>/public/udoit.xml.php`
200+
* `https://<DOMAIN>/udoit/udoit.xml.php`
201+
* `https://<DOMAIN>/udoit/public/udoit.xml.php`
198202

199203
## Upgrading UDOIT
200204
The instructions below are general guidelines for upgrading your installation of UDOIT from one version to the next. However, the release notes for a particular version might contain specific instructions for that version, and those instructions supersede the ones below. Since the instructions differ depending on how you installed UDOIT, they are separated by these methods below.
@@ -247,6 +251,12 @@ If database migrations fail, make sure the database user has the ability to alte
247251

248252
## FAQs
249253

254+
### How do I get in touch with you if I have questions?
255+
There are a few different ways you can get in touch with us, depending on what you're most comfortable with:
256+
* [Canvas Community](https://community.canvaslms.com/groups/accessibility) - The easiest option is to comment on the blog post for your version of UDOIT.
257+
* [Slack](https://ucf-open-slackin.herokuapp.com/) - We have channels for all of our open source projects, including UDOIT.
258+
* Email - If you're more comfortable with email, you can contact me directly at [jacob.bates@ucf.edu](mailto:jacob.bates@ucf.edu).
259+
250260
### How much time will I have to spend maintaining UDOIT?
251261
UDOIT should require little to no maintenance. It is up to your institution to choose when you update UDOIT to the latest release. UDOIT can be updated by running `git pull` on this repository.
252262

config/settings.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
define('ENV_TEST', 'test');
33
define('ENV_PROD', 'prod');
44
define('ENV_DEV', 'dev');
5-
define('UDOIT_VERSION', '2.3.5');
5+
6+
define('UDOIT_VERSION', '2.4.0');
67

78
// SET UP AUTOLOADER (uses autoload rules from composer)
89
require_once(__DIR__.'/../vendor/autoload.php');

docker-compose.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
version: '3.3'
22

33
services:
4-
web:
4+
nginx:
55
image: nginx:stable-alpine
66
volumes:
7-
- ./docker/nginx.conf:/etc/nginx/nginx.conf
8-
- ./docker/nginx.crt:/var/ssl/nginx.crt
9-
- ./docker/nginx.key:/var/ssl/nginx.key
7+
- ./docker/etc/nginx:/etc/nginx
8+
- ./docker/var/ssl:/var/ssl
109
- .:/var/www/html
1110
ports:
1211
- "80:80"
1312
- "443:443"
14-
db:
13+
mysql:
1514
image: mysql:latest
1615
volumes:
1716
- dbdata:/var/lib/mysql

lib/Udoit.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ public static function scanContent(array $content_items)
132132
$errors = [];
133133
$warnings = [];
134134
$suggestions = [];
135+
$state = null;
135136

136137
// loop over the items returning from Quail
137138
foreach ($quail_report['report'] as $quail_issue) {
@@ -140,6 +141,8 @@ public static function scanContent(array $content_items)
140141
}
141142

142143
$issue_count++;
144+
$state = $quail_issue['state'];
145+
//error_log("state in the issue is set as ".serialize($state));
143146

144147
switch ((int) $quail_issue['severity_num']) {
145148
case 1:

lib/quail/quail/common/accessibility_tests.php

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// include_once('../config/localConfig.php');
44

5-
/**
5+
/**
66
* QUAIL - QUAIL Accessibility Information Library
77
* Copyright (C) 2009 Kevin Miller
88
*
@@ -1106,7 +1106,7 @@ function check()
11061106
}
11071107
}
11081108

1109-
/**
1109+
/**
11101110
* Test counts words for all text elements on page and suggests content chunking for pages longer than 3000 words.
11111111
*/
11121112
class contentTooLong extends quailTest
@@ -1241,7 +1241,7 @@ function check()
12411241

12421242
if (isset($style['font-weight'])) {
12431243
preg_match_all('!\d+!', $style['font-weight'], $matches);
1244-
1244+
12451245
if (count($matches) > 0) {
12461246
if ($matches >= 700) {
12471247
$bold = true;
@@ -1361,7 +1361,7 @@ function check()
13611361

13621362
if (isset($style['font-weight'])) {
13631363
preg_match_all('!\d+!', $style['font-weight'], $matches);
1364-
1364+
13651365
if (count($matches) > 0) {
13661366
if ($matches >= 700) {
13671367
$bold = true;
@@ -1371,7 +1371,14 @@ function check()
13711371
}
13721372
}
13731373
}
1374-
} else if ($element->tagName === "strong") {
1374+
} else if ($element->tagName === "strong"
1375+
|| $this->getElementAncestor($element, 'strong')
1376+
|| (isset($element->nodeValue)
1377+
&& isset($element->firstChild->nodeValue)
1378+
&& $element->nodeValue == $element->firstChild->nodeValue
1379+
&& is_object($element->firstChild)
1380+
&& property_exists($element->firstChild, 'tagName')
1381+
&& $element->firstChild->tagName === 'strong')) {
13751382
$bold = true;
13761383
$style['font-weight'] = "bold";
13771384
} else {
@@ -2991,7 +2998,7 @@ class noHeadings extends quailTest
29912998
function check()
29922999
{
29933000
global $doc_length;
2994-
3001+
29953002
$elements = $this->getAllElements('p');
29963003

29973004
$document_string = "";
@@ -6349,20 +6356,27 @@ function check()
63496356
}
63506357

63516358
/**
6352-
* HTML5 video tags have captions. There's unfortunately no way to test for captions yet...
6359+
* HTML5 video tags have captions.
63536360
* @link http://quail-lib.org/test-info/videoProvidesCaptions
63546361
*/
6355-
class videoProvidesCaptions extends quailTagTest
6362+
class videoProvidesCaptions extends quailTest
63566363
{
63576364
/**
63586365
* @var int $default_severity The default severity code for this test.
63596366
*/
6360-
var $default_severity = QUAIL_TEST_SUGGESTION;
6367+
var $default_severity = QUAIL_TEST_SEVERE;
63616368

63626369
/**
6363-
* @var string $tag The tag this test will fire on
6370+
* The main check function. This is called by the parent class to actually check content
63646371
*/
6365-
var $tag = 'video';
6372+
function check()
6373+
{
6374+
foreach ($this->getAllElements(array('video')) as $video) {
6375+
if (!$this->elementHasChild($video, 'track')) {
6376+
$this->addReport($video);
6377+
}
6378+
}
6379+
}
63666380
}
63676381

63686382
/**
@@ -6403,8 +6417,11 @@ function check()
64036417
elseif ( preg_match($search_vimeo, $attr_val) ) {
64046418
$service = 'vimeo';
64056419
}
6406-
if (isset($service) && $this->services[$service]->captionsMissing($attr_val)) {
6407-
$this->addReport($video);
6420+
if (isset($service)) {
6421+
$captionState = $this->services[$service]->captionsMissing($attr_val);
6422+
if($captionState != 2) {
6423+
$this->addReport($video, null, null, $captionState, ($captionState == 1));
6424+
}
64086425
}
64096426
}
64106427
}

lib/quail/quail/common/services/media/vimeo.php

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,9 @@
1212
class vimeoService extends mediaService
1313
{
1414
/**
15-
* @var array An array of regular expressions to extract the Vimeo item code
15+
* @var string A regular expression to extract the Vimeo item code
1616
*/
17-
var $regex = array(
18-
'@vimeo\.com/video/([^"\&\? ]+)@i',
19-
'@vimeo\.com/([^"\&\? ]+)@i',
20-
);
17+
var $regex = '@vimeo\.com/[^0-9]*([0-9]{7,9})@i';
2118

2219
/**
2320
* @var string The service point to request caption data from Vimeo
@@ -27,25 +24,33 @@ class vimeoService extends mediaService
2724
/**
2825
* Checks to see if a video is missing caption information in Vimeo
2926
* @param string $link_url The URL to the video or video resource
30-
* @return bool TRUE if captions are missing, FALSE if captions exists
27+
* @return int 0 if captions are missing, 1 if video is private, 2 if captions exist or not a video
3128
*/
3229
function captionsMissing($link_url)
3330
{
3431
$url = $this->search_url;
3532
$api_key = constant( 'VIMEO_API_KEY' );
3633

34+
// If the API key is blank, flag the video for manual inspection
35+
$key_trimmed = trim($api_key);
36+
if( empty($key_trimmed) ){
37+
return 1;
38+
}
39+
3740
if( $vimeo_id = $this->isVimeoVideo($link_url) ) {
3841
$url = $url.$vimeo_id.'/texttracks';
3942
$response = Request::get($url)->addHeader('Authorization', "Bearer $api_key")->send();
4043

41-
if ( isset($response->body->total) ) {
42-
if ($response->body->total > 0) {
43-
return false;
44-
}
44+
// Response header code is used to determine if video exists, doesn't exist, or is unaccessible
45+
// 400 means a video is private, 404 means a video doesn't exist, and 200 means the video exists
46+
if($response->code === 400 || $response->code === 404) {
47+
return 1;
48+
} else if(($response->code === 200) && $response->body->total === 0) {
49+
return 0;
4550
}
4651
}
4752

48-
return true;
53+
return 2;
4954
}
5055

5156
/**
@@ -57,10 +62,8 @@ function captionsMissing($link_url)
5762
private function isVimeoVideo($link_url)
5863
{
5964
$matches = null;
60-
foreach($this->regex as $pattern) {
61-
if(preg_match($pattern, trim($link_url), $matches)) {
62-
return $matches[1];
63-
}
65+
if(preg_match($this->regex, trim($link_url), $matches)) {
66+
return $matches[1];
6467
}
6568
return false;
6669
}

lib/quail/quail/common/services/media/youtube.php

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,33 +33,38 @@ class youtubeService extends mediaService
3333
/**
3434
* Checks to see if a video is missing caption information in YouTube
3535
* @param string $link_url The URL to the video or video resource
36-
* @return bool TRUE if captions are missing, FALSE if captions exists
36+
* @return int 0 if captions are missing, 1 if video is private, 2 if captions exist or not a video
3737
*/
3838
function captionsMissing($link_url)
3939
{
4040
$url = $this->search_url;
4141
$api_key = constant( 'GOOGLE_API_KEY' );
4242

43+
// If the API key is blank, flag the video for manual inspection
44+
$key_trimmed = trim($api_key);
45+
if( empty($key_trimmed) ){
46+
return 1;
47+
}
48+
4349
if( $youtube_id = $this->isYouTubeVideo($link_url) ) {
4450
$url = $url.$youtube_id.'&key='.$api_key;
4551
$response = Request::get($url)->send();
4652

47-
// If the video was pulled due to copyright violations, is unlisted, or is unavailable, the items array will be empty.
48-
// Another error will result in this case
49-
if( empty($response->body->items) ) {
50-
return true;
53+
// If the video was pulled due to copyright violations, is unlisted, or is unavailable, the reponse header will be 404
54+
if( $response->code === 404) {
55+
return 1;
5156
}
52-
57+
// Looks through the captions and checks if any were not auto-generated
5358
foreach ( $response->body->items as $track ) {
5459
if ( $track->snippet->trackKind != 'ASR' ) {
55-
return false;
60+
return 2;
5661
}
5762
}
5863

59-
return true;
64+
return 0;
6065
}
6166

62-
return false;
67+
return 2;
6368

6469
}
6570

@@ -79,4 +84,4 @@ private function isYouTubeVideo($link_url)
7984
}
8085
return false;
8186
}
82-
}
87+
}

0 commit comments

Comments
 (0)