From 5f924369ce0619a8921a3cccd40b529ebede3894 Mon Sep 17 00:00:00 2001 From: Jamie Pratt Date: Sun, 5 Feb 2012 18:37:33 +0700 Subject: [PATCH] MDL-47494 ddimageortext: NOBUG adding an alt tag to drag and drop background image --- question/type/ddimageortext/lang/en/qtype_ddimageortext.php | 1 + question/type/ddimageortext/rendererbase.php | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/question/type/ddimageortext/lang/en/qtype_ddimageortext.php b/question/type/ddimageortext/lang/en/qtype_ddimageortext.php index fb2a650f9a9..7f36f90f7e0 100644 --- a/question/type/ddimageortext/lang/en/qtype_ddimageortext.php +++ b/question/type/ddimageortext/lang/en/qtype_ddimageortext.php @@ -32,6 +32,7 @@ $string['draggableitem'] = 'Draggable item'; $string['draggableitemheader'] = 'Draggable item {$a}'; $string['draggableitemtype'] = 'Type'; $string['draggableword'] = 'Draggable text'; +$string['dropbackground'] = 'Background image for dragging markers onto'; $string['dropzone'] = 'Drop zone {$a}'; $string['dropzoneheader'] = 'Drop zones'; $string['formerror_disallowedtags'] = 'You have used html tags here that are not allowed in a draggable text drag item type.'; diff --git a/question/type/ddimageortext/rendererbase.php b/question/type/ddimageortext/rendererbase.php index a8d72c62f01..9e52e5d0a33 100644 --- a/question/type/ddimageortext/rendererbase.php +++ b/question/type/ddimageortext/rendererbase.php @@ -64,7 +64,11 @@ class qtype_ddtoimage_renderer_base extends qtype_with_combined_feedback_rendere $bgimage = self::get_url_for_image($qa, 'bgimage'); - $img = html_writer::empty_tag('img', array('src'=>$bgimage, 'class'=>'dropbackground')); + $img = html_writer::empty_tag('img', + array('src'=>$bgimage, + 'class'=>'dropbackground', + 'alt' => get_string('dropbackground', 'qtype_ddimageortext'))); + $droparea = html_writer::tag('div', $img, array('class'=>'droparea')); $dragimagehomes = '';