MDL-51703 mod_survey: Trigger response_submitted event in correct place

This commit is contained in:
Juan Leyva
2015-10-09 16:27:33 +02:00
parent e6311ee386
commit f6057175fb
+8 -8
View File
@@ -54,14 +54,6 @@
print_error('invalidsurveyid', 'survey');
}
$params = array(
'context' => $context,
'courseid' => $course->id,
'other' => array('surveyid' => $survey->id)
);
$event = \mod_survey\event\response_submitted::create($params);
$event->trigger();
$strsurveysaved = get_string('surveysaved', 'survey');
$PAGE->set_title($strsurveysaved);
@@ -121,6 +113,14 @@
}
}
$params = array(
'context' => $context,
'courseid' => $course->id,
'other' => array('surveyid' => $survey->id)
);
$event = \mod_survey\event\response_submitted::create($params);
$event->trigger();
// Print the page and finish up.
notice(get_string("thanksforanswers","survey", $USER->firstname), "$CFG->wwwroot/course/view.php?id=$course->id");