From 9dabe8230b6431e955f958a921fe3bcab08ac9e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Loguercio?= Date: Thu, 25 Feb 2016 12:16:38 -0500 Subject: [PATCH] Fix Hotspot question, student cannot move points if several Hotspot questions on one page - Refs #8098 --- main/inc/lib/javascript/hotspot/js/hotspot.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main/inc/lib/javascript/hotspot/js/hotspot.js b/main/inc/lib/javascript/hotspot/js/hotspot.js index 2351124235..3c0004a03d 100755 --- a/main/inc/lib/javascript/hotspot/js/hotspot.js +++ b/main/inc/lib/javascript/hotspot/js/hotspot.js @@ -900,9 +900,13 @@ window.HotspotQuestion = (function () { isMoving = true; if (e.target.tagName === 'circle') { - answerIndex = $(e.target).index('circle'); + //Hack to move correctly the hot spots if there are more than one HS question in same page + answerIndex = $(e.target).next().html(); + answerIndex = parseInt(answerIndex) - 1; } else if (e.target.tagName === 'text') { - answerIndex = $(e.target).index('text'); + //Hack to move correctly the hot spots if there are more than one HS question in same page + answerIndex = $(e.target).html(); + answerIndex = parseInt(answerIndex) - 1; } hotspot = self.hotspotsCollection.get(answerIndex);