MDL-44321 events: cleaning up course_module_viewed event

This commit is contained in:
Marina Glancy
2014-02-28 16:36:09 +08:00
parent 76e4de31cc
commit fbc4b77841
19 changed files with 47 additions and 102 deletions
@@ -96,6 +96,10 @@ abstract class course_module_viewed extends base {
if (empty($this->objectid) || empty($this->objecttable)) {
throw new \coding_exception('course_module_viewed event must define objectid and object table.');
}
// Make sure the context level is set to module.
if ($this->contextlevel != CONTEXT_MODULE) {
throw new \coding_exception('Context passed must be module context.');
}
}
}