Skip to content

Commit fbfeac4

Browse files
committed
logstore xapi ileda
1 parent 4006f4d commit fbfeac4

File tree

519 files changed

+30486
-8
lines changed

Some content is hidden

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

519 files changed

+30486
-8
lines changed

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs.
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines, 2 spaced tabs, UTF-8 with a newline ending
7+
# across every file
8+
[*]
9+
end_of_line = lf
10+
indent_style = space
11+
indent_size = 2
12+
charset = utf-8
13+
14+
[*.{php,json}]
15+
indent_size = 4
16+
trim_trailing_whitespace=true

.github/CONTRIBUTING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
### Issue Templates
2+
If you are reporting an issue, you need to replace the parts of the template where you see `{{some text}}`.
3+
4+
### Code Structure
5+
Repository = Data layer = Reads and writes data from a location (variable/DB/external API/etc).
6+
7+
Service = Business layer = Operates on data and transforms data from a given structure to a required structure.

.github/ISSUE_TEMPLATE.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
**Description**
2+
- {{Brief description of your bug}}
3+
4+
**Version**
5+
- {{branch}} at {{commit}} on {{version - found in your copy of the VERSION file}}
6+
7+
**Steps to reproduce the bug**
8+
1. {{steps}}
9+
10+
**Expected behaviour**
11+
- {{feature}} should be {{expectedResult}} because {{reason}}.
12+
13+
**Actual behaviour**
14+
- {{feature}} is {{actualResult}}.
15+
16+
**Server information**
17+
- {{database}} with {{authentication}}.
18+
19+
**Client information**
20+
- OS: {{operatingSystem}}
21+
- Browser: {{browser}} {{version}}
22+
23+
**Additional information**
24+
- {{additionalInfo}})

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
**Description**
2+
- {{Brief description of your PR}}
3+
4+
**Related Issues**
5+
- #{{issue_number}}
6+
7+
**PR Type**
8+
- Fix or Enhancement
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
name: Moodle Plugin CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-22.04
8+
9+
services:
10+
postgres:
11+
image: postgres:12
12+
env:
13+
POSTGRES_USER: 'postgres'
14+
POSTGRES_HOST_AUTH_METHOD: 'trust'
15+
ports:
16+
- 5432:5432
17+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
18+
mariadb:
19+
image: mariadb:10
20+
env:
21+
MYSQL_USER: 'root'
22+
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
23+
MYSQL_CHARACTER_SET_SERVER: "utf8mb4"
24+
MYSQL_COLLATION_SERVER: "utf8mb4_unicode_ci"
25+
26+
ports:
27+
- 3306:3306
28+
options: --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 3
29+
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
include:
34+
- php: '7.4'
35+
moodle-branch: 'MOODLE_39_STABLE'
36+
database: 'pgsql'
37+
- php: '7.4'
38+
moodle-branch: 'MOODLE_39_STABLE'
39+
database: 'mariadb'
40+
- php: '7.4'
41+
moodle-branch: 'MOODLE_311_STABLE'
42+
database: 'pgsql'
43+
- php: '7.4'
44+
moodle-branch: 'MOODLE_311_STABLE'
45+
database: 'mariadb'
46+
- php: '8.0'
47+
moodle-branch: 'MOODLE_311_STABLE'
48+
database: 'pgsql'
49+
- php: '8.0'
50+
moodle-branch: 'MOODLE_311_STABLE'
51+
database: 'mariadb'
52+
- php: '8.0'
53+
moodle-branch: 'MOODLE_400_STABLE'
54+
database: 'pgsql'
55+
- php: '8.0'
56+
moodle-branch: 'MOODLE_400_STABLE'
57+
database: 'mariadb'
58+
59+
steps:
60+
- name: Check out repository code
61+
uses: actions/checkout@v2
62+
with:
63+
path: plugin
64+
65+
- name: Setup PHP ${{ matrix.php }}
66+
uses: shivammathur/setup-php@v2
67+
with:
68+
php-version: ${{ matrix.php }}
69+
extensions: ${{ matrix.extensions }}
70+
ini-values: max_input_vars=5000
71+
# none to use phpdbg fallback. Specify pcov (Moodle 3.10 and up) or xdebug to use them instead.
72+
coverage: none
73+
74+
- name: Initialise moodle-plugin-ci
75+
run: |
76+
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3
77+
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
78+
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
79+
sudo locale-gen en_AU.UTF-8
80+
echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
81+
82+
- name: Install plugin dev dependencies
83+
run: |
84+
echo $(pwd)
85+
cd plugin
86+
composer install
87+
88+
- name: Install additional supported plugins (Moodle 3.9-3.11)
89+
if: ${{ matrix.moodle-branch == 'MOODLE_39_STABLE' || matrix.moodle-branch == 'MOODLE_310_STABLE' || matrix.moodle-branch == 'MOODLE_311_STABLE' }}
90+
run: |
91+
moodle-plugin-ci add-plugin --branch MOODLE_34_STABLE catalyst/moodle-mod_facetoface
92+
moodle-plugin-ci add-plugin --branch v3.0-stable blindsidenetworks/moodle-mod_bigbluebuttonbn
93+
94+
- name: Install additional supported plugins (Moodle 4.0)
95+
if: ${{ matrix.moodle-branch == 'MOODLE_400_STABLE' }}
96+
run: |
97+
moodle-plugin-ci add-plugin --branch MOODLE_400_STABLE catalyst/moodle-mod_facetoface
98+
99+
- name: Install the plugin.
100+
run: |
101+
moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
102+
env:
103+
DB: ${{ matrix.database }}
104+
MOODLE_BRANCH: ${{ matrix.moodle-branch }}
105+
IGNORE_PATHS: 'vendor/'
106+
107+
- name: PHP Lint
108+
if: ${{ always() }}
109+
run: moodle-plugin-ci phplint
110+
111+
- name: PHP Copy/Paste Detector
112+
continue-on-error: true # This step will show errors but will not fail
113+
if: ${{ always() }}
114+
run: moodle-plugin-ci phpcpd
115+
116+
- name: PHP Mess Detector
117+
continue-on-error: true # This step will show errors but will not fail
118+
if: ${{ always() }}
119+
run: moodle-plugin-ci phpmd
120+
121+
- name: Moodle Code Checker
122+
if: ${{ always() }}
123+
run: moodle-plugin-ci codechecker --max-warnings 0
124+
125+
- name: Moodle PHPDoc Checker
126+
if: ${{ always() }}
127+
run: moodle-plugin-ci phpdoc
128+
129+
- name: Validating
130+
if: ${{ always() }}
131+
run: moodle-plugin-ci validate
132+
133+
- name: Check upgrade savepoints
134+
if: ${{ always() }}
135+
run: moodle-plugin-ci savepoints
136+
137+
- name: Mustache Lint
138+
if: ${{ always() }}
139+
run: moodle-plugin-ci mustache
140+
141+
- name: Grunt
142+
if: ${{ always() }}
143+
run: moodle-plugin-ci grunt --max-lint-warnings 0
144+
145+
- name: PHPUnit tests
146+
if: ${{ always() }}
147+
run: moodle-plugin-ci phpunit --fail-on-warning
148+
149+
- name: Behat features
150+
if: ${{ always() }}
151+
run: moodle-plugin-ci behat --profile chrome
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#
2+
# Whenever a new tag starting with "v" is pushed, add the tagged version
3+
# to the Moodle Plugins directory at https://moodle.org/plugins
4+
#
5+
# revision: 2021070201
6+
#
7+
name: Releasing in the Plugins directory
8+
9+
on:
10+
push:
11+
tags:
12+
- v*
13+
14+
workflow_dispatch:
15+
inputs:
16+
tag:
17+
description: 'Tag to be released'
18+
required: true
19+
20+
defaults:
21+
run:
22+
shell: bash
23+
24+
jobs:
25+
release-at-moodle-org:
26+
runs-on: ubuntu-latest
27+
env:
28+
PLUGIN: logstore_xapi
29+
CURL: curl -s
30+
ENDPOINT: https://moodle.org/webservice/rest/server.php
31+
TOKEN: ${{ secrets.MOODLE_ORG_TOKEN }}
32+
FUNCTION: local_plugins_add_version
33+
34+
steps:
35+
- name: Call the service function
36+
id: add-version
37+
run: |
38+
if [[ ! -z "${{ github.event.inputs.tag }}" ]]; then
39+
TAGNAME="${{ github.event.inputs.tag }}"
40+
elif [[ $GITHUB_REF = refs/tags/* ]]; then
41+
TAGNAME="${GITHUB_REF##*/}"
42+
fi
43+
if [[ -z "${TAGNAME}" ]]; then
44+
echo "No tag name has been provided!"
45+
exit 1
46+
fi
47+
ZIPURL="https://api.github.com/repos/${{ github.repository }}/zipball/${TAGNAME}"
48+
RESPONSE=$(${CURL} ${ENDPOINT} --data-urlencode "wstoken=${TOKEN}" \
49+
--data-urlencode "wsfunction=${FUNCTION}" \
50+
--data-urlencode "moodlewsrestformat=json" \
51+
--data-urlencode "frankenstyle=${PLUGIN}" \
52+
--data-urlencode "zipurl=${ZIPURL}" \
53+
--data-urlencode "vcssystem=git" \
54+
--data-urlencode "vcsrepositoryurl=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" \
55+
--data-urlencode "vcstag=${TAGNAME}" \
56+
--data-urlencode "changelogurl=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commits/${TAGNAME}" \
57+
--data-urlencode "altdownloadurl=${ZIPURL}")
58+
echo "::set-output name=response::${RESPONSE}"
59+
60+
- name: Evaluate the response
61+
id: evaluate-response
62+
env:
63+
RESPONSE: ${{ steps.add-version.outputs.response }}
64+
run: |
65+
jq <<< ${RESPONSE}
66+
jq --exit-status ".id" <<< ${RESPONSE} > /dev/null

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.DS_STORE
2+
/.idea
3+
/.vscode
4+
/*.sublime-project
5+
/*.sublime-workspace
6+
/classes/log/error_log.txt
7+
/composer.phar
8+
/node_modules
9+
/notes.md
10+
/vendor
11+
/xapi
12+
/xapi.zip
13+
.phpunit.result.cache

LICENSE

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
GNU GENERAL PUBLIC LICENSE
1+
GNU GENERAL PUBLIC LICENSE
22
Version 3, 29 June 2007
33

4-
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
4+
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
55
Everyone is permitted to copy and distribute verbatim copies
66
of this license document, but changing it is not allowed.
77

@@ -631,8 +631,8 @@ to attach them to the start of each source file to most effectively
631631
state the exclusion of warranty; and each file should have at least
632632
the "copyright" line and a pointer to where the full notice is found.
633633

634-
<one line to give the program's name and a brief idea of what it does.>
635-
Copyright (C) <year> <name of author>
634+
{one line to give the program's name and a brief idea of what it does.}
635+
Copyright (C) {year} {name of author}
636636

637637
This program is free software: you can redistribute it and/or modify
638638
it under the terms of the GNU General Public License as published by
@@ -645,14 +645,14 @@ the "copyright" line and a pointer to where the full notice is found.
645645
GNU General Public License for more details.
646646

647647
You should have received a copy of the GNU General Public License
648-
along with this program. If not, see <https://www.gnu.org/licenses/>.
648+
along with this program. If not, see <http://www.gnu.org/licenses/>.
649649

650650
Also add information on how to contact you by electronic and paper mail.
651651

652652
If the program does terminal interaction, make it output a short
653653
notice like this when it starts in an interactive mode:
654654

655-
<program> Copyright (C) <year> <name of author>
655+
{project} Copyright (C) {year} {fullname}
656656
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657657
This is free software, and you are welcome to redistribute it
658658
under certain conditions; type `show c' for details.
@@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
664664
You should also get your employer (if you work as a programmer) or school,
665665
if any, to sign a "copyright disclaimer" for the program, if necessary.
666666
For more information on this, and how to apply and follow the GNU GPL, see
667-
<https://www.gnu.org/licenses/>.
667+
<http://www.gnu.org/licenses/>.
668668

669669
The GNU General Public License does not permit incorporating your program
670670
into proprietary programs. If your program is a subroutine library, you
671671
may consider it more useful to permit linking proprietary applications with
672672
the library. If this is what you want to do, use the GNU Lesser General
673673
Public License instead of this License. But first, please read
674-
<https://www.gnu.org/licenses/why-not-lgpl.html>.
674+
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# [Moodle Logstore xAPI](https://moodle.org/plugins/view/logstore_xapi)
2+
> Emits [xAPI](https://github.com/adlnet/xAPI-Spec/blob/master/xAPI.md) statements using the [Moodle](https://moodle.org/) Logstore.
3+
4+
- Install the plugin using [our zip installation guide](/docs/install-with-zip.md).
5+
- Process events before the plugin was installed using [our historical events guide](/docs/historical-events.md).
6+
- Ask questions via the [Github issue tracker](https://github.com/xAPI-vle/moodle-logstore_xapi/issues).
7+
- Report bugs and suggest features with the [Github issue tracker](https://github.com/xAPI-vle/moodle-logstore_xapi/issues).
8+
- View the supported events in [our `get_event_function_map` function](/src/transformer/get_event_function_map.php).
9+
- Change existing statements for the supported events using [our change statements guide](/docs/change-statements.md).
10+
- Create statements using [our new statements guide](/docs/new-statements.md).

0 commit comments

Comments
 (0)