This is brittle; it would be better to give the function a parameter and have the relevant template provide the course. Also, we should be using course id rather than just course number. The latter are currently unique but not guaranteed to be so.