From f304a59b8a24086e9c528a4537bbd0468078ddbc Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Mon, 7 May 2018 13:32:22 +0800 Subject: [PATCH] MDL-61407 mod_quiz: Determine quiz step for manual comment --- question/classes/privacy/provider.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/question/classes/privacy/provider.php b/question/classes/privacy/provider.php index f17aead409c..c440db4943f 100644 --- a/question/classes/privacy/provider.php +++ b/question/classes/privacy/provider.php @@ -192,7 +192,13 @@ class provider implements if ($qa->has_manual_comment()) { // Note - the export of the step data will ensure that the files are exported. // No need to do it again here. - list($comment, $commentformat, $step) = $qa->get_manual_comment(); + list($comment, $commentformat) = $qa->get_manual_comment(); + // Get the step data. + foreach ($qa->get_reverse_step_iterator() as $step) { + if ($step->has_behaviour_var('comment')) { + break; + } + } $comment = writer::with_context($context) ->rewrite_pluginfile_urls(