Javascript changes for Student Training Authoring

Style nitpick: please remove the spaces before `.each` and `function`