Simplify collection of available surveys to complete
Don’t need user check

Dashboard is only available to logged in users.
Use counter instead of passing object
Calculate expiring certificates in database
Load info for each response in one query instead of two.
Use helper method for this
Simpler grouping loop for questions
Only call all_autocompleted once
Remove unused variable
Move autocomplete_override_message to field on `Response`

An enormous amount of time was spent joining the `autocomplete_override_messages` table which was unnecessary as there should only be one message per field so it can be stored on the `Response`.

I’ve also renamed the field `explanation` as that was what it was being used for.
this is already a boolean
Look up mandatory questions via database
Remove commented out code
Only select question id instead of loading whole model
Simplify logic of filter
Move all progress calculation to server side

I don’t think the math in the previous version was correct
so neither is the new one.

Untested as yet as setting up a survey is difficult
Use scope defined in question
Greater than on strings is undefined

check for not null instead as there are no blank strings in the questionnaires
Store certificate in local variable

It is referenced so often that it cleans up the template a bit
Only check url responses once on save

Instead of continuously checking them each time.