moodleou / moodle-quiz_answersheets

A Moodle quiz report to allow quiz attempts to be exported
8 stars 15 forks source link

Deprecated Function #33

Closed Ghiyathshal closed 2 years ago

Ghiyathshal commented 2 years ago

Hi, the function get_extra_user_fields() and get_user_field_name in the file mod/quiz/report/answersheets/classes/report_display_options.php are deprecated. please replace the code in line 165 $userfields = get_extra_user_fields(context_module::instance($cm->id));

with : $context = \context_system::instance(); $userfields = \core_user\fields::for_name()->with_identity($context)->excluding('id', 'deleted');

and the code in line 194 return get_user_field_name($setting); with

$fields = \core_user\fields::for_name()->get_required_fields($setting); return $fields;

Best Regards Ghiyath

timhunt commented 2 years ago

Yes. We have fixed this locally at the OU. We just have not had time to share that version of the code publicly yet, but that shoud happen soon.