Update functions.js

OnOptionClick(event after clicking one answer) added.
Variable for tracking correct answers added.
Algorithm for wrong suitable answers corrected.