API for sharing a number of Moodle LMS activities as a course backup to MoodleNet instances.
More...
|
| __construct (int $courseid, protected int $userid, protected moodlenet_client $moodlenetclient, protected client $oauthclient, protected array $cmids, protected int $shareformat=self::SHARE_FORMAT_BACKUP,) |
| Constructor for course sender.
|
|
| share_resource () |
| Share a course to MoodleNet.
|
|
|
int const | MAX_FILESIZE = 1070000000 |
| Maximum upload file size (1.07 GB).
|
|
int const | SHARE_FORMAT_BACKUP = 0 |
| Backup share format - the content is being shared as a Moodle backup file.
|
|
API for sharing a number of Moodle LMS activities as a course backup to MoodleNet instances.
- Copyright
- 2023 Huong Nguyen huong.nosp@m.nv13.nosp@m.@gmai.nosp@m.l.co.nosp@m.m
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
core\moodlenet\course_partial_sender::__construct |
( |
int | $courseid, |
|
|
protected int | $userid, |
|
|
protected moodlenet_client | $moodlenetclient, |
|
|
protected client | $oauthclient, |
|
|
protected array | $cmids, |
|
|
protected int | $shareformat = self::SHARE_FORMAT_BACKUP ) |
Constructor for course sender.
- Parameters
-
int | $courseid | The course ID of the course being shared |
int | $userid | The user ID who is sharing the activity |
moodlenet_client | $moodlenetclient | The moodlenet_client object used to perform the share |
client | $oauthclient | The OAuth 2 client for the MoodleNet instance |
int | $shareformat | The data format to share in. Defaults to a Moodle backup (SHARE_FORMAT_BACKUP) |
◆ get_allowed_share_formats()
static core\moodlenet\course_sender::get_allowed_share_formats |
( |
| ) |
|
|
staticprotectedinherited |
Return the list of supported share formats.
- Return values
-
array | Array of supported share format values. |
Reimplemented from core\moodlenet\resource_sender.
◆ get_resource_description()
core\moodlenet\course_sender::get_resource_description |
( |
| ) |
|
|
protectedinherited |
Fetch the description for the resource being created, in a supported text format.
- Return values
-
string | Converted course description. |
◆ log_event()
core\moodlenet\course_partial_sender::log_event |
( |
string | $resourceurl, |
|
|
int | $responsecode ) |
|
protected |
Log an event to the admin logs for an outbound share attempt.
- Parameters
-
string | $resourceurl | The URL of the draft resource if it was created |
int | $responsecode | The HTTP response code describing the outcome of the attempt |
- Return values
-
Reimplemented from core\moodlenet\course_sender.
◆ prepare_share_contents()
core\moodlenet\resource_sender::prepare_share_contents |
( |
| ) |
|
|
protectedinherited |
Prepare the data for sharing, in the format specified.
- Return values
-
◆ share_resource()
core\moodlenet\course_sender::share_resource |
( |
| ) |
|
|
inherited |
Share a course to MoodleNet.
- Return values
-
array | The HTTP response code from MoodleNet and the MoodleNet draft resource URL (URL empty string on fail). Format: ['responsecode' => 201, 'drafturl' => 'https://draft.mnurl/here'] |
Reimplemented from core\moodlenet\resource_sender.
◆ validate_course_module_ids()
core\moodlenet\course_partial_sender::validate_course_module_ids |
( |
stdClass | $course, |
|
|
array | $cmids ) |
|
protected |
Validate the course module ids.
- Parameters
-
stdClass | $course | Course object |
array | $cmids | List of course module ids to check |
- Return values
-
The documentation for this class was generated from the following file: