Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 169... Línea 169...
169
     * Get the user picture which should be displayed, if required.
169
     * Get the user picture which should be displayed, if required.
170
     *
170
     *
171
     * @return user_picture|null
171
     * @return user_picture|null
172
     */
172
     */
173
    public function user_picture() {
173
    public function user_picture() {
174
        global $DB;
174
        global $DB, $PAGE;
175
        if ($this->attemptobj->get_quiz()->showuserpicture == QUIZ_SHOWIMAGE_NONE) {
175
        if ($this->attemptobj->get_quiz()->showuserpicture == QUIZ_SHOWIMAGE_NONE) {
176
            return null;
176
            return null;
177
        }
177
        }
178
        $user = $DB->get_record('user', ['id' => $this->attemptobj->get_userid()]);
178
        $user = $DB->get_record('user', ['id' => $this->attemptobj->get_userid()]);
179
        $userpicture = new user_picture($user);
179
        $userpicture = new user_picture($user);
180
        $userpicture->courseid = $this->attemptobj->get_courseid();
180
        $userpicture->courseid = $this->attemptobj->get_courseid();
-
 
181
        if ($PAGE->pagelayout === 'secure') {
-
 
182
            $userpicture->link = false;
-
 
183
        }
181
        if ($this->attemptobj->get_quiz()->showuserpicture == QUIZ_SHOWIMAGE_LARGE) {
184
        if ($this->attemptobj->get_quiz()->showuserpicture == QUIZ_SHOWIMAGE_LARGE) {
182
            $userpicture->size = true;
185
            $userpicture->size = true;
183
        }
186
        }
184
        return $userpicture;
187
        return $userpicture;
185
    }
188
    }