Beautified a lot of stuff. Questions form is now broken but not linked anywhere on the page, so really idgaf. This commit only happens because I want to try replacing the nested_form gem with the formtastic gem.
Sooo... I found out I didn't have to get rid of nested_form after all; on the contrary, it works together quite nicely with both formtastic and simple_form, the latter being a gem that does the same as formtastic (but better because in a much more flexible manner, as the almighty internet tells me) and was hence chosen by my humble self over formtastic. So a lot of stuff has happened now, only one answer is accepted as correct when creating quizzes and so on. I'm also still knee deep in markup, which has started to piss me off greatly some time ago, which is why a lot of the views are a complete and utter mess. Since this will be a pre alpha version thing and all the fucked up views will (hopefully) only be seen by admins anyways, idgaf. The Quiztory class, which will handle taking quizzes and saving statistics of them, is next and that one will get a BEAUTIFUL view, I promise.
Alright, cleaned out the quiz form; it's all simple_form now. Not much more beautiful than before, but a little less ugly html in there. Other than that - quizzes lost a few attributes (started_at, last_submit and finished) but got a new one (production_ready) which will be used to specify if a quiz is shown to regular users or not. Now, on to the Quiztory class.
Quiztory class and all data relations exist now. Furthermore, I've beautified the Quiz form a bit. Now for the fun part.
Quiz works now, at least as far as i've tested it. Which isn't much, but I'm not made out of time. Next steps would be to implement the 30 second submit thingy (so a quiz can only be submitted every 30 seconds) and, of course, make everything moire beautiful.
Fixed the horrible fuck up in parameter sanitization. This is a fix now; found a whole new construction site. Next steps would be: Talking the view into submitting the answer ids as an array, sanitizing params better.
Fixed the horrible fuck up in parameter sanitization. This is a fix now; found a whole new construction site. Next steps would be: Talking the view into submitting the answer ids as an array, sanitizing params better.
Merge branch 'master' of github.com:floGik/fsg-quiz
What? Somehow I sometimes fumble git.
Beautified some things; toyed around with fontawesome a bit (it's awesome); Users now get saved with the quiztories. There's a lot more work to do but for now I'm not unsatisfied.
Failed submits of a quiztory get logged now (in a hash; timestamps are keys and users are user ids) and printed once the quiztory is finished (stats partial view). The submit button for quiztories is now disabled for 30 seconds after every submit for every user (the last timestamp for the user is read from the failed_submits attributes and the delay calculated together with Time.now which is then passed to a jQuery script in the ugliest way possible: through html; this way, reloading the page or even relogging doesn't do anything). Furthermore, I've sorted out a horrible potential error in the quiztory creation form, where it was possible that - if the quiz with id 1 were to be deleted from the database - no quiz would be selected and hence a new quiztory created without a quiz_id, which broke the app. What else... Yeah, I beautified a lot of stuff again while I was moving through the views, but the partial quiztory/stats is the only one I actively remember working on.