-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(mod_book/chapter_viewed): Statements for chapters without parents (…
- Loading branch information
Showing
9 changed files
with
166 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
tests/mod_book/chapter_viewed/existing_chapter_viewed_without_parent/data.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"user": [ | ||
{ | ||
"id": 1, | ||
"firstname": "test_fullname", | ||
"email": "test@test.com" | ||
} | ||
], | ||
"course": [ | ||
{ | ||
"id": 1, | ||
"fullname": "test_name", | ||
"lang": "en" | ||
} | ||
], | ||
"course_modules": [ | ||
{ | ||
"id": 1, | ||
"course": 1, | ||
"module": 1, | ||
"instance": 1 | ||
} | ||
], | ||
"modules": [ | ||
{ | ||
"id": 1, | ||
"name": "book" | ||
} | ||
], | ||
"book": [ | ||
{ | ||
"id": 1, | ||
"name": "test_book_name" | ||
} | ||
], | ||
"book_chapters": [ | ||
{ | ||
"id": 1, | ||
"bookid": "1", | ||
"pagenum": "1", | ||
"subchapter": "0", | ||
"title": "test_book_chapter_title", | ||
"content": "<p>test_book_chapter_content</p>" | ||
} | ||
] | ||
} |
10 changes: 10 additions & 0 deletions
10
tests/mod_book/chapter_viewed/existing_chapter_viewed_without_parent/event.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"id": 1, | ||
"userid": 1, | ||
"courseid": 1, | ||
"timecreated": 1433946701, | ||
"objecttable": "book_chapters", | ||
"objectid": 1, | ||
"contextinstanceid": 1, | ||
"eventname": "\\mod_book\\event\\chapter_viewed" | ||
} |
84 changes: 84 additions & 0 deletions
84
tests/mod_book/chapter_viewed/existing_chapter_viewed_without_parent/statements.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
[ | ||
{ | ||
"actor": { | ||
"name": "test_fullname", | ||
"account": { | ||
"homePage": "http:\/\/www.example.org", | ||
"name": "1" | ||
} | ||
}, | ||
"verb": { | ||
"id": "http:\/\/id.tincanapi.com\/verb\/viewed", | ||
"display": { | ||
"en": "viewed" | ||
} | ||
}, | ||
"object": { | ||
"id": "http:\/\/www.example.org\/mod\/book\/view.php?id=1&chapterid=1", | ||
"definition": { | ||
"type": "http:\/\/id.tincanapi.com\/activitytype\/chapter", | ||
"name": { | ||
"en": "test_book_chapter_title" | ||
}, | ||
"description": { | ||
"en": "test_book_chapter_content" | ||
} | ||
} | ||
}, | ||
"timestamp": "2015-06-10T15:31:41+01:00", | ||
"context": { | ||
"platform": "Moodle", | ||
"language": "en", | ||
"extensions": { | ||
"http:\/\/lrs.learninglocker.net\/define\/extensions\/info": { | ||
"http:\/\/moodle.org": "1.0.0", | ||
"https:\/\/github.com\/xAPI-vle\/moodle-logstore_xapi": "0.0.0-development", | ||
"event_name": "\\mod_book\\event\\chapter_viewed", | ||
"event_function": "\\src\\transformer\\events\\mod_book\\chapter_viewed" | ||
} | ||
}, | ||
"contextActivities": { | ||
"grouping": [ | ||
{ | ||
"id": "http:\/\/www.example.org", | ||
"definition": { | ||
"type": "http:\/\/id.tincanapi.com\/activitytype\/lms", | ||
"name": { | ||
"en": "test_name" | ||
} | ||
} | ||
}, | ||
{ | ||
"id": "http:\/\/www.example.org\/course\/view.php?id=1", | ||
"definition": { | ||
"type": "http:\/\/id.tincanapi.com\/activitytype\/lms\/course", | ||
"name": { | ||
"en": "test_name" | ||
} | ||
} | ||
}, | ||
{ | ||
"id": "http:\/\/www.example.org\/mod\/book\/view.php?id=1", | ||
"definition": { | ||
"type": "http:\/\/id.tincanapi.com\/activitytype\/book", | ||
"name": { | ||
"en": "test_book_name" | ||
} | ||
} | ||
} | ||
], | ||
"category": [ | ||
{ | ||
"id": "http:\/\/moodle.org", | ||
"definition": { | ||
"type": "http:\/\/id.tincanapi.com\/activitytype\/source", | ||
"name": { | ||
"en": "Moodle" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] |
24 changes: 24 additions & 0 deletions
24
tests/mod_book/chapter_viewed/existing_chapter_viewed_without_parent/test.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?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/>. | ||
|
||
namespace tests\mod_book\chapter_viewed\existing_chapter_viewed_without_parent; | ||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
class test extends \tests\xapi_test_case { | ||
protected function get_test_dir() { | ||
return __DIR__; | ||
} | ||
} |