diff --git a/question/type/ddmarker/yui/build/moodle-qtype_ddmarker-form/moodle-qtype_ddmarker-form-debug.js b/question/type/ddmarker/yui/build/moodle-qtype_ddmarker-form/moodle-qtype_ddmarker-form-debug.js
index 13d6512bf2e..4d60ffac64b 100644
--- a/question/type/ddmarker/yui/build/moodle-qtype_ddmarker-form/moodle-qtype_ddmarker-form-debug.js
+++ b/question/type/ddmarker/yui/build/moodle-qtype_ddmarker-form/moodle-qtype_ddmarker-form-debug.js
@@ -32,10 +32,14 @@ Y.extend(DDMARKER_FORM, M.qtype_ddmarker.dd_base_class, {
var tn = Y.one(this.get('topnode'));
tn.one('div.fcontainer').append(
'
' +
- '
' +
- '
' +
- '
' +
- '
' +
+ '
' +
+ '
' +
+ '
' +
+ '' +
+ '
' +
'
');
this.doc = this.doc_structure(this);
this.stop_selector_events();
@@ -44,6 +48,15 @@ Y.extend(DDMARKER_FORM, M.qtype_ddmarker.dd_base_class, {
Y.later(500, this, this.update_drop_zones, [pendingid], true);
Y.after(this.load_bg_image, M.form_filepicker, 'callback', this);
this.load_bg_image();
+
+ var topnode = Y.one(this.get('topnode'));
+ topnode.one('.grid').on('mousemove', function (e) {
+ var img = topnode.one('.dropbackground');
+ var x = Math.round(Number(e.pageX) - img.getX() - 1);
+ var y = Math.round(Number(e.pageY) - img.getY() - 1);
+ topnode.one('#xcoordpreview').setHTML("X = " + x);
+ topnode.one('#ycoordpreview').setHTML("Y = " + y);
+ });
},
load_bg_image : function() {
@@ -118,7 +131,7 @@ Y.extend(DDMARKER_FORM, M.qtype_ddmarker.dd_base_class, {
}
},
set_options_for_drag_item_selectors : function () {
- var dragitemsoptions = {'0': ''};
+ var dragitemsoptions = {0: ''};
for (var i = 1; i <= this.form.get_form_value('noitems', []); i++) {
var label = this.get_marker_text(i);
if (label !== "") {
diff --git a/question/type/ddmarker/yui/build/moodle-qtype_ddmarker-form/moodle-qtype_ddmarker-form-min.js b/question/type/ddmarker/yui/build/moodle-qtype_ddmarker-form/moodle-qtype_ddmarker-form-min.js
index 8247169c3e9..41fc7ca0f27 100644
--- a/question/type/ddmarker/yui/build/moodle-qtype_ddmarker-form/moodle-qtype_ddmarker-form-min.js
+++ b/question/type/ddmarker/yui/build/moodle-qtype_ddmarker-form/moodle-qtype_ddmarker-form-min.js
@@ -1 +1 @@
-YUI.add("moodle-qtype_ddmarker-form",function(e,t){var n="moodle-qtype_ddmarker-form",r=function(){r.superclass.constructor.apply(this,arguments)};e.extend(r,M.qtype_ddmarker.dd_base_class,{fp:null,initializer:function(){var t="qtype_ddmarker-form-"+Math.random().toString(36).slice(2);M.util.js_pending(t),this.fp=this.file_pickers();var n=e.one(this.get("topnode"));n.one("div.fcontainer").append(''),this.doc=this.doc_structure(this),this.stop_selector_events(),this.set_options_for_drag_item_selectors(),this.setup_form_events(),e.later(500,this,this.update_drop_zones,[t],!0),e.after(this.load_bg_image,M.form_filepicker,"callback",this),this.load_bg_image()},load_bg_image:function(){var t=this.fp.file("bgimage").href;if(t!==null){this.doc.load_bg_img(t);var n=new e.DD.Drop({node:this.doc.bg_img()});n.on("drop:hit",function(e){e.drag.get("node").setData("gooddrop",!0)}),this.afterimageloaddone=!1,this.doc.bg_img().on("load",this.constrain_image_size,this)}},constrain_image_size:function(e){var t=this.get("maxsizes").bgimage,n=Math.max(e.target.get("width")/t.width,e.target.get("height")/t.height);n>1&&e.target.set("width",Math.floor(e.target.get("width")/n)),e.target.addClass("constrained"),e.target.detach("load",this.constrain_image_size)},update_drop_zones:function(t){this.graphics!==null&&this.graphics.destroy(),this.restart_colours(),this.graphics=new e.Graphic({render:"div.ddarea div.dropzones"});var n=this.form.get_form_value("nodropzone",[]);for(var r=0;r'+t[o]+"";s.append(u);var a=s.one('option[value="'+o+'"]');if(o===i[n])a.set("selected",!0);else if(o!==0){var f=this.form.get_form_value("drags",[o-1,"noofdrags"]);if(Number(f)!==0)for(var l in i)if(Number(i[l])===o){if(Number(f)===1){a.set("disabled",!0);break}f--}}}}},stop_selector_events:function(){e.all("fieldset#id_dropzoneheader select").detachAll()},setup_form_events:function(){e.all("fieldset#id_draggableitemheader input").on("change",function(){this.set_options_for_drag_item_selectors()},this),e.all("fieldset#id_draggableitemheader select").on("change",function(){this.set_options_for_drag_item_selectors()},this),e.all("fieldset#id_dropzoneheader select").on("change",function(){this.set_options_for_drag_item_selectors()},this)},form:{to_name_with_index:function(e,t){var n=e;for(var r=0;r'),this.doc=this.doc_structure(this),this.stop_selector_events(),this.set_options_for_drag_item_selectors(),this.setup_form_events(),e.later(500,this,this.update_drop_zones,[t],!0),e.after(this.load_bg_image,M.form_filepicker,"callback",this),this.load_bg_image();var r=e.one(this.get("topnode"));r.one(".grid").on("mousemove",function(e){var t=r.one(".dropbackground"),n=Math.round(Number(e.pageX)-t.getX()-1),i=Math.round(Number(e.pageY)-t.getY()-1);r.one("#xcoordpreview").setHTML("X = "+n),r.one("#ycoordpreview").setHTML("Y = "+i)})},load_bg_image:function(){var t=this.fp.file("bgimage").href;if(t!==null){this.doc.load_bg_img(t);var n=new e.DD.Drop({node:this.doc.bg_img()});n.on("drop:hit",function(e){e.drag.get("node").setData("gooddrop",!0)}),this.afterimageloaddone=!1,this.doc.bg_img().on("load",this.constrain_image_size,this)}},constrain_image_size:function(e){var t=this.get("maxsizes").bgimage,n=Math.max(e.target.get("width")/t.width,e.target.get("height")/t.height);n>1&&e.target.set("width",Math.floor(e.target.get("width")/n)),e.target.addClass("constrained"),e.target.detach("load",this.constrain_image_size)},update_drop_zones:function(t){this.graphics!==null&&this.graphics.destroy(),this.restart_colours(),this.graphics=new e.Graphic({render:"div.ddarea div.dropzones"});var n=this.form.get_form_value("nodropzone",[]);for(var r=0;r'+t[o]+"";s.append(u);var a=s.one('option[value="'+o+'"]');if(o===i[n])a.set("selected",!0);else if(o!==0){var f=this.form.get_form_value("drags",[o-1,"noofdrags"]);if(Number(f)!==0)for(var l in i)if(Number(i[l])===o){if(Number(f)===1){a.set("disabled",!0);break}f--}}}}},stop_selector_events:function(){e.all("fieldset#id_dropzoneheader select").detachAll()},setup_form_events:function(){e.all("fieldset#id_draggableitemheader input").on("change",function(){this.set_options_for_drag_item_selectors()},this),e.all("fieldset#id_draggableitemheader select").on("change",function(){this.set_options_for_drag_item_selectors()},this),e.all("fieldset#id_dropzoneheader select").on("change",function(){this.set_options_for_drag_item_selectors()},this)},form:{to_name_with_index:function(e,t){var n=e;for(var r=0;r' +
- '' +
- '' +
- '' +
- '' +
+ '' +
+ '' +
+ '' +
+ '' +
+ '' +
'');
this.doc = this.doc_structure(this);
this.stop_selector_events();
@@ -44,6 +48,15 @@ Y.extend(DDMARKER_FORM, M.qtype_ddmarker.dd_base_class, {
Y.later(500, this, this.update_drop_zones, [pendingid], true);
Y.after(this.load_bg_image, M.form_filepicker, 'callback', this);
this.load_bg_image();
+
+ var topnode = Y.one(this.get('topnode'));
+ topnode.one('.grid').on('mousemove', function (e) {
+ var img = topnode.one('.dropbackground');
+ var x = Math.round(Number(e.pageX) - img.getX() - 1);
+ var y = Math.round(Number(e.pageY) - img.getY() - 1);
+ topnode.one('#xcoordpreview').setHTML("X = " + x);
+ topnode.one('#ycoordpreview').setHTML("Y = " + y);
+ });
},
load_bg_image : function() {
@@ -118,7 +131,7 @@ Y.extend(DDMARKER_FORM, M.qtype_ddmarker.dd_base_class, {
}
},
set_options_for_drag_item_selectors : function () {
- var dragitemsoptions = {'0': ''};
+ var dragitemsoptions = {0: ''};
for (var i = 1; i <= this.form.get_form_value('noitems', []); i++) {
var label = this.get_marker_text(i);
if (label !== "") {
diff --git a/question/type/ddmarker/yui/src/form/js/form.js b/question/type/ddmarker/yui/src/form/js/form.js
index 339da2fcdc0..04897cbbe62 100644
--- a/question/type/ddmarker/yui/src/form/js/form.js
+++ b/question/type/ddmarker/yui/src/form/js/form.js
@@ -30,10 +30,14 @@ Y.extend(DDMARKER_FORM, M.qtype_ddmarker.dd_base_class, {
var tn = Y.one(this.get('topnode'));
tn.one('div.fcontainer').append(
'' +
- '
' +
- '
' +
- '
' +
- '
' +
+ '
' +
+ '
' +
+ '
' +
+ '' +
+ '
' +
'
');
this.doc = this.doc_structure(this);
this.stop_selector_events();
@@ -42,6 +46,15 @@ Y.extend(DDMARKER_FORM, M.qtype_ddmarker.dd_base_class, {
Y.later(500, this, this.update_drop_zones, [pendingid], true);
Y.after(this.load_bg_image, M.form_filepicker, 'callback', this);
this.load_bg_image();
+
+ var topnode = Y.one(this.get('topnode'));
+ topnode.one('.grid').on('mousemove', function (e) {
+ var img = topnode.one('.dropbackground');
+ var x = Math.round(Number(e.pageX) - img.getX() - 1);
+ var y = Math.round(Number(e.pageY) - img.getY() - 1);
+ topnode.one('#xcoordpreview').setHTML("X = " + x);
+ topnode.one('#ycoordpreview').setHTML("Y = " + y);
+ });
},
load_bg_image : function() {
@@ -116,7 +129,7 @@ Y.extend(DDMARKER_FORM, M.qtype_ddmarker.dd_base_class, {
}
},
set_options_for_drag_item_selectors : function () {
- var dragitemsoptions = {'0': ''};
+ var dragitemsoptions = {0: ''};
for (var i = 1; i <= this.form.get_form_value('noitems', []); i++) {
var label = this.get_marker_text(i);
if (label !== "") {