Git merges in Moodle 3.1.11 by Jun Pataleta

commit a9c4c8da11cd124850a3add5f1cfd69846d98a3c
Author: Jun Pataleta <jun@moodle.com>
Date:   Tue, 16 Jan 2018 23:02:14 +0800
Tag:    v3.1.11

Merge branch 'MDL-61221-31' of git://github.com/andrewnicols/moodle into MOODLE_31_STABLE