Removed duplicate code by creating global variables to store PMSolution, which is set when the page is loaded, and numSteps, which is set when the page is loaded and when the Next button is pressed.
Created getHotspotLocationOnImage function to return the pixel location of a hotspot relative to the image size
Created getWaypointLocation function to return the pixel location of a waypoint relative to the background
Simplified getCorrectInteraction function
Removed duplicate code from webViewDidFinishLoad and pressedNext by creating setupCurrentSentence function. This sets the appearance of the current sentence and solution steps.