-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
2.3.4
-
MOODLE_23_STABLE
NB: All of the tracker issues, posted by 'accessible_for_vip', are based on the theme 'Accessible for VIP' (https://moodle.org/plugins/view.php?plugin=theme_accessible_for_vip) which is developed for people who are blind or have a low vision. All of the (code)solutions are based on the files which belong to this specific theme and are only usable with this theme at this moment (but it is also possible to include the solution in general source code).
Mostly (not always) do you get the ‘confirm’ pop-up when you want to start a quiz and activate the ‘attempt quiz now’ button. This is a javascript pop-up and very difficult to read and handle with a screenreader.
The cause of this problem is not the pop-up directly, but the JavaScript Modals that Moodle use instead of the regular JavaScript alert and confirm pop-ups. To create an accessible pop-up, we have create and changed the code below:
1. We have written a function that make use of a standard JavaScript confirm pop-up correctly (theme/accessible_for_vip/javascript/custom.js)
accessible_confirm = function(e, args) {
|
var conf = confirm(args.message);
|
|
if(!conf) {
|
e.preventDefault();
|
}
|
};
|
2. We coupled this function with an accessible confirm object (theme/accessible_for_vip/lib.php)
class accessible_confirm extends component_action {
|
|
public function __construct($message) {
|
parent::__construct('click', 'accessible_confirm', array(
|
'message' => $message));
|
}
|
}
|
3. At least did we added this action to the relevant button by overriding a renderer (theme/accessible_for_vip/renderers.php)
$button->add_action(new accessible_confirm($startattemptwarning, null,
|
get_string('startattempt', 'quiz')));
|
- duplicates
-
MDL-42428 Update M.util.show_confirm_dialog() to use moodle-core-notification
-
- Closed
-