35
35
* - int processid: the id of the process.
36
36
* - int workflowid: the id of the workflow.
37
37
* - int stepindex: the index of the step.
38
- * - int courseid: the id of the course.
39
38
* }
40
39
*
41
40
* @package tool_lifecycle
@@ -54,12 +53,12 @@ class process_proceeded extends \core\event\base {
54
53
*/
55
54
public static function event_from_process ($ process ) {
56
55
$ data = [
57
- 'context ' => \context_system::instance (),
56
+ 'courseid ' => $ process ->courseid ,
57
+ 'context ' => $ process ->context ,
58
58
'other ' => [
59
59
'processid ' => $ process ->id ,
60
60
'workflowid ' => $ process ->workflowid ,
61
61
'stepindex ' => $ process ->stepindex ,
62
- 'courseid ' => $ process ->courseid ,
63
62
],
64
63
];
65
64
return self ::create ($ data );
@@ -84,7 +83,7 @@ public function get_description() {
84
83
$ processid = $ this ->other ['processid ' ];
85
84
$ workflowid = $ this ->other ['workflowid ' ];
86
85
$ stepindex = $ this ->other ['stepindex ' ];
87
- $ courseid = $ this ->other [ ' courseid ' ] ;
86
+ $ courseid = $ this ->courseid ;
88
87
89
88
return "The workflow with id ' $ workflowid' finished step ' $ stepindex' successfully for course ' $ courseid' " .
90
89
"in the process with id ' $ processid' " ;
@@ -130,7 +129,7 @@ protected function validate_data() {
130
129
throw new \coding_exception ('The \'stepindex \' value must be set ' );
131
130
}
132
131
133
- if (!isset ($ this ->other [ ' courseid ' ] )) {
132
+ if (!isset ($ this ->courseid )) {
134
133
throw new \coding_exception ('The \'courseid \' value must be set ' );
135
134
}
136
135
}
0 commit comments