Scenario: Preview a question using the mouse.
When I click on "Preview" "link" in the "Drag onto image" "table_row"
And I switch to "questionpreview" window
- And I wait "2" seconds
# Odd, but the <br>s go to nothing, not a space.
And I drag "mountainbelt" to place "1" in the drag and drop onto image question
And I drag "continentalshelf" to place "2" in the drag and drop onto image question
Scenario: Preview a question using the keyboard.
When I click on "Preview" "link" in the "Drag onto image" "table_row"
And I switch to "questionpreview" window
- And I wait "1" seconds
And I type " " on place "1" in the drag and drop onto image question
And I type " " on place "2" in the drag and drop onto image question
And I type " " on place "3" in the drag and drop onto image question
* This is the code for question rendering.
*/
Y.extend(DDIMAGEORTEXT_QUESTION, M.qtype_ddimageortext.dd_base_class, {
+ pendingid: '',
initializer : function() {
+ this.pendingid = 'qtype_ddimageortext-' + Math.random().toString(36).slice(2); // Random string.
+ M.util.js_pending(this.pendingid);
this.doc = this.doc_structure(this);
this.poll_for_image_load(null, false, 0, this.create_all_drag_and_drops);
this.doc.bg_img().after('load', this.poll_for_image_load, this,
false, 0, this.create_all_drag_and_drops);
this.doc.drag_item_homes().after('load', this.poll_for_image_load, this,
false, 0, this.create_all_drag_and_drops);
- Y.later(500, this, this.reposition_drags_for_question, [], true);
+ Y.later(500, this, this.reposition_drags_for_question, [pendingid], true);
},
create_all_drag_and_drops : function () {
this.init_drops();
v.on('dragchange', this.drop_zone_key_press, this);
}, this);
}
+ M.util.js_complete(this.pendingid);
},
drop_zone_key_press : function (e) {
switch (e.direction) {
};
Y.extend(DDIMAGEORTEXT_FORM, M.qtype_ddimageortext.dd_base_class, {
+ pendingid: '',
fp : null,
initializer : function() {
+ this.pendingid = 'qtype_ddimageortext-form-' + Math.random().toString(36).slice(2); // Random string.
+ M.util.js_pending(this.pendingid);
this.fp = this.file_pickers();
var tn = Y.one(this.get('topnode'));
tn.one('div.fcontainer').append('<div class="ddarea"><div class="droparea"></div><div class="dragitems"></div>' +