Dash

Blocks ::: block_dash
Maintained by Stefan Scholz
The interface and report builder

Dash 1.0.4

Moodle 3.7, 3.8, 3.9, 3.10
Released: Tuesday, November 24, 2020, 11:26 PM

Dash is a block which can be added anywhere on your moodle site to display various information, e.g. the current user’s profile information or a list of users in the current course. It is built on a powerful engine which supports various data sources and templates.

The free version of dash comes with the users’ data source and a table layout.

It provides the following fields:

  • First name
  • Surname
  • Full name
  • Full name (linked to profile)
  • Email address
  • Username
  • ID number
  • City/town
  • Country
  • Last login
  • Department
  • Institution
  • Address
  • Alternate name
  • First access
  • Description
  • User picture URL
  • User picture
  • User picture (linked to profile)
  • User profile URL
  • User profile link
  • Message URL
  • Message
  • Group name

The following filters are available:

  • Group
  • Department
  • Institution
  • Last login
  • First access

And the following conditions are available:

  • Logged in user
  • My participants / students
  • My groups
  • Current course
  • Current course groups

Typical use cases:

*Display the participants of the current course *Display the current user’s profile information, with support for custom profile fields *List my classmates (everybody who is in the same group) *List all students of a teacher (all participants of all courses where the current user has a teacher role) *List all participants including their picture and group

Development

Key terms

  • Data source: A data source defines which query, fields, and filters are used to retrieve data from a data grid.
  • Field definition: Represents a predefined field that can be added to a data grid.
  • Field attribute: An attribute changes how field definition output is formatted.
  • Data grid: Get data to be displayed in a grid or downloaded as a formatted file.

Field attributes

Rename object ID to object field

If a field value is an ID, you can add the rename_ids_attribute attribute and define how to map IDs to object fields. This is useful when transforming multiple objects.

The following field definition transforms 1,5,123 into Group 1, Group 5, Group 123

[
    'name' => 'u_group_names',
    'select' => "(SELECT string_agg(g200.id::text, ',') FROM {groups} g200 JOIN {groups_members} gm200 ON gm200.groupid = g200.id AND gm200.userid = u.id)",
    'title' => get_string('group'),
    'tables' => ['u'],
    'attributes' => [
        [
            'type' => \block_dash\local\data_grid\field\attribute\rename_ids_attribute::class,
            'options' => [
                'table' => 'groups',
                'field' => 'name',
                'delimiter' => ',' // Separator between each ID in SQL select.
            ]
        ]
    ]
]

Change log

1.0.1

  • Add support for PostgreSQL
  • Improve filtering
  • Add renaming field attribute to map objects to IDs returned by query
  • Moved custom classes to local namespace
  • Improved CSS selectors

Version information

Version build number
2020112400
Version release name
1.0.4
Can be updated from
2020013002, 1.0.1 (2020063000), 1.0.2 (2020070202)
Can be updated to
1.1 (2021022300)
Maturity
Beta
MD5 Sum
9a913bcc4fe424a7db570653a009d096
Supported software
Moodle 3.7, Moodle 3.8, Moodle 3.9, Moodle 3.10
  • Latest release for Moodle 3.7
  • Latest release for Moodle 3.8
  • The more recent release 1.1 (2021022300) exists for Moodle 3.9
  • The more recent release 1.1 (2021022300) exists for Moodle 3.10

Version control information

Version control system (VCS)
GIT
VCS repository URL

Default installation instructions for plugins of the type Blocks

  1. Make sure you have all the required versions.
  2. Download and unpack the block folder.
  3. Place the folder (eg "myblock") in the "blocks" subdirectory.
  4. Visit http://yoursite.com/admin to complete the installation
  5. Turn editing on in any home or course page.
  6. Add the block to the page
  7. Visit the config link in the block for more options.