Skip to content

Commit 58e5c58

Browse files
authored
Merge pull request #4 from lushonline/MOODLE_311_AND_400
Moodle 3.11 and 4.00
2 parents f0a3152 + b9d3555 commit 58e5c58

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+658
-429
lines changed

.github/workflows/main.yml .github/workflows/ci.yml

+34-66
Original file line numberDiff line numberDiff line change
@@ -6,57 +6,25 @@ defaults:
66
jobs:
77
moodle-plugin-ci:
88
env:
9-
IGNORE_PATHS : lrs/vendor
9+
IGNORE_PATHS: lrs/vendor
1010

1111
strategy:
1212
fail-fast: true
1313
matrix:
14-
moodle-versions: [
15-
'MOODLE_36_STABLE',
16-
'MOODLE_37_STABLE',
17-
'MOODLE_38_STABLE',
18-
'MOODLE_39_STABLE',
19-
'MOODLE_310_STABLE',
20-
'MOODLE_311_STABLE'
21-
]
22-
database: [
23-
'pgsql',
24-
'mariadb'
25-
]
26-
operating-system: [
27-
ubuntu-latest
28-
]
29-
php-versions: [
30-
'7.3'
31-
]
32-
node-versions: [
33-
'14.15.0'
34-
]
35-
36-
exclude:
37-
- moodle-versions: 'MOODLE_36_STABLE'
38-
node-versions: '14.15.0'
39-
40-
include:
41-
- moodle-versions: 'MOODLE_36_STABLE'
42-
database: 'pgsql'
43-
operating-system: 'ubuntu-latest'
44-
php-versions: '7.3'
45-
node-versions: '8.9'
46-
- moodle-versions: 'MOODLE_36_STABLE'
47-
database: 'mariadb'
48-
operating-system: 'ubuntu-latest'
49-
php-versions: '7.3'
50-
node-versions: '8.9'
14+
moodle-versions: ["MOODLE_311_STABLE", "MOODLE_400_STABLE"]
15+
database: ["pgsql", "mariadb"]
16+
operating-system: [ubuntu-latest]
17+
php-versions: ["7.3", "7.4", "8.0"]
18+
node-versions: ["16.14.0"]
5119

5220
runs-on: ${{ matrix.operating-system }}
5321

5422
services:
5523
postgres:
56-
image: postgres:9.6
24+
image: postgres:12
5725
env:
58-
POSTGRES_USER: 'postgres'
59-
POSTGRES_HOST_AUTH_METHOD: 'trust'
26+
POSTGRES_USER: "postgres"
27+
POSTGRES_HOST_AUTH_METHOD: "trust"
6028
options: >-
6129
--health-cmd pg_isready
6230
--health-interval 10s
@@ -66,10 +34,10 @@ jobs:
6634
- 5432:5432
6735

6836
mariadb:
69-
image: mariadb:10.5
37+
image: mariadb:10
7038
env:
71-
MYSQL_USER: 'root'
72-
MYSQL_ALLOW_EMPTY_PASSWORD: 'true'
39+
MYSQL_USER: "root"
40+
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
7341
options: >-
7442
--health-cmd="mysqladmin ping"
7543
--health-interval 10s
@@ -104,18 +72,15 @@ jobs:
10472
with:
10573
php-version: ${{ matrix.php-versions }}
10674
extensions: mbstring, pgsql, mysqli, zip, gd
75+
ini-values: max_input_vars=5000
10776
tools: phpunit
10877
coverage: none
10978

110-
- name: Configure Required Composer Version
79+
- name: Downgrade to Composer 1.x
11180
id: install-composer1
11281
if: ${{ matrix.moodle-versions == 'MOODLE_32_STABLE' || matrix.moodle-versions == 'MOODLE_33_STABLE' || matrix.moodle-versions == 'MOODLE_34_STABLE' }}
11382
run: |
114-
echo "::set-output name=COMPOSER_VERSION::--1"
115-
116-
- name: Update Composer
117-
run: |
118-
composer self-update ${{ steps.install-composer1.outputs.COMPOSER_VERSION }}
83+
composer self-update --1
11984
12085
- name: Install moodle-plugin-ci
12186
run: |
@@ -131,7 +96,7 @@ jobs:
13196
# List all the additional modules you need to install using
13297
# https://moodlehq.github.io/moodle-plugin-ci/AddExtraPlugins.html
13398
# Example below (uncomment obviously):
134-
# moodle-plugin-ci add-plugin lushonline/moodle-tool_uploadexternalcontent
99+
# moodle-plugin-ci add-plugin lushonline/moodle-mod_externalcontent
135100
env:
136101
DB: ${{ matrix.database }}
137102
MOODLE_BRANCH: ${{ matrix.moodle-versions }}
@@ -146,45 +111,48 @@ jobs:
146111
MOODLE_BRANCH: ${{ matrix.moodle-versions }}
147112
NODE_VERSION: ${{ matrix.node-versions }}
148113

149-
- name: Run PHP Lint on the plugin
114+
- name: PHP Lint
150115
if: ${{ always() }}
151116
run: moodle-plugin-ci phplint
152117

153-
- name: Run PHP Copy/Paste Detector on the plugin
118+
- name: PHP Copy/Paste Detector
119+
continue-on-error: true # This step will show errors but will not fail
154120
if: ${{ always() }}
155121
run: moodle-plugin-ci phpcpd
156122

157-
- name: Run PHP Mess Detector on the plugin
123+
- name: PHP Mess Detector
124+
continue-on-error: true # This step will show errors but will not fail
158125
if: ${{ always() }}
159126
run: moodle-plugin-ci phpmd
160127

161-
- name: Run Moodle Code Checker on the plugin
128+
- name: Moodle Code Checker
162129
if: ${{ always() }}
163-
run: moodle-plugin-ci codechecker
130+
run: moodle-plugin-ci codechecker --max-warnings 0
164131

165-
- name: Run Moodle PHPDoc checker on the plugin
132+
- name: Moodle PHPDoc Checker
166133
if: ${{ always() }}
167134
run: moodle-plugin-ci phpdoc
168135

169-
- name: Validate the plugin
136+
- name: Validating
170137
if: ${{ always() }}
171138
run: moodle-plugin-ci validate
172139

173-
- name: Run check of upgrade Savepoints on the plugin
140+
- name: Check upgrade savepoints
141+
if: ${{ always() }}
174142
run: moodle-plugin-ci savepoints
175143

176-
- name: Run Mustache Lint on the plugin
144+
- name: Mustache Lint
177145
if: ${{ always() }}
178146
run: moodle-plugin-ci mustache
179147

180-
- name: Run Grunt task on the plugin
148+
- name: Grunt
181149
if: ${{ always() }}
182-
run: moodle-plugin-ci grunt
150+
run: moodle-plugin-ci grunt --max-lint-warnings 0
183151

184-
- name: Run PHPUnit on the plugin
152+
- name: PHPUnit tests
185153
if: ${{ always() }}
186-
run: moodle-plugin-ci phpunit
154+
run: moodle-plugin-ci phpunit --fail-on-warning
187155

188-
- name: Run Behat on the plugin
156+
- name: Behat features
189157
if: ${{ always() }}
190-
run: moodle-plugin-ci behat
158+
run: moodle-plugin-ci behat --profile chrome

README.md

+16-14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# External Content with Completion #
1+
# External Content with Completion
2+
23
![Moodle Plugin CI](https://github.com/lushonline/moodle-mod_externalcontent/workflows/Moodle%20Plugin%20CI/badge.svg)
34

45
The module enables a teacher to create a resource using the text editor.
@@ -16,6 +17,7 @@ the completion can then be imported using [moodle-tool_uploadexternalcontentresu
1617
## Installation
1718

1819
---
20+
1921
1. Install the External content activity module:
2022

2123
```sh
@@ -48,34 +50,34 @@ If the Statement [Results](https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-
4850

4951
### What has been implemented
5052

51-
| Resource | HTTP Methods | Comments |
52-
| -------- | ------------ | --------- |
53+
| Resource | HTTP Methods | Comments |
54+
| ----------------------------------------------------------------------------------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
5355
| [Statements Resource](https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Communication.md#stmtres) | GET, PUT, POST | This is WRITE ONLY and so supports POST, PUT only. GET requests return a "null" response so as to be "valid" but the functionality is not implemented. The JSON statements received are parsed using [TinCan PHP](https://github.com/RusticiSoftware/TinCanPHP), and used to set the viewed status, completion status and score for the content if available. |
54-
| [About Resource](https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Communication.md#aboutresource) | GET | This returns tha xAPI version supported which for this is 1.0.0 |
56+
| [About Resource](https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Communication.md#aboutresource) | GET | This returns tha xAPI version supported which for this is 1.0.0 |
5557

5658
<br>
5759

5860
### Setup Activity Settings
5961

60-
| Name | Setting | Description |
61-
| ---- | ------- | ----------- |
62-
| Enable xAPI LRS basic support | xapienable | Enable the basic xAPI support, if disabled all calls to the xAPI endpoint return a 401 Unauthorized status. The default is enabled. |
63-
| xAPI LRS Username | xapiusername | Configure the username which is used for basic authentication of the basic LRS endpoint. The default is a random string, setup when module is installed. |
64-
| xAPI LRS Password | xapipassword | Configure the password which is used for basic authentication of the basic LRS endpoint. The default is a random string, setup when module is installed. |
62+
| Name | Setting | Description |
63+
| ----------------------------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
64+
| Enable xAPI LRS basic support | xapienable | Enable the basic xAPI support, if disabled all calls to the xAPI endpoint return a 401 Unauthorized status. The default is enabled. |
65+
| xAPI LRS Username | xapiusername | Configure the username which is used for basic authentication of the basic LRS endpoint. The default is a random string, setup when module is installed. |
66+
| xAPI LRS Password | xapipassword | Configure the password which is used for basic authentication of the basic LRS endpoint. The default is a random string, setup when module is installed. |
6567
| List of completion xAPI verbs | xapicompletionverbs | Set the xAPI verbs that will be used to indicate the content has been "completed", if a verb that matches one of these values is received the completed externally flag is updated. Any other verb simply sets the viewed flag. The defaults are http://adlnet.gov/expapi/verbs/completed and http://adlnet.gov/expapi/verbs/passed |
6668

6769
<br>
6870

6971
### Setup Activity Provider
7072

71-
| Setup | Description |
72-
| ----- | ----------- |
73-
| LRS Endpoint | In your activity provider you need to configure the path to this modules LRS endpoint. This will be https://{moodlehostname}/mod/externalcontent/lrs/index.php |
74-
| Authentication | The modules LRS only supports Basic Authentication and so you will need to use the username/password you configured above. |
73+
| Setup | Description |
74+
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
75+
| LRS Endpoint | In your activity provider you need to configure the path to this modules LRS endpoint. This will be https://{moodlehostname}/mod/externalcontent/lrs/index.php |
76+
| Authentication | The modules LRS only supports Basic Authentication and so you will need to use the username/password you configured above. |
7577

7678
## License
7779

78-
2019-2021 LushOnline
80+
2019-2022 LushOnline
7981

8082
This program is free software: you can redistribute it and/or modify it under
8183
the terms of the GNU General Public License as published by the Free Software

backup/moodle2/backup_externalcontent_activity_task.class.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*
2020
* @package mod_externalcontent
2121
* @category backup
22-
* @copyright 2019-2021 LushOnline
22+
* @copyright 2019-2022 LushOnline
2323
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2424
*/
2525

@@ -34,7 +34,7 @@
3434
/**
3535
* The class provides all the settings and steps to perform one complete backup of mod_externalcontent.
3636
* @package mod_externalcontent
37-
* @copyright 2019-2021 LushOnline
37+
* @copyright 2019-2022 LushOnline
3838
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3939
*/
4040
class backup_externalcontent_activity_task extends backup_activity_task {

backup/moodle2/backup_externalcontent_stepslib.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,18 @@
1919
*
2020
* @package mod_externalcontent
2121
* @category backup
22-
* @copyright 2019-2021 LushOnline
22+
* @copyright 2019-2022 LushOnline
2323
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2424
*/
2525

26-
defined('MOODLE_INTERNAL') || die();
27-
2826
// For more information about the backup and restore process, please visit:
2927
// https://docs.moodle.org/dev/Backup_2.0_for_developers.
3028
// https://docs.moodle.org/dev/Restore_2.0_for_developers.
3129

3230
/**
3331
* Define the complete structure for backup, with file and id annotations.
3432
* @package mod_externalcontent
35-
* @copyright 2019-2021 LushOnline
33+
* @copyright 2019-2022 LushOnline
3634
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3735
*/
3836
class backup_externalcontent_activity_structure_step extends backup_activity_structure_step {

backup/moodle2/restore_externalcontent_activity_task.class.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* The task that provides a complete restore of mod_externalcontent is defined here.
1919
*
2020
* @package mod_externalcontent
21-
* @copyright 2019-2021 LushOnline
21+
* @copyright 2019-2022 LushOnline
2222
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2323
*/
2424

@@ -33,7 +33,7 @@
3333
/**
3434
* Restore task for mod_externalcontent.
3535
* @package mod_externalcontent
36-
* @copyright 2019-2021 LushOnline
36+
* @copyright 2019-2022 LushOnline
3737
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3838
*/
3939
class restore_externalcontent_activity_task extends restore_activity_task {

backup/moodle2/restore_externalcontent_stepslib.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,18 @@
1818
* All the steps to restore mod_externalcontent are defined here.
1919
*
2020
* @package mod_externalcontent
21-
* @copyright 2019-2021 LushOnline
21+
* @copyright 2019-2022 LushOnline
2222
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2323
*/
2424

25-
defined('MOODLE_INTERNAL') || die();
26-
2725
// For more information about the backup and restore process, please visit:
2826
// https://docs.moodle.org/dev/Backup_2.0_for_developers.
2927
// https://docs.moodle.org/dev/Restore_2.0_for_developers.
3028

3129
/**
3230
* Defines the structure step to restore one mod_externalcontent activity.
3331
* @package mod_externalcontent
34-
* @copyright 2019-2021 LushOnline
32+
* @copyright 2019-2022 LushOnline
3533
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3634
*/
3735
class restore_externalcontent_activity_structure_step extends restore_activity_structure_step {

classes/analytics/indicator/activity_base.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,17 @@
1818
* Activity base class.
1919
*
2020
* @package mod_externalcontent
21-
* @copyright 2019-2021 LushOnline
21+
* @copyright 2019-2022 LushOnline
2222
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2323
*/
2424

2525
namespace mod_externalcontent\analytics\indicator;
2626

27-
defined('MOODLE_INTERNAL') || die();
28-
2927
/**
3028
* Activity base class.
3129
*
3230
* @package mod_externalcontent
33-
* @copyright 2019-2021 LushOnline
31+
* @copyright 2019-2022 LushOnline
3432
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3533
*/
3634
abstract class activity_base extends \core_analytics\local\indicator\community_of_inquiry_activity {

classes/analytics/indicator/cognitive_depth.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,17 @@
1818
* Cognitive depth indicator - externalcontent.
1919
*
2020
* @package mod_externalcontent
21-
* @copyright 2019-2021 LushOnline
21+
* @copyright 2019-2022 LushOnline
2222
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2323
*/
2424

2525
namespace mod_externalcontent\analytics\indicator;
2626

27-
defined('MOODLE_INTERNAL') || die();
28-
2927
/**
3028
* Cognitive depth indicator - externalcontent.
3129
*
3230
* @package mod_externalcontent
33-
* @copyright 2019-2021 LushOnline
31+
* @copyright 2019-2022 LushOnline
3432
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3533
*/
3634
class cognitive_depth extends activity_base {

classes/analytics/indicator/social_breadth.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,17 @@
1818
* Social breadth indicator - externalcontent.
1919
*
2020
* @package mod_externalcontent
21-
* @copyright 2019-2021 LushOnline
21+
* @copyright 2019-2022 LushOnline
2222
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2323
*/
2424

2525
namespace mod_externalcontent\analytics\indicator;
2626

27-
defined('MOODLE_INTERNAL') || die();
28-
2927
/**
3028
* Social breadth indicator - externalcontent.
3129
*
3230
* @package mod_externalcontent
33-
* @copyright 2019-2021 LushOnline
31+
* @copyright 2019-2022 LushOnline
3432
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3533
*/
3634
class social_breadth extends activity_base {

0 commit comments

Comments
 (0)