move js code to trainingsubmission.js