MDL-55415 webservice: Allow validate_courses to return contexts