Moodle

Select/deselect all items links on grade_export_form.php

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9
  • Fix Version/s: 1.9, 2.0
  • Component/s: Gradebook
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE, MOODLE_20_STABLE

Description

Doing this probably involves enhancements to formslib. From skype:

[14:43:15] Tim Hunt says: Petr/Nic, on the grade export form, should we have Select all/Deselect all links in the Grade items to be included section?
[14:44:02] Petr Skoda (skodak) says: the select all/none is not yet part of formslib I think
[14:44:20] Petr Skoda (skodak) says: changes in cvs, please update
[14:44:55] Nicolas Connault says: Mhh I could imagine an extra param to the advcheckbox element constructor: $select_group
[14:45:02] Tim Hunt says: Yes, but there is a very generic JS function for doing it in the Moodle libraries, outside formslib, so it would not be hard to add. Maybe I should just stick the idea in the tracker for now.
[14:45:51] Petr Skoda (skodak) says: I implemented something similar in the new coruse reset - it resets the form completely and fills it with some defaults based on clicked button
[14:46:26] Nicolas Connault says: Then a "select all/ select none" links combo element, named after the $select_group
[14:46:40] Nicolas Connault says: this way you could have several multi-selection groups of checkboxes on one page
[14:46:44] Petr Skoda (skodak) says: yes Nicolas - that sounds good
[14:46:54] Tim Hunt says: Yep, that sounds like a good design.
[14:47:18] Tim Hunt says: Alternatively, a single form control that implements a list of checkbox items.
[14:47:27] Nicolas Connault says: I'll take care of it if you want to write and assign the issue
[14:47:35] Petr Skoda (skodak) says: I want more time for all these nice ideas! :@
[14:47:47] Tim Hunt says: OK, I'll file an issue and assign it to Nic.

Activity

Hide
Nicolas Connault added a comment -

The proposed implementation:

$form->addElement('advcheckbox', 'item1', 'label for item 1', array('param1' => 'value1'), 'group1');
$form->addElement('advcheckbox', 'item2', 'label for item 2', array('param1' => 'value1'), 'group1');
$form->addElement('advcheckbox', 'item3', 'label for item 3', array('param1' => 'value1'), 'group1');
$form->addElement('multitick', 'group1');
$form->setDefault('group1', false);

Show
Nicolas Connault added a comment - The proposed implementation: $form->addElement('advcheckbox', 'item1', 'label for item 1', array('param1' => 'value1'), 'group1'); $form->addElement('advcheckbox', 'item2', 'label for item 2', array('param1' => 'value1'), 'group1'); $form->addElement('advcheckbox', 'item3', 'label for item 3', array('param1' => 'value1'), 'group1'); $form->addElement('multitick', 'group1'); $form->setDefault('group1', false);
Hide
Tim Hunt added a comment -

Remind me, how does this compare to the interface for radio button sets.

Show
Tim Hunt added a comment - Remind me, how does this compare to the interface for radio button sets.
Hide
Nicolas Connault added a comment -

The implementation has changed a fair bit but it is now working really nicely, and is still very easy to use: http://docs.moodle.org/en/Development:lib/formslib.php_add_checkbox_controller

Show
Nicolas Connault added a comment - The implementation has changed a fair bit but it is now working really nicely, and is still very easy to use: http://docs.moodle.org/en/Development:lib/formslib.php_add_checkbox_controller

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: