mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 13:38:32 +01:00
Merge branch 'MDL-44717-master' of git://github.com/ankitagarwal/moodle
This commit is contained in:
commit
9632cad16b
@ -174,6 +174,8 @@ class core_bloglib_testcase extends advanced_testcase {
|
||||
|
||||
// Validate event data.
|
||||
$this->assertInstanceOf('\core\event\blog_entry_created', $event);
|
||||
$url = new moodle_url('/blog/index.php', array('entryid' => $event->objectid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
$this->assertEquals($sitecontext->id, $event->contextid);
|
||||
$this->assertEquals($blog->id, $event->objectid);
|
||||
$this->assertEquals($USER->id, $event->userid);
|
||||
@ -207,6 +209,8 @@ class core_bloglib_testcase extends advanced_testcase {
|
||||
|
||||
// Validate event data.
|
||||
$this->assertInstanceOf('\core\event\blog_entry_updated', $event);
|
||||
$url = new moodle_url('/blog/index.php', array('entryid' => $event->objectid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
$this->assertEquals($sitecontext->id, $event->contextid);
|
||||
$this->assertEquals($blog->id, $event->objectid);
|
||||
$this->assertEquals($USER->id, $event->userid);
|
||||
@ -240,6 +244,7 @@ class core_bloglib_testcase extends advanced_testcase {
|
||||
|
||||
// Validate event data.
|
||||
$this->assertInstanceOf('\core\event\blog_entry_deleted', $event);
|
||||
$this->assertEquals(null, $event->get_url());
|
||||
$this->assertEquals($sitecontext->id, $event->contextid);
|
||||
$this->assertEquals($blog->id, $event->objectid);
|
||||
$this->assertEquals($USER->id, $event->userid);
|
||||
@ -278,6 +283,8 @@ class core_bloglib_testcase extends advanced_testcase {
|
||||
// Validate event data.
|
||||
$this->assertInstanceOf('\core\event\blog_association_created', $event);
|
||||
$this->assertEquals($sitecontext->id, $event->contextid);
|
||||
$url = new moodle_url('/blog/index.php', array('entryid' => $event->other['blogid']));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
$this->assertEquals($blog->id, $event->other['blogid']);
|
||||
$this->assertEquals($this->courseid, $event->other['associateid']);
|
||||
$this->assertEquals('course', $event->other['associatetype']);
|
||||
|
@ -104,6 +104,8 @@ class core_cohort_cohortlib_testcase extends advanced_testcase {
|
||||
$this->assertEquals('cohort', $event->objecttable);
|
||||
$this->assertEquals($id, $event->objectid);
|
||||
$this->assertEquals($cohort->contextid, $event->contextid);
|
||||
$url = new moodle_url('/cohort/index.php', array('contextid' => $event->contextid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
$this->assertEquals($cohort, $event->get_record_snapshot('cohort', $id));
|
||||
$this->assertEventLegacyData($cohort, $event);
|
||||
$this->assertEventContextNotUsed($event);
|
||||
@ -175,6 +177,8 @@ class core_cohort_cohortlib_testcase extends advanced_testcase {
|
||||
$this->assertEquals('cohort', $event->objecttable);
|
||||
$this->assertEquals($updatedcohort->id, $event->objectid);
|
||||
$this->assertEquals($updatedcohort->contextid, $event->contextid);
|
||||
$url = new moodle_url('/cohort/edit.php', array('id' => $event->objectid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
$this->assertEquals($cohort, $event->get_record_snapshot('cohort', $id));
|
||||
$this->assertEventLegacyData($cohort, $event);
|
||||
$this->assertEventContextNotUsed($event);
|
||||
@ -213,6 +217,8 @@ class core_cohort_cohortlib_testcase extends advanced_testcase {
|
||||
$this->assertInstanceOf('\core\event\cohort_deleted', $event);
|
||||
$this->assertEquals('cohort', $event->objecttable);
|
||||
$this->assertEquals($cohort->id, $event->objectid);
|
||||
$url = new moodle_url('/cohort/index.php', array('contextid' => $event->contextid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
$this->assertEquals($cohort, $event->get_record_snapshot('cohort', $cohort->id));
|
||||
$this->assertEventLegacyData($cohort, $event);
|
||||
$this->assertEventContextNotUsed($event);
|
||||
@ -272,6 +278,8 @@ class core_cohort_cohortlib_testcase extends advanced_testcase {
|
||||
$this->assertEquals($cohort->id, $event->objectid);
|
||||
$this->assertEquals($user->id, $event->relateduserid);
|
||||
$this->assertEquals($USER->id, $event->userid);
|
||||
$url = new moodle_url('/cohort/assign.php', array('id' => $event->objectid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
$this->assertEventLegacyData((object) array('cohortid' => $cohort->id, 'userid' => $user->id), $event);
|
||||
$this->assertEventContextNotUsed($event);
|
||||
}
|
||||
@ -316,6 +324,8 @@ class core_cohort_cohortlib_testcase extends advanced_testcase {
|
||||
$this->assertEquals($cohort->id, $event->objectid);
|
||||
$this->assertEquals($user->id, $event->relateduserid);
|
||||
$this->assertEquals($USER->id, $event->userid);
|
||||
$url = new moodle_url('/cohort/assign.php', array('id' => $event->objectid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
$this->assertEventLegacyData((object) array('cohortid' => $cohort->id, 'userid' => $user->id), $event);
|
||||
$this->assertEventContextNotUsed($event);
|
||||
}
|
||||
|
@ -1496,6 +1496,8 @@ class core_course_courselib_testcase extends advanced_testcase {
|
||||
$this->assertEquals('course', $event->objecttable);
|
||||
$this->assertEquals($updatedcourse->id, $event->objectid);
|
||||
$this->assertEquals(context_course::instance($course->id), $event->get_context());
|
||||
$url = new moodle_url('/course/edit.php', array('id' => $event->objectid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
$this->assertEquals($updatedcourse, $event->get_record_snapshot('course', $event->objectid));
|
||||
$this->assertEquals('course_updated', $event->get_legacy_eventname());
|
||||
$this->assertEventLegacyData($updatedcourse, $event);
|
||||
@ -1666,6 +1668,7 @@ class core_course_courselib_testcase extends advanced_testcase {
|
||||
$this->assertEquals($category->id, $event->objectid);
|
||||
$this->assertEquals($categorycontext->id, $event->contextid);
|
||||
$this->assertEquals('course_category_deleted', $event->get_legacy_eventname());
|
||||
$this->assertEquals(null, $event->get_url());
|
||||
$this->assertEventLegacyData($category, $event);
|
||||
$expectedlog = array(SITEID, 'category', 'delete', 'index.php', $category->name . '(ID ' . $category->id . ')');
|
||||
$this->assertEventLegacyLogData($expectedlog, $event);
|
||||
@ -1762,6 +1765,8 @@ class core_course_courselib_testcase extends advanced_testcase {
|
||||
'operation' => $rc->get_operation(),
|
||||
'samesite' => $rc->is_samesite()
|
||||
);
|
||||
$url = new moodle_url('/course/view.php', array('id' => $event->objectid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
$this->assertEventLegacyData($legacydata, $event);
|
||||
$this->assertEventContextNotUsed($event);
|
||||
|
||||
@ -1813,6 +1818,8 @@ class core_course_courselib_testcase extends advanced_testcase {
|
||||
$this->assertEquals($coursecontext->id, $event->contextid);
|
||||
$expecteddesc = 'Course ' . $event->courseid . ' section ' . $event->other['sectionnum'] . ' updated by user ' . $event->userid;
|
||||
$this->assertEquals($expecteddesc, $event->get_description());
|
||||
$url = new moodle_url('/course/editsection.php', array('id' => $event->objectid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
$this->assertEquals($section, $event->get_record_snapshot('course_sections', $event->objectid));
|
||||
$id = $section->id;
|
||||
$sectionnum = $section->section;
|
||||
|
@ -547,6 +547,8 @@ class enrol_meta_plugin_testcase extends advanced_testcase {
|
||||
$expectedlegacyeventdata = $dbuserenrolled;
|
||||
$expectedlegacyeventdata->enrol = 'meta';
|
||||
$expectedlegacyeventdata->courseid = $course2->id;
|
||||
$url = new \moodle_url('/enrol/editenrolment.php', array('ue' => $event->objectid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
$this->assertEventLegacyData($expectedlegacyeventdata, $event);
|
||||
$this->assertEventContextNotUsed($event);
|
||||
}
|
||||
|
@ -62,6 +62,8 @@ class core_group_lib_testcase extends advanced_testcase {
|
||||
$this->assertEquals($user->id, $event->relateduserid);
|
||||
$this->assertEquals(context_course::instance($course->id), $event->get_context());
|
||||
$this->assertEquals($group->id, $event->objectid);
|
||||
$url = new moodle_url('/group/members.php', array('group' => $event->objectid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
}
|
||||
|
||||
public function test_member_removed_event() {
|
||||
@ -89,6 +91,8 @@ class core_group_lib_testcase extends advanced_testcase {
|
||||
$this->assertEquals($user->id, $event->relateduserid);
|
||||
$this->assertEquals(context_course::instance($course->id), $event->get_context());
|
||||
$this->assertEquals($group->id, $event->objectid);
|
||||
$url = new moodle_url('/group/members.php', array('group' => $event->objectid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
}
|
||||
|
||||
public function test_group_created_event() {
|
||||
@ -108,6 +112,8 @@ class core_group_lib_testcase extends advanced_testcase {
|
||||
$this->assertSame('groups_group_created', $event->get_legacy_eventname());
|
||||
$this->assertEquals(context_course::instance($course->id), $event->get_context());
|
||||
$this->assertEquals($group->id, $event->objectid);
|
||||
$url = new moodle_url('/group/index.php', array('id' => $event->courseid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
}
|
||||
|
||||
public function test_grouping_created_event() {
|
||||
@ -129,6 +135,8 @@ class core_group_lib_testcase extends advanced_testcase {
|
||||
|
||||
$this->assertEquals(context_course::instance($course->id), $event->get_context());
|
||||
$this->assertEquals($group->id, $event->objectid);
|
||||
$url = new moodle_url('/group/groupings.php', array('id' => $event->courseid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
}
|
||||
|
||||
public function test_group_updated_event() {
|
||||
@ -158,6 +166,8 @@ class core_group_lib_testcase extends advanced_testcase {
|
||||
$this->assertSame('groups_group_updated', $event->get_legacy_eventname());
|
||||
$this->assertEquals(context_course::instance($course->id), $event->get_context());
|
||||
$this->assertEquals($group->id, $event->objectid);
|
||||
$url = new moodle_url('/group/group.php', array('id' => $event->objectid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
}
|
||||
|
||||
public function test_grouping_updated_event() {
|
||||
@ -196,6 +206,8 @@ class core_group_lib_testcase extends advanced_testcase {
|
||||
|
||||
$this->assertEquals(context_course::instance($course->id), $event->get_context());
|
||||
$this->assertEquals($grouping->id, $event->objectid);
|
||||
$url = new moodle_url('/group/grouping.php', array('id' => $event->objectid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
}
|
||||
|
||||
public function test_group_deleted_event() {
|
||||
@ -215,6 +227,8 @@ class core_group_lib_testcase extends advanced_testcase {
|
||||
$this->assertSame('groups_group_deleted', $event->get_legacy_eventname());
|
||||
$this->assertEquals(context_course::instance($course->id), $event->get_context());
|
||||
$this->assertEquals($group->id, $event->objectid);
|
||||
$url = new moodle_url('/group/index.php', array('id' => $event->courseid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
}
|
||||
|
||||
public function test_grouping_deleted_event() {
|
||||
@ -234,6 +248,8 @@ class core_group_lib_testcase extends advanced_testcase {
|
||||
$this->assertSame('groups_grouping_deleted', $event->get_legacy_eventname());
|
||||
$this->assertEquals(context_course::instance($course->id), $event->get_context());
|
||||
$this->assertEquals($group->id, $event->objectid);
|
||||
$url = new moodle_url('/group/groupings.php', array('id' => $event->courseid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
}
|
||||
|
||||
public function test_groups_delete_group_members() {
|
||||
|
@ -87,7 +87,7 @@ $string['entryerrornotyours'] = 'This entry is not yours';
|
||||
$string['entrysaved'] = 'Your entry has been saved';
|
||||
$string['entrytitle'] = 'Entry title';
|
||||
$string['eventblogentriesviewed'] = 'Blog entries viewed';
|
||||
$string['eventblogassociationcreated'] = 'Blog association created';
|
||||
$string['eventblogassociationadded'] = 'Blog association created';
|
||||
$string['evententryadded'] = 'Blog entry added';
|
||||
$string['evententrydeleted'] = 'Blog entry deleted';
|
||||
$string['evententryupdated'] = 'Blog entry updated';
|
||||
|
@ -37,7 +37,7 @@ $string['deletenotes'] = 'Delete all notes';
|
||||
$string['editnote'] = 'Edit note';
|
||||
$string['enablenotes'] = 'Enable notes';
|
||||
$string['eventnotecreated'] = 'Note created';
|
||||
$string['eventnoteupdate'] = 'Note updated';
|
||||
$string['eventnoteupdated'] = 'Note updated';
|
||||
$string['eventnotedeleted'] = 'Note deleted';
|
||||
$string['eventnotesviewed'] = 'Notes viewed';
|
||||
$string['groupaddnewnote'] = 'Add a common note';
|
||||
|
@ -85,6 +85,7 @@ $string['erroroptionalparamarray'] = 'The web service description parameter name
|
||||
$string['event_webservice_function_called'] = 'Web service function called';
|
||||
$string['event_webservice_login_failed'] = 'Web service login failed';
|
||||
$string['event_webservice_service_created'] = 'Web service service created';
|
||||
$string['event_webservice_service_deleted'] = 'Web service service deleted';
|
||||
$string['event_webservice_service_updated'] = 'Web service service updated';
|
||||
$string['event_webservice_service_user_added'] = 'Web service service user added';
|
||||
$string['event_webservice_service_user_removed'] = 'Web service service user removed';
|
||||
|
@ -345,6 +345,7 @@ abstract class base implements \IteratorAggregate {
|
||||
return false;
|
||||
}
|
||||
|
||||
$event->init(); // Init method of events could be setting custom properties.
|
||||
$event->restored = true;
|
||||
$event->triggered = true;
|
||||
$event->dispatched = true;
|
||||
|
@ -78,7 +78,7 @@ class blog_association_created extends \core\event\base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('/blog/index.php', array('entryid' => $this->objectid, 'userid' => $this->userid));
|
||||
return new \moodle_url('/blog/index.php', array('entryid' => $this->other['blogid']));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -94,7 +94,7 @@ class blog_entry_created extends \core\event\base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('/blog/index.php', array('entryid' => $this->objectid, 'userid' => $this->userid));
|
||||
return new \moodle_url('/blog/index.php', array('entryid' => $this->objectid));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -92,7 +92,7 @@ class blog_entry_updated extends base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('/blog/index.php', array('entryid' => $this->objectid, 'userid' => $this->userid));
|
||||
return new \moodle_url('/blog/index.php', array('entryid' => $this->objectid));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -51,7 +51,7 @@ class cohort_deleted extends base {
|
||||
* @return string
|
||||
*/
|
||||
public static function get_name() {
|
||||
return get_string('event_core_deleted', 'core_cohort');
|
||||
return get_string('event_cohort_deleted', 'core_cohort');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -45,6 +45,15 @@ class course_category_created extends base {
|
||||
return get_string('eventcoursecategorycreated');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns relevant URL.
|
||||
*
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('/course/management.php', array('categoryid' => $this->objectid));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns non-localised description of what happened.
|
||||
*
|
||||
|
@ -48,6 +48,15 @@ class course_category_updated extends base {
|
||||
return get_string('eventcoursecategoryupdated');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns relevant URL.
|
||||
*
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('/course/editcategory.php', array('id' => $this->objectid));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns non-localised description of what happened.
|
||||
*
|
||||
|
@ -42,8 +42,8 @@ defined('MOODLE_INTERNAL') || die();
|
||||
*/
|
||||
abstract class course_module_instance_list_viewed extends base{
|
||||
|
||||
/** @var string private var to store mod name */
|
||||
private $modname;
|
||||
/** @var string protected var to store mod name */
|
||||
protected $modname;
|
||||
|
||||
/**
|
||||
* Init method.
|
||||
|
@ -70,7 +70,7 @@ class course_updated extends base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('/course/view.php', array('id' => $this->objectid));
|
||||
return new \moodle_url('/course/edit.php', array('id' => $this->objectid));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -53,7 +53,7 @@ class group_member_added extends \core\event\base {
|
||||
/**
|
||||
* Legacy event data if get_legacy_eventname() is not empty.
|
||||
*
|
||||
* @return stdClass
|
||||
* @return \stdClass
|
||||
*/
|
||||
protected function get_legacy_eventdata() {
|
||||
$eventdata = new \stdClass();
|
||||
@ -88,7 +88,7 @@ class group_member_added extends \core\event\base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('/group/index.php', array('id' => $this->courseid));
|
||||
return new \moodle_url('/group/members.php', array('group' => $this->objectid));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -46,7 +46,7 @@ class group_member_removed extends \core\event\base {
|
||||
/**
|
||||
* Legacy event data if get_legacy_eventname() is not empty.
|
||||
*
|
||||
* @return stdClass
|
||||
* @return \stdClass
|
||||
*/
|
||||
protected function get_legacy_eventdata() {
|
||||
$eventdata = new \stdClass();
|
||||
@ -79,7 +79,7 @@ class group_member_removed extends \core\event\base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('/group/index.php', array('id' => $this->courseid));
|
||||
return new \moodle_url('/group/members.php', array('group' => $this->objectid));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -76,7 +76,7 @@ class group_updated extends \core\event\base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('/group/index.php', array('id' => $this->courseid));
|
||||
return new \moodle_url('/group/group.php', array('id' => $this->objectid));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -76,7 +76,7 @@ class grouping_created extends \core\event\base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('/group/groupings/index.php', array('id' => $this->courseid));
|
||||
return new \moodle_url('/group/groupings.php', array('id' => $this->courseid));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -83,7 +83,7 @@ class grouping_deleted extends \core\event\base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('/group/groupings/index.php', array('id' => $this->courseid));
|
||||
return new \moodle_url('/group/groupings.php', array('id' => $this->courseid));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -76,7 +76,7 @@ class grouping_updated extends \core\event\base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('/group/groupings/index.php', array('id' => $this->courseid));
|
||||
return new \moodle_url('/group/grouping.php', array('id' => $this->objectid));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -51,7 +51,7 @@ class message_contact_added extends base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('message/index.php', array('user1' => $this->relateduserid, 'user2' => $this->userid));
|
||||
return new \moodle_url('/message/index.php', array('user1' => $this->userid, 'user2' => $this->relateduserid));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -51,7 +51,7 @@ class message_contact_blocked extends base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('message/index.php', array('user1' => $this->relateduserid, 'user2' => $this->userid));
|
||||
return new \moodle_url('/message/index.php', array('user1' => $this->userid, 'user2' => $this->relateduserid));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -51,7 +51,7 @@ class message_contact_removed extends base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('message/index.php', array('user1' => $this->relateduserid, 'user2' => $this->userid));
|
||||
return new \moodle_url('/message/index.php', array('user1' => $this->userid, 'user2' => $this->relateduserid));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -51,7 +51,7 @@ class message_contact_unblocked extends base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('message/index.php', array('user1' => $this->relateduserid, 'user2' => $this->userid));
|
||||
return new \moodle_url('/message/index.php', array('user1' => $this->userid, 'user2' => $this->relateduserid));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -57,7 +57,7 @@ class message_read extends base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('message/index.php', array('user1' => $this->relateduserid, 'user2' => $this->userid));
|
||||
return new \moodle_url('/message/index.php', array('user1' => $this->userid, 'user2' => $this->relateduserid));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -56,7 +56,7 @@ class message_sent extends base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('message/index.php', array('user1' => $this->relateduserid, 'user2' => $this->userid));
|
||||
return new \moodle_url('/message/index.php', array('user1' => $this->userid, 'user2' => $this->relateduserid));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -51,7 +51,7 @@ class mnet_access_control_created extends base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('admin/mnet/access_control.php');
|
||||
return new \moodle_url('/admin/mnet/access_control.php');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -51,7 +51,7 @@ class mnet_access_control_updated extends base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('admin/mnet/access_control.php');
|
||||
return new \moodle_url('/admin/mnet/access_control.php');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -64,7 +64,7 @@ class role_capabilities_updated extends base {
|
||||
*/
|
||||
public function get_url() {
|
||||
if ($this->contextlevel === CONTEXT_SYSTEM) {
|
||||
return new \moodle_url('admin/roles/define.php', array('action' => 'view', 'roleid' => $this->objectid));
|
||||
return new \moodle_url('/admin/roles/define.php', array('action' => 'view', 'roleid' => $this->objectid));
|
||||
} else {
|
||||
return new \moodle_url('/admin/roles/override.php', array('contextid' => $this->contextid,
|
||||
'roleid' => $this->objectid));
|
||||
|
@ -73,7 +73,7 @@ class user_enrolment_updated extends base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('/enrol/users.php', array('id' => $this->courseid));
|
||||
return new \moodle_url('/enrol/editenrolment.php', array('ue' => $this->objectid));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -70,7 +70,7 @@ class webservice_service_updated extends \core\event\base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('/admin/settings.php', array('section' => 'externalservices'));
|
||||
return new \moodle_url('/admin/webservice/service.php', array('id' => $this->objectid));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -416,9 +416,10 @@ class core_accesslib_testcase extends advanced_testcase {
|
||||
$event = array_pop($events);
|
||||
|
||||
$this->assertInstanceOf('\core\event\role_capabilities_updated', $event);
|
||||
$expectedurl = new moodle_url('admin/roles/define.php', array('action' => 'view', 'roleid' => $student->id));
|
||||
$expectedurl = new moodle_url('/admin/roles/define.php', array('action' => 'view', 'roleid' => $student->id));
|
||||
$this->assertEquals($expectedurl, $event->get_url());
|
||||
$this->assertEventLegacyLogData($expectedlegacylog, $event);
|
||||
$this->assertEventContextNotUsed($event);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -49,6 +49,8 @@ class core_events_testcase extends advanced_testcase {
|
||||
// Check that the event data is valid.
|
||||
$this->assertInstanceOf('\core\event\course_category_created', $event);
|
||||
$this->assertEquals(context_coursecat::instance($category->id), $event->get_context());
|
||||
$url = new moodle_url('/course/management.php', array('categoryid' => $event->objectid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
$expected = array(SITEID, 'category', 'add', 'editcategory.php?id=' . $category->id, $category->id);
|
||||
$this->assertEventLegacyLogData($expected, $event);
|
||||
$this->assertEventContextNotUsed($event);
|
||||
@ -74,6 +76,8 @@ class core_events_testcase extends advanced_testcase {
|
||||
// Check that the event data is valid.
|
||||
$this->assertInstanceOf('\core\event\course_category_updated', $event);
|
||||
$this->assertEquals(context_coursecat::instance($category->id), $event->get_context());
|
||||
$url = new moodle_url('/course/editcategory.php', array('id' => $event->objectid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
$expected = array(SITEID, 'category', 'update', 'editcategory.php?id=' . $category->id, $category->id);
|
||||
$this->assertEventLegacyLogData($expected, $event);
|
||||
|
||||
|
@ -58,6 +58,8 @@ class core_message_events_testcase extends advanced_testcase {
|
||||
$expected = array(SITEID, 'message', 'add contact', 'index.php?user1=' . $user->id .
|
||||
'&user2=2', $user->id);
|
||||
$this->assertEventLegacyLogData($expected, $event);
|
||||
$url = new moodle_url('/message/index.php', array('user1' => $event->userid, 'user2' => $event->relateduserid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -85,6 +87,8 @@ class core_message_events_testcase extends advanced_testcase {
|
||||
$expected = array(SITEID, 'message', 'remove contact', 'index.php?user1=' . $user->id .
|
||||
'&user2=2', $user->id);
|
||||
$this->assertEventLegacyLogData($expected, $event);
|
||||
$url = new moodle_url('/message/index.php', array('user1' => $event->userid, 'user2' => $event->relateduserid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -111,6 +115,8 @@ class core_message_events_testcase extends advanced_testcase {
|
||||
$this->assertEquals(context_user::instance(2), $event->get_context());
|
||||
$expected = array(SITEID, 'message', 'block contact', 'index.php?user1=' . $user->id . '&user2=2', $user->id);
|
||||
$this->assertEventLegacyLogData($expected, $event);
|
||||
$url = new moodle_url('/message/index.php', array('user1' => $event->userid, 'user2' => $event->relateduserid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -137,6 +143,8 @@ class core_message_events_testcase extends advanced_testcase {
|
||||
$this->assertEquals(context_user::instance(2), $event->get_context());
|
||||
$expected = array(SITEID, 'message', 'unblock contact', 'index.php?user1=' . $user->id . '&user2=2', $user->id);
|
||||
$this->assertEventLegacyLogData($expected, $event);
|
||||
$url = new moodle_url('/message/index.php', array('user1' => $event->userid, 'user2' => $event->relateduserid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -166,6 +174,8 @@ class core_message_events_testcase extends advanced_testcase {
|
||||
$this->assertEquals(context_system::instance(), $event->get_context());
|
||||
$expected = array(SITEID, 'message', 'write', 'index.php?user=1&id=2&history=1#m3', 1);
|
||||
$this->assertEventLegacyLogData($expected, $event);
|
||||
$url = new moodle_url('/message/index.php', array('user1' => $event->userid, 'user2' => $event->relateduserid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -191,5 +201,7 @@ class core_message_events_testcase extends advanced_testcase {
|
||||
// Check that the event data is valid.
|
||||
$this->assertInstanceOf('\core\event\message_read', $event);
|
||||
$this->assertEquals(context_user::instance(2), $event->get_context());
|
||||
$url = new moodle_url('/message/index.php', array('user1' => $event->userid, 'user2' => $event->relateduserid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
}
|
||||
}
|
||||
|
@ -67,6 +67,9 @@ class mnet_events_testcase extends advanced_testcase {
|
||||
$expected = array(SITEID, 'admin/mnet', 'add', 'admin/mnet/access_control.php',
|
||||
'SSO ACL: enabled user \'username\' from ' . $this->mnethost->name);
|
||||
$this->assertEventLegacyLogData($expected, $event);
|
||||
$this->assertEventContextNotUsed($event);
|
||||
$url = new \moodle_url('/admin/mnet/access_control.php');
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -94,5 +97,8 @@ class mnet_events_testcase extends advanced_testcase {
|
||||
$expected = array(SITEID, 'admin/mnet', 'update', 'admin/mnet/access_control.php',
|
||||
'SSO ACL: enabled user \'username\' from ' . $this->mnethost->name);
|
||||
$this->assertEventLegacyLogData($expected, $event);
|
||||
$this->assertEventContextNotUsed($event);
|
||||
$url = new \moodle_url('/admin/mnet/access_control.php');
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
}
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ class all_submissions_downloaded extends \core\event\base {
|
||||
/**
|
||||
* Sets the legacy event log data.
|
||||
*
|
||||
* @param stdClass $legacylogdata legacy log data.
|
||||
* @param \stdClass $legacylogdata legacy log data.
|
||||
* @return void
|
||||
*/
|
||||
public function set_legacy_logdata($legacylogdata) {
|
||||
|
@ -60,7 +60,7 @@ class assessable_submitted extends \core\event\assessable_submitted {
|
||||
/**
|
||||
* Legacy event data if get_legacy_eventname() is not empty.
|
||||
*
|
||||
* @return stdClass
|
||||
* @return \stdClass
|
||||
*/
|
||||
protected function get_legacy_eventdata() {
|
||||
$eventdata = new \stdClass();
|
||||
@ -112,7 +112,7 @@ class assessable_submitted extends \core\event\assessable_submitted {
|
||||
/**
|
||||
* Sets the legacy event log data.
|
||||
*
|
||||
* @param stdClass $legacylogdata legacy log data.
|
||||
* @param \stdClass $legacylogdata legacy log data.
|
||||
* @return void
|
||||
*/
|
||||
public function set_legacy_logdata($legacylogdata) {
|
||||
|
@ -92,7 +92,7 @@ class identities_revealed extends \core\event\base {
|
||||
/**
|
||||
* Sets the legacy event log data.
|
||||
*
|
||||
* @param stdClass $legacylogdata legacy log data.
|
||||
* @param \stdClass $legacylogdata legacy log data.
|
||||
* @return void
|
||||
*/
|
||||
public function set_legacy_logdata($legacylogdata) {
|
||||
|
@ -92,7 +92,7 @@ class submission_duplicated extends \core\event\base {
|
||||
/**
|
||||
* Sets the legacy event log data.
|
||||
*
|
||||
* @param stdClass $legacylogdata legacy log data.
|
||||
* @param \stdClass $legacylogdata legacy log data.
|
||||
* @return void
|
||||
*/
|
||||
public function set_legacy_logdata($legacylogdata) {
|
||||
|
@ -98,7 +98,7 @@ class submission_status_updated extends \core\event\base {
|
||||
/**
|
||||
* Sets the legacy event log data.
|
||||
*
|
||||
* @param stdClass $legacylogdata legacy log data.
|
||||
* @param \stdClass $legacylogdata legacy log data.
|
||||
* @return void
|
||||
*/
|
||||
public function set_legacy_logdata($legacylogdata) {
|
||||
|
@ -92,7 +92,7 @@ class submission_unlocked extends \core\event\base {
|
||||
/**
|
||||
* Sets the legacy event log data.
|
||||
*
|
||||
* @param stdClass $legacylogdata legacy log data.
|
||||
* @param \stdClass $legacylogdata legacy log data.
|
||||
* @return void
|
||||
*/
|
||||
public function set_legacy_logdata($legacylogdata) {
|
||||
|
@ -98,7 +98,7 @@ class workflow_state_updated extends \core\event\base {
|
||||
/**
|
||||
* Sets the legacy event log data.
|
||||
*
|
||||
* @param stdClass $legacylogdata legacy log data.
|
||||
* @param \stdClass $legacylogdata legacy log data.
|
||||
* @return void
|
||||
*/
|
||||
public function set_legacy_logdata($legacylogdata) {
|
||||
|
@ -61,7 +61,7 @@ class assessable_uploaded extends \core\event\assessable_uploaded {
|
||||
/**
|
||||
* Legacy event data if get_legacy_eventname() is not empty.
|
||||
*
|
||||
* @return stdClass
|
||||
* @return \stdClass
|
||||
*/
|
||||
protected function get_legacy_eventdata() {
|
||||
$eventdata = new \stdClass();
|
||||
|
@ -66,8 +66,7 @@ class report_viewed extends \core\event\base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
$url = '/mod/choice/report.php';
|
||||
return new \moodle_url($url, array('id' => $this->contextinstanceid));
|
||||
return new \moodle_url('/mod/choice/report.php', array('id' => $this->contextinstanceid));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -64,6 +64,15 @@ class field_created extends \core\event\base {
|
||||
return 'The field ' . $this->objectid . ' belonging to the data activity ' . $this->other['dataid'] . ' has been created.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get URL related to the action.
|
||||
*
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('/mod/data/field.php', array('d' => $this->other['dataid']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the legacy event log data.
|
||||
*
|
||||
|
@ -64,6 +64,15 @@ class field_deleted extends \core\event\base {
|
||||
return 'The field ' . $this->objectid . ' belonging to the data activity ' . $this->other['dataid'] . ' has been deleted.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get URL related to the action.
|
||||
*
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('/mod/data/field.php', array('d' => $this->other['dataid']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the legacy event log data.
|
||||
*
|
||||
|
@ -64,6 +64,15 @@ class field_updated extends \core\event\base {
|
||||
return 'The field ' . $this->objectid . ' belonging to the data activity ' . $this->other['dataid'] . ' has been updated.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get URL related to the action.
|
||||
*
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('/mod/data/field.php', array('d' => $this->other['dataid']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the legacy event log data.
|
||||
*
|
||||
|
@ -64,6 +64,15 @@ class record_created extends \core\event\base {
|
||||
' was created by the user ' . $this->userid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get URL related to the action.
|
||||
*
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('/mod/data/view.php', array('d' => $this->other['dataid'], 'rid' => $this->objectid));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the legacy event log data.
|
||||
*
|
||||
|
@ -64,6 +64,15 @@ class record_deleted extends \core\event\base {
|
||||
' was deleted by the user ' . $this->userid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get URL related to the action.
|
||||
*
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('/mod/data/view.php', array('d' => $this->other['dataid']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the legacy event log data.
|
||||
*
|
||||
|
@ -64,6 +64,15 @@ class record_updated extends \core\event\base {
|
||||
' was updated by the user ' . $this->userid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get URL related to the action.
|
||||
*
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('/mod/data/view.php', array('d' => $this->other['dataid'], 'rid' => $this->objectid));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the legacy event log data.
|
||||
*
|
||||
|
@ -72,6 +72,15 @@ class template_updated extends \core\event\base {
|
||||
'&d=' . $this->other['dataid'], $this->other['dataid'], $this->contextinstanceid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get URL related to the action.
|
||||
*
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('/mod/data/templates.php', array('d' => $this->other['dataid']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom validation.
|
||||
*
|
||||
|
@ -63,6 +63,15 @@ class template_viewed extends \core\event\base {
|
||||
'user with the id ' . $this->userid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get URL related to the action.
|
||||
*
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('/mod/data/templates.php', array('d' => $this->other['dataid']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the legacy event log data.
|
||||
*
|
||||
|
@ -72,6 +72,9 @@ class mod_data_events_testcase extends advanced_testcase {
|
||||
$expected = array($course->id, 'data', 'fields add', 'field.php?d=' . $data->id . '&mode=display&fid=' .
|
||||
$field->field->id, $field->field->id, $data->cmid);
|
||||
$this->assertEventLegacyLogData($expected, $event);
|
||||
$this->assertEventContextNotUsed($event);
|
||||
$url = new moodle_url('/mod/data/field.php', array('d' => $data->id));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -109,6 +112,9 @@ class mod_data_events_testcase extends advanced_testcase {
|
||||
$expected = array($course->id, 'data', 'fields update', 'field.php?d=' . $data->id . '&mode=display&fid=' .
|
||||
$field->field->id, $field->field->id, $data->cmid);
|
||||
$this->assertEventLegacyLogData($expected, $event);
|
||||
$this->assertEventContextNotUsed($event);
|
||||
$url = new moodle_url('/mod/data/field.php', array('d' => $data->id));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -145,6 +151,9 @@ class mod_data_events_testcase extends advanced_testcase {
|
||||
$this->assertEquals(context_module::instance($data->cmid), $event->get_context());
|
||||
$expected = array($course->id, 'data', 'fields delete', 'field.php?d=' . $data->id, $field->field->name, $data->cmid);
|
||||
$this->assertEventLegacyLogData($expected, $event);
|
||||
$this->assertEventContextNotUsed($event);
|
||||
$url = new moodle_url('/mod/data/field.php', array('d' => $data->id));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -172,6 +181,9 @@ class mod_data_events_testcase extends advanced_testcase {
|
||||
$expected = array($course->id, 'data', 'add', 'view.php?d=' . $data->id . '&rid=' . $recordid,
|
||||
$data->id, $data->cmid);
|
||||
$this->assertEventLegacyLogData($expected, $event);
|
||||
$this->assertEventContextNotUsed($event);
|
||||
$url = new moodle_url('/mod/data/view.php', array('d' => $data->id, 'rid' => $recordid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -211,6 +223,9 @@ class mod_data_events_testcase extends advanced_testcase {
|
||||
$this->assertEquals(context_module::instance($data->cmid), $event->get_context());
|
||||
$expected = array($course->id, 'data', 'update', 'view.php?d=' . $data->id . '&rid=1', $data->id, $data->cmid);
|
||||
$this->assertEventLegacyLogData($expected, $event);
|
||||
$this->assertEventContextNotUsed($event);
|
||||
$url = new moodle_url('/mod/data/view.php', array('d' => $data->id, 'rid' => $event->objectid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -259,6 +274,9 @@ class mod_data_events_testcase extends advanced_testcase {
|
||||
$this->assertEquals(context_module::instance($data->cmid), $event->get_context());
|
||||
$expected = array($course->id, 'data', 'record delete', 'view.php?id=' . $data->cmid, $data->id, $data->cmid);
|
||||
$this->assertEventLegacyLogData($expected, $event);
|
||||
$this->assertEventContextNotUsed($event);
|
||||
$url = new moodle_url('/mod/data/view.php', array('d' => $data->id));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -298,6 +316,9 @@ class mod_data_events_testcase extends advanced_testcase {
|
||||
$expected = array($course->id, 'data', 'templates view', 'templates.php?id=' . $data->cmid . '&d=' .
|
||||
$data->id, $data->id, $data->cmid);
|
||||
$this->assertEventLegacyLogData($expected, $event);
|
||||
$this->assertEventContextNotUsed($event);
|
||||
$url = new moodle_url('/mod/data/templates.php', array('d' => $data->id));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -337,5 +358,8 @@ class mod_data_events_testcase extends advanced_testcase {
|
||||
$expected = array($course->id, 'data', 'templates saved', 'templates.php?id=' . $data->cmid . '&d=' .
|
||||
$data->id, $data->id, $data->cmid);
|
||||
$this->assertEventLegacyLogData($expected, $event);
|
||||
$this->assertEventContextNotUsed($event);
|
||||
$url = new moodle_url('/mod/data/templates.php', array('d' => $data->id));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ class assessable_uploaded extends \core\event\assessable_uploaded {
|
||||
/**
|
||||
* Legacy event data if get_legacy_eventname() is not empty.
|
||||
*
|
||||
* @return stdClass
|
||||
* @return \stdClass
|
||||
*/
|
||||
protected function get_legacy_eventdata() {
|
||||
$eventdata = new \stdClass();
|
||||
|
@ -88,7 +88,7 @@ class attempt_abandoned extends \core\event\base {
|
||||
/**
|
||||
* Legacy event data if get_legacy_eventname() is not empty.
|
||||
*
|
||||
* @return stdClass
|
||||
* @return \stdClass
|
||||
*/
|
||||
protected function get_legacy_eventdata() {
|
||||
$attempt = $this->get_record_snapshot('quiz_attempts', $this->objectid);
|
||||
|
@ -87,7 +87,7 @@ class page_viewed extends \core\event\base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
if (!empty($this->data->other['wid'])) {
|
||||
if (!empty($this->data['other']['wid'])) {
|
||||
return new \moodle_url('/mod/wiki/view.php', array('wid' => $this->data['other']['wid'],
|
||||
'title' => $this->data['other']['title'],
|
||||
'uid' => $this->relateduserid,
|
||||
|
@ -34,7 +34,7 @@ defined('MOODLE_INTERNAL') || die();
|
||||
* @copyright 2013 Adrian Greeve
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class submission_assessments_reset extends \core\event\base {
|
||||
class assessments_reset extends \core\event\base {
|
||||
|
||||
/**
|
||||
* Init method.
|
||||
|
@ -55,7 +55,7 @@ case 'clearaggregatedgrades':
|
||||
case 'clearassessments':
|
||||
require_capability('mod/workshop:overridegrades', $workshop->context);
|
||||
$workshop->clear_assessments();
|
||||
$event = \mod_workshop\event\submission_assessments_reset::create($params);
|
||||
$event = \mod_workshop\event\assessments_reset::create($params);
|
||||
$event->trigger();
|
||||
break;
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ class report_viewed extends \core\event\base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('report/log/index.php', array('id' => $this->courseid));
|
||||
return new \moodle_url('/report/log/index.php', array('id' => $this->courseid));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -79,7 +79,7 @@ class user_report_viewed extends \core\event\base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('report/log/user.php', array('course' => $this->courseid, 'id' => $this->relateduserid,
|
||||
return new \moodle_url('/report/log/user.php', array('course' => $this->courseid, 'id' => $this->relateduserid,
|
||||
'mode' => $this->other['mode']));
|
||||
}
|
||||
|
||||
|
@ -69,6 +69,8 @@ class report_log_events_testcase extends advanced_testcase {
|
||||
$expected = array($course->id, "course", "report log", "report/log/index.php?id=$course->id", $course->id);
|
||||
$this->assertEventLegacyLogData($expected, $event);
|
||||
$this->assertEventContextNotUsed($event);
|
||||
$url = new moodle_url('/report/log/index.php', array('id' => $event->courseid));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -98,5 +100,7 @@ class report_log_events_testcase extends advanced_testcase {
|
||||
$expected = array($course->id, "course", "report log", $url, $course->id);
|
||||
$this->assertEventLegacyLogData($expected, $event);
|
||||
$this->assertEventContextNotUsed($event);
|
||||
$url = new moodle_url('/report/log/user.php', array('course' => $course->id, 'id' => $user->id, 'mode' => 'today'));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
}
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ class report_viewed extends \core\event\base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('report/loglive/index.php', array('id' => $this->courseid));
|
||||
return new \moodle_url('/report/loglive/index.php', array('id' => $this->courseid));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -66,5 +66,7 @@ class report_loglive_events_testcase extends advanced_testcase {
|
||||
$expected = array($course->id, 'course', 'report live', "report/loglive/index.php?id=$course->id", $course->id);
|
||||
$this->assertEventLegacyLogData($expected, $event);
|
||||
$this->assertEventContextNotUsed($event);
|
||||
$url = new moodle_url('/report/loglive/index.php', array('id' => $course->id));
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
}
|
||||
}
|
||||
|
@ -75,6 +75,6 @@ class activity_viewed extends \core\event\base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('report/outline/index.php', array('course' => $this->courseid));
|
||||
return new \moodle_url('/report/outline/index.php', array('course' => $this->courseid));
|
||||
}
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ class outline_viewed extends \core\event\base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('report/outline/user.php', array('course' => $this->courseid, 'id' => $this->relateduserid,
|
||||
return new \moodle_url('/report/outline/user.php', array('course' => $this->courseid, 'id' => $this->relateduserid,
|
||||
'mode' => $this->other['mode']));
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ class report_viewed extends \core\event\base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('report/participation/index.php', array('id' => $this->courseid,
|
||||
return new \moodle_url('/report/participation/index.php', array('id' => $this->courseid,
|
||||
'instanceid' => $this->data['other']['instanceid'], 'roleid' => $this->data['other']['roleid']));
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ class report_viewed extends \core\event\base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('report/stats/index.php', array('id' => $this->courseid, 'mode' => $this->data['other']['mode'],
|
||||
return new \moodle_url('/report/stats/index.php', array('id' => $this->courseid, 'mode' => $this->data['other']['mode'],
|
||||
'report' => $this->data['other']['report']));
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,7 @@ class user_report_viewed extends \core\event\base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('report/stats/user.php', array('id' => $this->relateduserid, 'course' => $this->courseid));
|
||||
return new \moodle_url('/report/stats/user.php', array('id' => $this->relateduserid, 'course' => $this->courseid));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user