diff --git a/question/type/ddimageortext/edit_ddimagetoimage_form.php b/question/type/ddimageortext/edit_ddimagetoimage_form.php
index 1f9e41e5874..7b255359d54 100644
--- a/question/type/ddimageortext/edit_ddimagetoimage_form.php
+++ b/question/type/ddimageortext/edit_ddimagetoimage_form.php
@@ -276,6 +276,7 @@ class qtype_ddimagetoimage_edit_form extends question_edit_form {
$PAGE->requires->yui_module('moodle-qtype_ddimagetoimage-form',
'M.qtype_ddimagetoimage.init_form',
array($params));
+ //$PAGE->requires->css('/lib/yui/3.4.0/build/csscssfonts/fonts-context-min.css');
return $question;
}
@@ -316,12 +317,7 @@ class qtype_ddimagetoimage_edit_form extends question_edit_form {
$errors["drops[$i]"] =
get_string('formerror_noxleft', 'qtype_ddimagetoimage');
}
- if (!self::file_uploaded($data['dragitem'][$choice - 1])) {
- $errors["drops[$i]"] =
- get_string('formerror_nofile', 'qtype_ddimagetoimage', $choice);
- $errors['dragitem['.($choice - 1).']'] =
- get_string('formerror_nofile2', 'qtype_ddimagetoimage', $i);
- }
+
if (isset($allchoices[$choice]) && !$data['drags'][$choice-1]['infinite']) {
$errors["drops[$i]"] =
get_string('formerror_multipledraginstance', 'qtype_ddimagetoimage', $choice);
diff --git a/question/type/ddimageortext/renderer.php b/question/type/ddimageortext/renderer.php
index 6f8d585c3c6..7b23f86a11b 100755
--- a/question/type/ddimageortext/renderer.php
+++ b/question/type/ddimageortext/renderer.php
@@ -37,7 +37,12 @@ require_once($CFG->dirroot . '/question/type/gapselect/rendererbase.php');
*/
class qtype_ddimagetoimage_renderer extends qtype_with_combined_feedback_renderer {
-
+ public function head_code(question_attempt $qa) {
+ $this->page->requires->css('/lib/yui/3.4.0/build/csscssfonts/fonts-context-min.css');
+ $this->page->requires->yui2_lib('event');
+ $this->page->requires->yui2_lib('dragdrop');
+ return parent::head_code($qa);
+ }
public function clear_wrong(question_attempt $qa) {
$question = $qa->get_question();
$response = $qa->get_last_qt_data();
@@ -84,9 +89,18 @@ class qtype_ddimagetoimage_renderer extends qtype_with_combined_feedback_rendere
if ($dragimage->isinfinite) {
$classes[] = 'infinite';
}
- $dragimagehomesgroup .= html_writer::empty_tag('img',
- array('src'=>$dragimageurl,
- 'class'=>join(' ', $classes)));
+ if ($dragimageurl === null) {
+ $classes[] = 'yui3-cssfonts';
+ $dragimagehomesgroup .= html_writer::tag('div',
+ $dragimage->text,
+ array('src'=>$dragimageurl,
+ 'class'=>join(' ', $classes)));
+ } else {
+ $dragimagehomesgroup .= html_writer::empty_tag('img',
+ array('src'=>$dragimageurl,
+ 'alt' => $dragimage->text,
+ 'class'=>join(' ', $classes)));
+ }
}
$dragimagehomes .= html_writer::tag('div', $dragimagehomesgroup,
array('class'=>'dragitemgroup'.$groupno));
diff --git a/question/type/ddimageortext/yui/dd/dd.js b/question/type/ddimageortext/yui/dd/dd.js
index 622db858bc7..1f45d634df5 100644
--- a/question/type/ddimageortext/yui/dd/dd.js
+++ b/question/type/ddimageortext/yui/dd/dd.js
@@ -87,7 +87,7 @@ YUI.add('moodle-qtype_ddimagetoimage-dd', function(Y) {
var oldhome = this.drag_image_home(dragimageno);
var classes = 'draghome dragimagehomes'+dragimageno+' group'+group;
var imghtml = '';
- var divhtml = '