Minor - format code, adding escape_string.
before/after days are also affected by the session-course-teachers

See BT#7740