Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
260 commits
Select commit Hold shift + click to select a range
9de5d27
removing unnecessary docs
cliffcaseyyet May 17, 2024
324608b
attempt to make sending actor name optional
milt Jun 6, 2024
2c7108a
add configurable account homePage
milt Jun 6, 2024
d7fc83d
add new defaults to test
milt Jun 6, 2024
8aa2ef3
accomodate test copypasta
milt Jun 6, 2024
d12d5a9
Merge pull request #2 from yetanalytics/conformant_actor
milt Jun 6, 2024
15ff5ee
add universal debug event (#4)
milt Jul 29, 2024
d44d91d
reenable build matrix and chill code checker
milt Jul 29, 2024
ca4e21a
Merge pull request #6 from yetanalytics/ci_concerns_2
cliffcaseyyet Jul 29, 2024
851537f
Merge pull request #1 from yetanalytics/timestamp_and_formatting_and_…
cliffcaseyyet Jul 29, 2024
4edbefb
attempt downgrade of npm (#8)
milt Aug 12, 2024
2e60f8d
adds badge_awarded event and tests, improves event exception handling
invaliduser Aug 2, 2024
8d06c7a
wip commit for badge_revoked
cliffcaseyyet Jun 14, 2024
8ef1deb
wip
invaliduser Aug 29, 2024
d44f3b3
revoked tests
invaliduser Sep 16, 2024
07c414f
tests
invaliduser Sep 17, 2024
80d6b8f
further
invaliduser Sep 17, 2024
ad4900b
further tests
invaliduser Sep 17, 2024
fcd2631
further tests
invaliduser Sep 17, 2024
9fd7ee0
further
invaliduser Sep 17, 2024
fe16b3b
further
invaliduser Sep 17, 2024
107b78a
further
invaliduser Sep 17, 2024
4ec2891
remove extraneous calendar stuff
invaliduser Sep 18, 2024
c5fcb34
Merge pull request #7 from yetanalytics/badge_awarded
invaliduser Sep 18, 2024
8c6239a
first crack at ccc with failing tests
milt Sep 26, 2024
38108f1
valid xapi contextActivities (#10)
milt Sep 26, 2024
8e16e1a
updated expected statement
milt Sep 26, 2024
8c2850b
correct event
milt Sep 26, 2024
69f6a0c
Merge branch 'master' into course_category_created
milt Sep 26, 2024
58fc991
add event id everything else seems to have
milt Sep 26, 2024
3b6972a
correct objectid
milt Sep 27, 2024
9a0e3dc
the LMS is a course of course, of course
milt Sep 27, 2024
c2becd7
fix up expected statement
milt Sep 27, 2024
c831bda
refactor
milt Sep 27, 2024
71f53dd
Revert "refactor"
milt Sep 27, 2024
daccc55
Revert "Revert "refactor""
milt Sep 27, 2024
8ca7965
minor changes to align with current profile
milt Sep 27, 2024
6f4996e
also update whatever this JISC thing is
milt Sep 27, 2024
ba691a6
formatting
milt Sep 27, 2024
2268347
course completion updated
milt Sep 27, 2024
c5b5704
try removing workaround
milt Sep 27, 2024
8529c00
Merge branch 'ci_fixes' into course_completion_updated
milt Sep 27, 2024
7625f75
updated expected statement
milt Sep 27, 2024
fd80e47
correct weird version thingy
milt Sep 30, 2024
6c1ab93
Merge pull request #13 from yetanalytics/ci_fixes
milt Sep 30, 2024
9a419f4
Merge branch 'master' into course_completion_updated
milt Sep 30, 2024
0d508ad
first crack
milt Sep 30, 2024
167a0c6
correct event ext
milt Sep 30, 2024
0c358b3
correct courseid
milt Sep 30, 2024
9be35cf
correct expected id
milt Sep 30, 2024
dcc0d43
http://id.tincanapi.com/activitytype/lms -> https://w3id.org/xapi/cmi…
milt Sep 30, 2024
6780908
try changing some number lol
milt Sep 30, 2024
0fc2741
Revert "try changing some number lol"
milt Sep 30, 2024
7e419da
let's try another
milt Sep 30, 2024
32be045
remove expected count switch for <3.9
milt Sep 30, 2024
50abe13
Merge pull request #15 from yetanalytics/course_created
milt Oct 1, 2024
ff667d8
Merge branch 'master' into course_completion_updated
milt Oct 1, 2024
db792aa
update course atype
milt Oct 1, 2024
e8a8e9b
Merge branch 'master' into course_completed
milt Oct 1, 2024
e76883f
Merge branch 'master' into course_category_created
milt Oct 1, 2024
0aae2ec
adds calendar_event_created and calendar_event_updated events
invaliduser Sep 18, 2024
a03416c
review changes
invaliduser Sep 25, 2024
a36d98c
ran test data through json_pp
invaliduser Sep 26, 2024
ec37c05
arrays for parent and category, updated through json_pp
invaliduser Sep 26, 2024
d228bb5
acct_name must be string
invaliduser Sep 26, 2024
fd9bf5c
removed xapi_test_case require clause
invaliduser Sep 27, 2024
adc53d5
calendar_event_deleted
invaliduser Sep 27, 2024
67d529f
fixed parse error
invaliduser Sep 30, 2024
a79546e
updated
invaliduser Sep 30, 2024
3081952
removed second array
invaliduser Sep 30, 2024
ded85a7
debugging
invaliduser Sep 30, 2024
a0fd9b2
fixed serialized test data
invaliduser Sep 30, 2024
c9ee3e2
escape json
invaliduser Sep 30, 2024
a030029
add-parent
invaliduser Sep 30, 2024
0220635
matched serialized data
invaliduser Sep 30, 2024
2f1cafb
update
invaliduser Oct 1, 2024
98d3c44
normalized to site and addParent
invaliduser Oct 1, 2024
8236d05
first crack
milt Oct 1, 2024
df77d29
fixed event name
milt Oct 1, 2024
02a78f5
remove copypasta
invaliduser Oct 1, 2024
0d84359
fix copypasta
milt Oct 1, 2024
bced8d3
add missing parent
milt Oct 1, 2024
e90f531
correct ID
milt Oct 1, 2024
d2a514f
fix more copypasta, mama mia
milt Oct 1, 2024
fba3e28
course section created
milt Oct 2, 2024
3801473
hack jisc test constants again
milt Oct 2, 2024
fd3fd34
Revert "hack jisc test constants again"
milt Oct 2, 2024
2491a15
trying something else
milt Oct 2, 2024
758b1f7
Revert "trying something else"
milt Oct 2, 2024
1f03f36
test fixes
invaliduser Oct 1, 2024
61c5c0d
comment out brittle tests until we can evaluate/rework them
milt Oct 2, 2024
f8083db
site name change
invaliduser Oct 2, 2024
6f4b3d0
Revert "comment out brittle tests until we can evaluate/rework them"
milt Oct 2, 2024
ff0e21c
try moving problematic tests for now
milt Oct 2, 2024
4945b82
Revert "try moving problematic tests for now"
milt Oct 2, 2024
7518686
while we're here, let's try a cache
milt Oct 2, 2024
283a191
Revert "while we're here, let's try a cache"
milt Oct 2, 2024
a87ce52
try disabling tests by annotation
milt Oct 2, 2024
f896b20
Revert "try disabling tests by annotation"
milt Oct 2, 2024
b666e3d
try another method of disabling tests
milt Oct 2, 2024
5ecaa73
antipasta
invaliduser Oct 2, 2024
dfc252f
course updated
milt Oct 2, 2024
c7cbfb1
course viewed updates
milt Oct 2, 2024
b10331b
parent overflow and removed logging
invaliduser Oct 2, 2024
0e34d49
Merge pull request #9 from yetanalytics/calendar
invaliduser Oct 2, 2024
9870174
first crack
milt Oct 2, 2024
a7fc6a5
Merge pull request #20 from yetanalytics/group_created
cliffcaseyyet Oct 3, 2024
59e1ddb
Merge branch 'master' into course_category_created
cliffcaseyyet Oct 3, 2024
df46457
Merge pull request #11 from yetanalytics/course_category_created
cliffcaseyyet Oct 3, 2024
d7d4847
Merge pull request #12 from yetanalytics/course_completed
cliffcaseyyet Oct 3, 2024
32dbe92
Merge branch 'master' into course_completion_updated
cliffcaseyyet Oct 3, 2024
00385e8
Merge pull request #14 from yetanalytics/course_completion_updated
cliffcaseyyet Oct 3, 2024
994a0ae
Merge branch 'master' into course_resource_list_viewed
cliffcaseyyet Oct 3, 2024
1781943
Merge pull request #16 from yetanalytics/course_resource_list_viewed
cliffcaseyyet Oct 3, 2024
1c16dd7
Merge branch 'master' into course_section_created
cliffcaseyyet Oct 3, 2024
44e16f4
Merge pull request #17 from yetanalytics/course_section_created
cliffcaseyyet Oct 3, 2024
b661944
Merge branch 'master' into course_updated
cliffcaseyyet Oct 3, 2024
e30e0e4
Merge pull request #18 from yetanalytics/course_updated
cliffcaseyyet Oct 3, 2024
b1b7fb1
Merge pull request #19 from yetanalytics/course_viewed
cliffcaseyyet Oct 3, 2024
62b9363
Change course module completion updated event based on completion state
milt Oct 8, 2024
b32bbcc
centrally dispatch for course module types
milt Oct 8, 2024
55e5ea7
tests for two states of cm completion update
milt Oct 8, 2024
f62951b
fix test copypasta
milt Oct 8, 2024
393abda
update contrib
milt Oct 8, 2024
f7d961a
make type actually optional
milt Oct 8, 2024
a7f392b
add contrib
milt Oct 8, 2024
ecc4e6c
update expected activity types, the reason for the season
milt Oct 8, 2024
9334160
formatting
milt Oct 8, 2024
7ff1b8b
fix feedback
milt Oct 8, 2024
569139e
update other instances of survey
milt Oct 8, 2024
d6f5f3c
don't set in quiz except in jisc case
milt Oct 8, 2024
21ad22d
fix forum
milt Oct 8, 2024
5a0e344
remove hard type from resource
milt Oct 9, 2024
b049970
remove forced type for book
milt Oct 9, 2024
8a29118
CMV changes
milt Oct 9, 2024
fa602c3
remove type arg from course module object builder
milt Oct 9, 2024
1d5cd81
add todo about module objects
milt Oct 9, 2024
ea8f04d
typo
milt Oct 9, 2024
0e21fd5
lots of json formatting
milt Oct 9, 2024
962872d
remove bad call to course_module in quiz helper
milt Oct 9, 2024
5b7811c
Merge pull request #21 from yetanalytics/course_module_completion_upd…
milt Oct 10, 2024
8b0ef15
Course module created (#22)
milt Oct 14, 2024
dabad95
remove bad formatting directives for json (#24)
milt Oct 15, 2024
edded30
Common test data (#25)
milt Oct 16, 2024
507cbbe
Ci workaround (#27)
milt Oct 16, 2024
6f7a829
Revert "Ci workaround (#27)" (#28)
milt Oct 17, 2024
7160440
Context Section (#26)
milt Oct 17, 2024
e8e5334
properly name and test group_created (#30)
milt Oct 17, 2024
105453f
discussion created, post created
cliffcaseyyet Oct 18, 2024
59e3372
Group deleted (#29)
milt Oct 21, 2024
355292c
Merge branch 'master' into forums_redo
cliffcaseyyet Oct 21, 2024
6ef2e48
post delete
cliffcaseyyet Oct 21, 2024
29dee2b
object cleanup and safety
cliffcaseyyet Oct 21, 2024
24f2414
post updated
cliffcaseyyet Oct 22, 2024
04f0474
messages
invaliduser Oct 15, 2024
58f85bd
forum and discussion subscriptions
cliffcaseyyet Oct 22, 2024
5eb9ea6
attribution
cliffcaseyyet Oct 22, 2024
af57c30
pr feedback
invaliduser Oct 22, 2024
806ef87
Fix scaling util (#37)
milt Oct 23, 2024
a4a95a2
say no2html
invaliduser Oct 23, 2024
5009e2a
post tests
cliffcaseyyet Oct 24, 2024
b6954fe
forum subscription tests
cliffcaseyyet Oct 24, 2024
c7fcce9
discussion subscription tests
cliffcaseyyet Oct 24, 2024
6fa074a
Merge branch 'master' into forums_redo
cliffcaseyyet Oct 24, 2024
1b44482
attribution stuff
cliffcaseyyet Oct 24, 2024
9f3df5c
group member added/removed (#31)
milt Oct 25, 2024
bc35868
group message sent (#32)
milt Oct 25, 2024
067cee1
Question created (#33)
milt Oct 25, 2024
81ea489
User Enrolment CUD (#35)
milt Oct 25, 2024
8ec991b
search results viewed (#36)
milt Oct 25, 2024
ae95743
h5p cmv (#39)
milt Oct 25, 2024
773e137
Log in/out/as (#41)
milt Oct 25, 2024
f5b0ef0
amend mod_assign assessable_submitted (#42)
milt Oct 25, 2024
7e144ca
mod_assign cmv (#43)
milt Oct 25, 2024
689f4b3
assignment feedback viewed (#44)
milt Oct 25, 2024
56754d8
Merge branch 'master' into forums_redo
cliffcaseyyet Oct 25, 2024
0e99b97
Assign submission graded (#45)
milt Oct 25, 2024
552fd43
Merge pull request #38 from yetanalytics/forums_redo
cliffcaseyyet Oct 25, 2024
2458863
questions imported (#34)
milt Oct 25, 2024
4a42b23
glossary entry viewed + test
cliffcaseyyet Oct 28, 2024
5851bf2
comment created and deleted + tests
cliffcaseyyet Oct 29, 2024
9d2abd7
simplify namespaces
cliffcaseyyet Oct 29, 2024
a9627e2
phpdoc on util
cliffcaseyyet Oct 29, 2024
c9f7355
covers anno
cliffcaseyyet Oct 29, 2024
66e8480
covers anno
cliffcaseyyet Oct 29, 2024
ace5b36
Merge pull request #47 from yetanalytics/glossary_cliff
cliffcaseyyet Oct 29, 2024
0b60941
Merge branch 'master' into forums_ns_fix
cliffcaseyyet Oct 29, 2024
1d3c194
Merge pull request #48 from yetanalytics/forums_ns_fix
cliffcaseyyet Oct 29, 2024
19e3f9b
json
invaliduser Oct 30, 2024
2a2b2fc
questionnaire statements and tests
cliffcaseyyet Oct 30, 2024
ad1e010
mod_book (#46)
milt Oct 31, 2024
8826e65
respect anonymous feedback
milt Nov 1, 2024
70446a5
Mod choice (#50)
milt Nov 4, 2024
cdb2b25
Merge branch 'master' into mod_feedback
milt Nov 4, 2024
02d62dc
pr feedback
invaliduser Nov 4, 2024
30e103d
extract choice code
milt Nov 4, 2024
faae5d3
migrate mod_feedback multichoice to helper fn
milt Nov 4, 2024
4f7a9a9
slug underscores to dashes
milt Nov 4, 2024
32ffc60
use ids in correctresponsespattern
milt Nov 4, 2024
1340248
fleshed out cmi render fns more
milt Nov 5, 2024
e0e0861
Merge pull request #51 from yetanalytics/mod_feedback
milt Nov 8, 2024
2e6102d
Centralize and refactor CMI rendering code (#53)
milt Nov 8, 2024
3e6e4e5
Capitalize all verb displays (#54)
milt Nov 8, 2024
990d96f
change $lang provenance
invaliduser Nov 11, 2024
8ae97a0
Merge pull request #49 from yetanalytics/questionnaire_cliff
cliffcaseyyet Nov 11, 2024
0b997d7
stricter equality
invaliduser Nov 11, 2024
12d4bb0
WIP lesson statements. pausing to work on repo test sort
cliffcaseyyet Nov 12, 2024
84da389
Merge branch 'master' into lesson_statements
cliffcaseyyet Nov 12, 2024
9bf19b3
Merge pull request #40 from yetanalytics/messages
invaliduser Nov 12, 2024
8f978d0
implemented test sort to allow for runtime sort
cliffcaseyyet Nov 12, 2024
c6889b1
Merge pull request #59 from yetanalytics/repo_query_features
cliffcaseyyet Nov 12, 2024
193c465
Merge branch 'master' into lesson_statements
cliffcaseyyet Nov 12, 2024
59a9600
badge_viewed
invaliduser Nov 8, 2024
3167a58
badge viewed and update
invaliduser Nov 12, 2024
3306821
use course module renderer and new atype (#56)
milt Nov 13, 2024
b713df1
hardcode all verb display ltags (#57)
milt Nov 13, 2024
b95ed96
lesson_ended reworks how the lesson object is detailed
cliffcaseyyet Nov 14, 2024
3cd5912
standardized lang
invaliduser Nov 14, 2024
e2c379c
tests for first 5 events
cliffcaseyyet Nov 14, 2024
0d02d07
added question_answered/viewed, tweaked lesson_ended
cliffcaseyyet Nov 15, 2024
7dc57b5
fixed module completion test
cliffcaseyyet Nov 18, 2024
6fa0ada
implemented essay, fixed up a few details in cmi activities
cliffcaseyyet Nov 18, 2024
5b44f40
added question viewed/answered tests for all cmi subtypes, and tweake…
cliffcaseyyet Nov 19, 2024
6affe1b
phpdocs fix
cliffcaseyyet Nov 19, 2024
2e8bd1b
lession-session activity type
cliffcaseyyet Nov 20, 2024
9275d62
newlines
cliffcaseyyet Nov 20, 2024
44cc2c1
Mod Survey (#58)
milt Nov 20, 2024
9a4570d
tool usertours (#63)
milt Nov 20, 2024
8fc1c51
Mod Wiki (#60)
milt Nov 20, 2024
469b6c1
Merge branch 'master' into lesson_statements
cliffcaseyyet Nov 21, 2024
5477c26
Merge pull request #62 from yetanalytics/lesson_statements
cliffcaseyyet Nov 21, 2024
ac0848a
Merge pull request #55 from yetanalytics/badge_viewed
invaliduser Nov 22, 2024
8cfa0a5
Tool certificate (#61)
milt Nov 22, 2024
a630517
Mod quiz (#64)
milt Nov 22, 2024
7053321
Mod assign (#65)
milt Nov 22, 2024
fe77291
Course module completion disambiguation (#66)
milt Nov 25, 2024
fdfa74c
notes (#52)
invaliduser Nov 25, 2024
e58ba23
Calendar subscription (#67)
milt Nov 25, 2024
29b32a3
badge updated (#68)
milt Nov 25, 2024
a7fc6a2
Field Consistency & Bugfixes (#69)
milt Dec 4, 2024
1982fdd
name is not an integer (#70)
milt Dec 12, 2024
723d35b
send group message recipients (#71)
milt Dec 12, 2024
e708dda
correct lesson session atype (#72)
milt Dec 12, 2024
e4849df
reenable test on pr (#73)
milt Dec 16, 2024
6ef0e99
remove trailing spaces on scorm serialized event data (#74)
milt Dec 17, 2024
7de3e58
PHP & Moodle Support Coverage (#75)
milt Dec 18, 2024
b7df514
curl comment cleanup
cliffcaseyyet Feb 4, 2025
e01d9f1
Merge pull request #76 from yetanalytics/curl_cleanup
cliffcaseyyet Feb 5, 2025
5328175
LMS Object Cleanup (#77)
milt Feb 7, 2025
8e4db73
Create config for context platform (#78)
milt Feb 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 6 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ indent_style = space
indent_size = 2
charset = utf-8

[*.{php,json}]
[*.{json}]
indent_size = 2
tab_width = 2
trim_trailing_whitespace=true

[*.{php}]
indent_size = 4
trim_trailing_whitespace=true
19 changes: 15 additions & 4 deletions .github/workflows/moodle-plugin-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,18 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.1']
moodle-branch: ['MOODLE_401_STABLE', 'MOODLE_402_STABLE']
php: ['8.1', '8.2', '8.3']
moodle-branch: ['MOODLE_401_STABLE', 'MOODLE_402_STABLE', 'MOODLE_403_STABLE', 'MOODLE_404_STABLE', 'MOODLE_405_STABLE']
database: [pgsql, mariadb]
exclude:
- php: '8.2'
moodle-branch: 'MOODLE_401_STABLE'
- php: '8.3'
moodle-branch: 'MOODLE_401_STABLE'
- php: '8.3'
moodle-branch: 'MOODLE_402_STABLE'
- php: '8.3'
moodle-branch: 'MOODLE_403_STABLE'

steps:
- name: Check out repository code
Expand Down Expand Up @@ -64,10 +73,11 @@ jobs:
cd plugin
composer install

- name: Install additional supported plugins (Moodle 4.0)
if: ${{ matrix.moodle-branch == 'MOODLE_401_STABLE' || matrix.moodle-branch == 'MOODLE_402_STABLE' }}
- name: Install additional supported plugins
run: |
moodle-plugin-ci add-plugin --branch MOODLE_400_STABLE catalyst/moodle-mod_facetoface
moodle-plugin-ci add-plugin --branch MOODLE_400_STABLE moodleworkplace/moodle-tool_certificate


- name: Install the plugin.
run: |
Expand All @@ -92,6 +102,7 @@ jobs:
run: moodle-plugin-ci phpmd

- name: Moodle Code Checker
continue-on-error: true # This step will show errors but will not fail
if: ${{ always() }}
run: moodle-plugin-ci codechecker --max-warnings 0

Expand Down
3 changes: 3 additions & 0 deletions classes/log/store.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,13 @@ protected function get_handler_config() {
'transformer' => [
'source_lang' => 'en',
'send_mbox' => $this->get_config('mbox', false),
'send_name' => $this->get_config('send_name', true),
'send_response_choices' => $this->get_config('sendresponsechoices', false),
'send_short_course_id' => $this->get_config('shortcourseid', false),
'send_course_and_module_idnumber' => $this->get_config('sendidnumber', false),
'send_username' => $this->get_config('send_username', false),
'account_homepage' => $this->get_config('account_homepage', $CFG->wwwroot),
'context_platform' => $this->get_config('context_platform', 'Moodle'),
'send_jisc_data' => $this->get_config('send_jisc_data', false),
'session_id' => sesskey(),
'plugin_url' => 'https://github.com/xAPI-vle/moodle-logstore_xapi',
Expand Down
22 changes: 11 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "xapi-vle/moodle-logstore-xapi",
"license": "GPL v3",
"require-dev": {
"learninglocker/statementfactory": "~0.0"
},
"require": {
"ext-json": "*"
},
"prefer-stable": true,
"minimum-stability": "dev"
}
"name": "xapi-vle/moodle-logstore-xapi",
"license": "GPL v3",
"require-dev": {
"yetanalytics/statementfactory": "v0.0.12"
},
"require": {
"ext-json": "*"
},
"prefer-stable": true,
"minimum-stability": "dev"
}
31 changes: 19 additions & 12 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions lang/en/logstore_xapi.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,14 @@
$string['filters_help'] = 'Enable filters that INCLUDE some actions to be logged.';
$string['mbox'] = 'Identify users by email';
$string['mbox_desc'] = 'Statements will identify users with their email (mbox) when this box is ticked.';
$string['send_name'] = 'Set the actor name field';
$string['send_name_desc'] = 'Will add the user fullname to the actor name field when ticked.';
$string['send_username'] = 'Identify users by username';
$string['send_username_desc'] = 'Statements will identify users with their username when this box is ticked, but only if identifying users by email is disabled.';
$string['account_homepage'] = 'Actor Account HomePage';
$string['account_homepage_desc'] = 'Set the homePage field for actor accounts. Defaults to the app_url.';
$string['context_platform'] = 'Context Platform';
$string['context_platform_desc'] = 'Set the context platform field of xAPI statements. Defaults to "Moodle".';
$string['send_jisc_data'] = 'Adds JISC data to statements';
$string['send_jisc_data_desc'] = 'Statements will contain data required by JISC.';
$string['shortcourseid'] = 'Send short course name';
Expand Down
12 changes: 12 additions & 0 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@
get_string('mbox', 'logstore_xapi'),
get_string('mbox_desc', 'logstore_xapi'), 0));

$settings->add(new admin_setting_configcheckbox('logstore_xapi/send_name',
get_string('send_name', 'logstore_xapi'),
get_string('send_name_desc', 'logstore_xapi'), 1));

$settings->add(new admin_setting_configcheckbox('logstore_xapi/shortcourseid',
get_string('shortcourseid', 'logstore_xapi'),
get_string('shortcourseid_desc', 'logstore_xapi'), 0));
Expand All @@ -80,6 +84,14 @@
get_string('send_username', 'logstore_xapi'),
get_string('send_username_desc', 'logstore_xapi'), 0));

$settings->add(new admin_setting_configtext('logstore_xapi/account_homepage',
get_string('account_homepage', 'logstore_xapi'),
get_string('account_homepage_desc', 'logstore_xapi'), $CFG->wwwroot, PARAM_TEXT));

$settings->add(new admin_setting_configtext('logstore_xapi/context_platform',
get_string('context_platform', 'logstore_xapi'),
get_string('context_platform_desc', 'logstore_xapi'), 'Moodle', PARAM_TEXT));

$settings->add(new admin_setting_configcheckbox('logstore_xapi/send_jisc_data',
get_string('send_jisc_data', 'logstore_xapi'),
get_string('send_jisc_data_desc', 'logstore_xapi'), 0));
Expand Down
2 changes: 1 addition & 1 deletion src/loader/lrs.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function load(array $config, array $events) {
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($request, CURLOPT_HTTPHEADER, [
'Authorization: Basic '.$auth,
'X-Experience-API-Version: 1.0.0',
'X-Experience-API-Version: 1.0.3',
'Content-Type: application/json',
]);

Expand Down
20 changes: 12 additions & 8 deletions src/loader/moodle_curl_lrs.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,19 @@ function load(array $config, array $events) {
throw new \Exception('JSON encode error: '.json_last_error_msg());
}

$request = new \curl();
$responsetext = $request->post($url, $postdata, [
'CURLOPT_HTTPHEADER' => [
'Authorization: Basic '.$auth,
'X-Experience-API-Version: 1.0.0',
'Content-Type: application/json',
],
$request = curl_init();
curl_setopt($request, CURLOPT_URL, $url);
curl_setopt($request, CURLOPT_POSTFIELDS, $postdata);
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($request, CURLOPT_HTTPHEADER, [
'Authorization: Basic '.$auth,
'X-Experience-API-Version: 1.0.3',
'Content-Type: application/json',
]);
$responsecode = $request->info['http_code'];

$responsetext = curl_exec($request);
$responsecode = curl_getinfo($request, CURLINFO_RESPONSE_CODE);

if ($responsecode !== 200) {
throw new \Exception($responsetext, $responsecode);
Expand Down
19 changes: 8 additions & 11 deletions src/transformer/events/all/course_module_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,29 +46,26 @@ function course_module_viewed(array $config, \stdClass $event) {
'verb' => [
'id' => 'http://id.tincanapi.com/verb/viewed',
'display' => [
$lang => 'viewed'
'en' => 'Viewed'
],
],
'object' => utils\get_activity\course_module(
$config,
$course,
$event->contextinstanceid,
'http://id.tincanapi.com/activitytype/lms/module'
$event->contextinstanceid
),
'timestamp' => utils\get_event_timestamp($event),
'context' => [
'platform' => $config['source_name'],
'language' => $lang,
'extensions' => utils\extensions\base($config, $event, $course),
'contextActivities' => [
'grouping' => [
'parent' => utils\context_activities\get_parent(
$config,
$event->contextinstanceid
),
'category' => [
utils\get_activity\site($config),
utils\get_activity\course($config, $course),
],
'category' => [
utils\get_activity\source($config),
]
],
]
],
]];
}
97 changes: 97 additions & 0 deletions src/transformer/events/core/badge_awarded.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Transform for badge awarded event.
*
* @package logstore_xapi
* @copyright Daniel Bell <daniel@yetanalytics.com>
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace src\transformer\events\core;
use src\transformer\utils as utils;

/**
* Transforms badge_awarded event to an "Achieved" xapi event
*
* @param array $config The transformer config settings.
* @param \stdClass $event The event to be transformed.
* @return array
*/

function badge_awarded(array $config, \stdClass $event) {
global $CFG;
$repo = $config['repo'];
if (isset($event->objecttable) && isset($event->objectid)) {
$event_object = $repo->read_record_by_id($event->objecttable, $event->objectid);
} else {
$event_object = array();
}

$recipient = $repo->read_record_by_id('user', $event->relateduserid);
$actor = utils\get_user($config, $recipient);

$badge = $repo->read_record_by_id('badge', $event->objectid);
$course = $badge->courseid ? $repo->read_record_by_id('course', $badge->courseid) : null;

$lang = $badge->language ??
((!(is_null($course))) ?
utils\get_course_lang($course) :
$config['source_lang']);

$other = unserialize($event->other);
$issuedid = $other['badgeissuedid'];

$manual = $repo->read_record_by_id('badge_manual_award', $issuedid);
$awarder = $manual ? (utils\get_user($config, $repo->read_record_by_id('user', $manual->issuerid))) : 'System';

$statement = [[
'actor' => $actor,
'verb' => [
'id' => 'https://w3id.org/xapi/tla/verbs/achieved',
'display' => [
'en' => 'Achieved'
]],
'object' => utils\get_activity\badge($config, $lang, $badge),
'result' => [
'response' => $badge->message
],
'context' => [
...utils\get_context_base($config, $event, $lang, $course),
'instructor' => $awarder,
'contextActivities' => [
'category' => [
utils\get_activity\site($config),
],
],
'extensions' => array_merge(utils\extensions\base($config, $event, $course),[
'https://xapi.edlm/profiles/edlm-lms/v1/concepts/context-extensions/badge-assignment-method' => ($manual ? 'Manual' : 'Automatic')])
]]];
if ($course){
$statement[0]['context']['contextActivities']['parent'] = [[
'id' => $config['app_url'].'/course/view.php?id='.$course->id,
'objectType' => 'Activity',
'definition' => [
'name' => [$lang => $course->fullname],
'description' => [$lang => $course->summary],
'type' => 'https://w3id.org/xapi/cmi5/activitytype/course'
]
]];
}

return $statement;
}
Loading
Loading