mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
MDL-55911 Quiz: Accessibility, Label blanks in DD questions
This commit is contained in:
parent
ddd8dc0d1b
commit
b5cbcc4dfb
@ -26,6 +26,7 @@ $string['addmoredropzones'] = 'Blanks for {no} more drop zones';
|
||||
$string['addmoreimages'] = 'Blanks for {no} more draggable items';
|
||||
$string['answer'] = 'Answer';
|
||||
$string['bgimage'] = 'Background image';
|
||||
$string['blank'] = 'blank';
|
||||
$string['correctansweris'] = 'The correct answer is: {$a}';
|
||||
$string['draggableimage'] = 'Draggable image';
|
||||
$string['draggableitem'] = 'Draggable item';
|
||||
|
@ -117,6 +117,7 @@ class qtype_ddtoimage_renderer_base extends qtype_with_combined_feedback_rendere
|
||||
'topnode' => $topnode,
|
||||
'readonly' => $options->readonly);
|
||||
|
||||
$PAGE->requires->string_for_js('blank', 'qtype_ddimageortext');
|
||||
$PAGE->requires->yui_module('moodle-qtype_ddimageortext-dd',
|
||||
'M.qtype_ddimageortext.init_question',
|
||||
array($params));
|
||||
|
@ -482,7 +482,11 @@ Y.extend(DDIMAGEORTEXT_QUESTION, M.qtype_ddimageortext.dd_base_class, {
|
||||
var drop = this.get('drops')[dropno];
|
||||
var nodeclass = 'dropzone group' + drop.group + ' place' + dropno;
|
||||
var title = drop.text.replace('"', '\"');
|
||||
var dropnodehtml = '<div title="' + title + '" class="' + nodeclass + '"> </div>';
|
||||
if (!title) {
|
||||
title = M.util.get_string('blank', 'qtype_ddimageortext');
|
||||
}
|
||||
var dropnodehtml = '<div title="' + title + '" class="' + nodeclass + '">' +
|
||||
'<span class="accesshide">' + title + '</span> </div>';
|
||||
var dropnode = Y.Node.create(dropnodehtml);
|
||||
groupnodes[drop.group].append(dropnode);
|
||||
dropnode.setStyles({'opacity': 0.5});
|
||||
@ -530,4 +534,5 @@ M.qtype_ddimageortext.init_question = function(config) {
|
||||
return new DDIMAGEORTEXT_QUESTION(config);
|
||||
};
|
||||
|
||||
|
||||
}, '@VERSION@', {"requires": ["node", "dd", "dd-drop", "dd-constrain"]});
|
||||
|
File diff suppressed because one or more lines are too long
@ -482,7 +482,11 @@ Y.extend(DDIMAGEORTEXT_QUESTION, M.qtype_ddimageortext.dd_base_class, {
|
||||
var drop = this.get('drops')[dropno];
|
||||
var nodeclass = 'dropzone group' + drop.group + ' place' + dropno;
|
||||
var title = drop.text.replace('"', '\"');
|
||||
var dropnodehtml = '<div title="' + title + '" class="' + nodeclass + '"> </div>';
|
||||
if (!title) {
|
||||
title = M.util.get_string('blank', 'qtype_ddimageortext');
|
||||
}
|
||||
var dropnodehtml = '<div title="' + title + '" class="' + nodeclass + '">' +
|
||||
'<span class="accesshide">' + title + '</span> </div>';
|
||||
var dropnode = Y.Node.create(dropnodehtml);
|
||||
groupnodes[drop.group].append(dropnode);
|
||||
dropnode.setStyles({'opacity': 0.5});
|
||||
@ -530,4 +534,5 @@ M.qtype_ddimageortext.init_question = function(config) {
|
||||
return new DDIMAGEORTEXT_QUESTION(config);
|
||||
};
|
||||
|
||||
|
||||
}, '@VERSION@', {"requires": ["node", "dd", "dd-drop", "dd-constrain"]});
|
||||
|
@ -480,7 +480,11 @@ Y.extend(DDIMAGEORTEXT_QUESTION, M.qtype_ddimageortext.dd_base_class, {
|
||||
var drop = this.get('drops')[dropno];
|
||||
var nodeclass = 'dropzone group' + drop.group + ' place' + dropno;
|
||||
var title = drop.text.replace('"', '\"');
|
||||
var dropnodehtml = '<div title="' + title + '" class="' + nodeclass + '"> </div>';
|
||||
if (!title) {
|
||||
title = M.util.get_string('blank', 'qtype_ddimageortext');
|
||||
}
|
||||
var dropnodehtml = '<div title="' + title + '" class="' + nodeclass + '">' +
|
||||
'<span class="accesshide">' + title + '</span> </div>';
|
||||
var dropnode = Y.Node.create(dropnodehtml);
|
||||
groupnodes[drop.group].append(dropnode);
|
||||
dropnode.setStyles({'opacity': 0.5});
|
||||
@ -526,4 +530,4 @@ Y.Event.define('dragchange', {
|
||||
|
||||
M.qtype_ddimageortext.init_question = function(config) {
|
||||
return new DDIMAGEORTEXT_QUESTION(config);
|
||||
};
|
||||
};
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
$string['addmorechoiceblanks'] = 'Blanks for {no} more choices';
|
||||
$string['answer'] = 'Answer';
|
||||
$string['blank'] = 'blank';
|
||||
$string['correctansweris'] = 'The correct answer is: {$a}';
|
||||
$string['infinite'] = 'Unlimited';
|
||||
$string['pleaseputananswerineachbox'] = 'Please put an answer in each box.';
|
||||
|
@ -104,7 +104,8 @@ class qtype_ddwtos_renderer extends qtype_elements_embedded_in_question_text_ren
|
||||
question_display_options $options) {
|
||||
$question = $qa->get_question();
|
||||
$group = $question->places[$place];
|
||||
$boxcontents = ' ';
|
||||
$boxcontents = ' ' . html_writer::tag('span',
|
||||
get_string('blank', 'qtype_ddwtos'), array('class' => 'accesshide'));
|
||||
|
||||
$value = $qa->get_last_qt_var($question->field($place));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user