You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Kind of nit-picky, but there are some pycharm plugins for linting JavaScript, that I would encourage you to install them. I just see some random things like:
submitData(data) {
var xhr = new XMLHttpRequest();
// This part gets unplatform's session uuid if available
// and creates a json string for the ajax POST. The /appdata/ api
// is pretty flexible for the params field. Timestamps are generated
// server-side & don't need to be included.
var data_string = {}
// if you want to test with a session id, you can set
// document.cookie = "session_uuid=test"
data_string['session_id'] = this.uuid;
for (var key in data) {data_string[key] = data[key];};
var qbank = { data : data_string }
qbank = JSON.stringify(qbank);
And linting the code would make it a little more readable...
The text was updated successfully, but these errors were encountered:
In playlevel.js and prefabs.js, I've seen a lot of nesting of setInterval methods to do some animations, etc. If you can break out the functions, you can avoid callback purgatory (or whatever you want to call it). One example starts around line 144 in playlevel.js. Breaking out these methods might also make them more testable too, although the ones I saw are mostly animation-related, so not sure how you would test them anyways.
A "better" option than just breaking out into functions is to use promises, with a library like the q library.
But it would help with readability / coding style.
Kind of nit-picky, but there are some pycharm plugins for linting JavaScript, that I would encourage you to install them. I just see some random things like:
And linting the code would make it a little more readable...
The text was updated successfully, but these errors were encountered: