MDL-61289 mod_choice: Add extra user fields to response data
authorJun Pataleta <jun@moodle.com>
Mon, 29 Jan 2018 08:20:19 +0000 (16:20 +0800)
committerJun Pataleta <jun@moodle.com>
Mon, 19 Feb 2018 00:53:44 +0000 (08:53 +0800)
mod/choice/lib.php

index 4e6eef0..bf548a0 100644 (file)
@@ -791,8 +791,9 @@ function choice_get_response_data($choice, $cm, $groupmode, $onlyactive) {
 
 /// First get all the users who have access here
 /// To start with we assume they are all "unanswered" then move them later
+    $extrafields = get_extra_user_fields($context);
     $allresponses[0] = get_enrolled_users($context, 'mod/choice:choose', $currentgroup,
-            user_picture::fields('u', array('idnumber')), null, 0, 0, $onlyactive);
+            user_picture::fields('u', $extrafields), null, 0, 0, $onlyactive);
 
 /// Get all the recorded responses for this choice
     $rawresponses = $DB->get_records('choice_answers', array('choiceid' => $choice->id));