E1450. UI change for assignment view

I submitted pull request 2 days ago, but updated some codes after that. Let me know if I need to submit a pull request again.
Hi Yang!
I understand in most of the situations we can place js codes in root/public/javascripts/xxx.js files, and call them in html.erb. But after testing, I found it can't be done (or need fixing) if you move them. 
The reason I guess is because in these js functions, they called rails variables and methods, which were included in syntax <% %> or <%= %>, and pure js file can't recognize these.
Another fact that makes me convinced is that in current html.erb, there are already js files there including rails variables and methods; at the same time in the js files seperated in  root/public/javascripts/xxx.js, none of them called rails variables and methods.