diff --git a/main/plugin/hotspot/hotspot.js b/main/plugin/hotspot/hotspot.js index 6d2fd7010b..e60bdaf099 100644 --- a/main/plugin/hotspot/hotspot.js +++ b/main/plugin/hotspot/hotspot.js @@ -1,104 +1,82 @@ -// in je FORM-tag voor de hotspots: onSubmit="return validateFlashVar('MINIMUM_AANTAL_CLICKS'); - -var flashVar = 1; - -var lcId = new Date().getTime(); -//var flashProxy = new FlashProxy(lcId, "JavaScriptFlashGateway.swf"); - -function validateFlashVar(counter, lang_1, lang_2) -{ - return true; - //alert(counter); - //alert(flashVar); - - if(counter != flashVar) - { - alert(lang_1 + counter + lang_2); - - return false; - } - else - { - return true; - } -} - -function updateFlashVar() -{ - //alert('updateFlashVar: ' + flashVar); - flashVar++; -} - -function getForm() -{ - form = document.create; - if (form == null) - form = document.update; - if (form == null) - form = document.vervangmij; - - return form; -} - -function saveHotspot(question_id, hotspot_id, answer, hotspot_x, hotspot_y) -{ - form = getForm(); - newHotspot = document.createElement("input"); - newHotspot.type = "hidden"; - newHotspot.name = "hotspot["+question_id+"]["+hotspot_id+"]"; - newHotspot.value = hotspot_x + ";" + hotspot_y; - form.appendChild(newHotspot); - - newHotspot = document.createElement("input"); - newHotspot.type = "hidden"; - newHotspot.name = "choice["+question_id+"]["+hotspot_id+"]"; - newHotspot.value = answer; - form.appendChild(newHotspot); -} - -function saveDelineationUserAnswer(question_id, hotspot_id, answer, coordinates) -{ - form = getForm(); - newHotspot = document.createElement("input"); - newHotspot.type = "hidden"; - newHotspot.name = "hotspot["+question_id+"]["+hotspot_id+"]"; - newHotspot.value = coordinates; - form.appendChild(newHotspot); - - newHotspot = document.createElement("input"); - newHotspot.type = "hidden"; - newHotspot.name = "choice["+question_id+"]["+hotspot_id+"]"; - newHotspot.value = answer; - form.appendChild(newHotspot); -} - -function saveShapeHotspot(question_id, hotspot_id, type, x, y, w, h) -{ - form = getForm(); - control = "coordinates[" + (hotspot_id - 1) + "]"; - form[control].value = x + ";" + y + "|" + w + "|" + h; - control = "type[" + (hotspot_id - 1) + "]"; - form[control].value = type; -} - -function savePolyHotspot(question_id, hotspot_id, coordinates) -{ - form = getForm(); - control = "coordinates[" + (hotspot_id - 1) + "]"; - form[control].value = coordinates; - control = "type[" + (hotspot_id - 1) + "]"; - form[control].value = "poly"; -} - -function saveDelineationHotspot(question_id, hotspot_id, coordinates) -{ - form = getForm(); - control = "coordinates[" + (hotspot_id - 1) + "]"; - form[control].value = coordinates; - control = "type[" + (hotspot_id - 1) + "]"; - form[control].value = "delineation"; -} -function jsdebug(debug_string) -{ - alert(debug_string); +// in je FORM-tag voor de hotspots: onSubmit="return validateFlashVar('MINIMUM_AANTAL_CLICKS'); + +var flashVar = 1; + +var lcId = new Date().getTime(); +//var flashProxy = new FlashProxy(lcId, "JavaScriptFlashGateway.swf"); + +function validateFlashVar(counter, lang_1, lang_2) +{ + return true; + //alert(counter); + //alert(flashVar); + + if(counter != flashVar) + { + alert(lang_1 + counter + lang_2); + + return false; + } + else + { + return true; + } +} + +function updateFlashVar() +{ + //alert('updateFlashVar: ' + flashVar); + flashVar++; +} + +function saveHotspot(question_id, hotspot_id, answer, hotspot_x, hotspot_y) +{ + newHotspot = document.createElement("input"); + newHotspot.type = "hidden"; + newHotspot.name = "hotspot["+question_id+"]["+hotspot_id+"]"; + newHotspot.value = hotspot_x + ";" + hotspot_y; + document.frm_exercise.appendChild(newHotspot); + + newHotspot = document.createElement("input"); + newHotspot.type = "hidden"; + newHotspot.name = "choice["+question_id+"]["+hotspot_id+"]"; + newHotspot.value = answer; + document.frm_exercise.appendChild(newHotspot); +} + +function saveDelineationUserAnswer(question_id, hotspot_id, answer, coordinates) +{ + newHotspot = document.createElement("input"); + newHotspot.type = "hidden"; + newHotspot.name = "hotspot["+question_id+"]["+hotspot_id+"]"; + newHotspot.value = coordinates; + document.frm_exercise.appendChild(newHotspot); + + newHotspot = document.createElement("input"); + newHotspot.type = "hidden"; + newHotspot.name = "choice["+question_id+"]["+hotspot_id+"]"; + newHotspot.value = answer; + document.frm_exercise.appendChild(newHotspot); +} + +function saveShapeHotspot(question_id, hotspot_id, type, x, y, w, h) +{ + document.frm_exercise["hotspot_coordinates["+hotspot_id+"]"].value = x + ";" + y + "|" + w + "|" + h; + document.frm_exercise["hotspot_type["+hotspot_id+"]"].value = type; +} + +function savePolyHotspot(question_id, hotspot_id, coordinates) +{ + document.frm_exercise["hotspot_coordinates["+hotspot_id+"]"].value = coordinates; + document.frm_exercise["hotspot_type["+hotspot_id+"]"].value = "poly"; +} + +function saveDelineationHotspot(question_id, hotspot_id, coordinates) +{ + document.frm_exercise["hotspot_coordinates["+hotspot_id+"]"].value = coordinates; + document.frm_exercise["hotspot_type["+hotspot_id+"]"].value = "delineation"; +} +function jsdebug(debug_string) +{ + alert(debug_string); } \ No newline at end of file diff --git a/main/plugin/hotspot/hotspot_admin.fla b/main/plugin/hotspot/hotspot_admin.fla index e8ca958204..1f7ebdc3ff 100644 Binary files a/main/plugin/hotspot/hotspot_admin.fla and b/main/plugin/hotspot/hotspot_admin.fla differ diff --git a/main/plugin/hotspot/hotspot_admin.swf b/main/plugin/hotspot/hotspot_admin.swf index 97e1a49167..3c68bda428 100644 Binary files a/main/plugin/hotspot/hotspot_admin.swf and b/main/plugin/hotspot/hotspot_admin.swf differ