quiz applet working with all logic on page, need to put into a directive