|
|
@ -1,5 +1,7 @@ |
|
|
|
window.HotspotQuestion = (function () { |
|
|
|
window.HotspotQuestion = (function () { |
|
|
|
return function (settings) { |
|
|
|
return function (settings) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var HotspotModel = function (attributes) { |
|
|
|
var HotspotModel = function (attributes) { |
|
|
|
this.attributes = attributes; |
|
|
|
this.attributes = attributes; |
|
|
|
this.id = 0; |
|
|
|
this.id = 0; |
|
|
@ -53,6 +55,9 @@ window.HotspotQuestion = (function () { |
|
|
|
this.set('height', y - startY); |
|
|
|
this.set('height', y - startY); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SquareModel.decode = function (hotspotInfo) { |
|
|
|
SquareModel.decode = function (hotspotInfo) { |
|
|
|
var coords = hotspotInfo.coord.split('|'), |
|
|
|
var coords = hotspotInfo.coord.split('|'), |
|
|
|
position = coords[0].split(';'), |
|
|
|
position = coords[0].split(';'), |
|
|
@ -268,6 +273,7 @@ window.HotspotQuestion = (function () { |
|
|
|
self.render(); |
|
|
|
self.render(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
HotspotSVG.prototype.render = function () { |
|
|
|
HotspotSVG.prototype.render = function () { |
|
|
|
var newEl = null; |
|
|
|
var newEl = null; |
|
|
|
|
|
|
|
|
|
|
@ -321,6 +327,7 @@ window.HotspotQuestion = (function () { |
|
|
|
self.render(); |
|
|
|
self.render(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
AnswerSVG.prototype.render = function () { |
|
|
|
AnswerSVG.prototype.render = function () { |
|
|
|
this.circleEl.setAttribute('cx', this.model.get('x')); |
|
|
|
this.circleEl.setAttribute('cx', this.model.get('x')); |
|
|
|
this.circleEl.setAttribute('cy', this.model.get('y')); |
|
|
|
this.circleEl.setAttribute('cy', this.model.get('y')); |
|
|
@ -349,6 +356,7 @@ window.HotspotQuestion = (function () { |
|
|
|
|
|
|
|
|
|
|
|
$('.input-group').removeClass('active'); |
|
|
|
$('.input-group').removeClass('active'); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
HotspotSelect.prototype.render = function () { |
|
|
|
HotspotSelect.prototype.render = function () { |
|
|
|
var self = this, |
|
|
|
var self = this, |
|
|
|
$el = $(this.el); |
|
|
|
$el = $(this.el); |
|
|
@ -1119,13 +1127,13 @@ window.HotspotQuestion = (function () { |
|
|
|
|
|
|
|
|
|
|
|
switch (config.for) { |
|
|
|
switch (config.for) { |
|
|
|
case 'admin': |
|
|
|
case 'admin': |
|
|
|
xhrQuestion = $.getJSON('/main/exercice/hotspot_actionscript_admin.as.php', { |
|
|
|
xhrQuestion = $.getJSON(config.relpath+'main/exercice/hotspot_actionscript_admin.as.php', { |
|
|
|
modifyAnswers: parseInt(config.questionId) |
|
|
|
modifyAnswers: parseInt(config.questionId) |
|
|
|
}); |
|
|
|
}); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case 'user': |
|
|
|
case 'user': |
|
|
|
xhrQuestion = $.getJSON('/main/exercice/hotspot_actionscript.as.php', { |
|
|
|
xhrQuestion = $.getJSON(config.relpath+'main/exercice/hotspot_actionscript.as.php', { |
|
|
|
modifyAnswers: parseInt(config.questionId), |
|
|
|
modifyAnswers: parseInt(config.questionId), |
|
|
|
exe_id: parseInt(config.exerciseId) |
|
|
|
exe_id: parseInt(config.exerciseId) |
|
|
|
}); |
|
|
|
}); |
|
|
@ -1134,7 +1142,7 @@ window.HotspotQuestion = (function () { |
|
|
|
case 'solution': |
|
|
|
case 'solution': |
|
|
|
//no break
|
|
|
|
//no break
|
|
|
|
case 'preview': |
|
|
|
case 'preview': |
|
|
|
xhrQuestion = $.getJSON('/main/exercice/hotspot_answers.as.php', { |
|
|
|
xhrQuestion = $.getJSON(config.relPath+'main/exercice/hotspot_answers.as.php', { |
|
|
|
modifyAnswers: parseInt(config.questionId), |
|
|
|
modifyAnswers: parseInt(config.questionId), |
|
|
|
exe_id: parseInt(config.exerciseId) |
|
|
|
exe_id: parseInt(config.exerciseId) |
|
|
|
}); |
|
|
|
}); |
|
|
@ -1732,13 +1740,13 @@ window.DelineationQuestion = (function () { |
|
|
|
|
|
|
|
|
|
|
|
switch (config.for) { |
|
|
|
switch (config.for) { |
|
|
|
case 'admin': |
|
|
|
case 'admin': |
|
|
|
xhrQuestion = $.getJSON('/main/exercice/hotspot_actionscript_admin.as.php', { |
|
|
|
xhrQuestion = $.getJSON(config.relpath+'main/exercice/hotspot_actionscript_admin.as.php', { |
|
|
|
modifyAnswers: parseInt(config.questionId) |
|
|
|
modifyAnswers: parseInt(config.questionId) |
|
|
|
}); |
|
|
|
}); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case 'user': |
|
|
|
case 'user': |
|
|
|
xhrQuestion = $.getJSON('/main/exercice/hotspot_actionscript.as.php', { |
|
|
|
xhrQuestion = $.getJSON(config.relpath+'main/exercice/hotspot_actionscript.as.php', { |
|
|
|
modifyAnswers: parseInt(config.questionId) |
|
|
|
modifyAnswers: parseInt(config.questionId) |
|
|
|
}); |
|
|
|
}); |
|
|
|
break; |
|
|
|
break; |
|
|
@ -1746,7 +1754,7 @@ window.DelineationQuestion = (function () { |
|
|
|
case 'solution': |
|
|
|
case 'solution': |
|
|
|
//no break
|
|
|
|
//no break
|
|
|
|
case 'preview': |
|
|
|
case 'preview': |
|
|
|
xhrQuestion = $.getJSON('/main/exercice/hotspot_answers.as.php', { |
|
|
|
xhrQuestion = $.getJSON(config.relpath+'main/exercice/hotspot_answers.as.php', { |
|
|
|
modifyAnswers: parseInt(config.questionId), |
|
|
|
modifyAnswers: parseInt(config.questionId), |
|
|
|
exe_id: parseInt(config.exerciseId) |
|
|
|
exe_id: parseInt(config.exerciseId) |
|
|
|
}); |
|
|
|
}); |
|
|
|