Code Monkey home page Code Monkey logo

moodle-mod_datalynx's Introduction

Moodle datalynx Module (mod_datalynx)

Build Status

This Moodle plugin is a powerful data management tool that allows you to create digital workflows for data management. Example usecases of this module are:

  • Education program management: Manage online courses, communicate with lecturers provide infos and keep an overview of ongoing, future and past courses.
  • Provide an application workflow for online applications (Submit application, Review application, Change status, Add comments)
  • Provide a course catalog
  • Manage conferences (Conference call, participants registration, paper submission etc.)

This is a professional tool. You can explore its potential the best way, when you are contracting edulabs.org for creating your personal digital workflow. Please contact [email protected] for improvements bug reports etc.

What Does It Do?

The datalynx module provides possibilities to collect structured data and to process, display and export that data. You can create forms visible to ceratain users and views to display data for administration or for teachers. You can set fields and views visible or invisible for certain roles. You can also defines behaviours of fields and renderers for fields and views. Custom filters provide the possibility to filter and search data.

Interested in more features? Contact us for a quote.

Features

  • More then 20 different data types for structured data (from text to date to teammembers)
  • Create views visible to certain roles
  • Filter data with powerful filtering and search methods including a custom filter and an advanced filter
  • Create renderers in order to display your data the way you want it
  • Define notifications to be sent to certain roles triggered by events like "comment added"
  • Export your data to CSV, PDF
  • Import data via CSV
  • Create templates
  • Create views for administration, export, overview, etc..
  • Create field behaviours like required fields
  • Create renderers for fields

Documentation

Visit Moodle docs wiki for documentation. Installation documentation see installation

Communication

Contributing to the datalynx module

Contact me on github (see above)

Troubleshooting, Bugs, and Feedback

License

GPL Logo The Moodle datalynx module is licensed under the GNU General Public License, Version 3.

Contributors

Main contributers are David Bogner, Itamar Tzadok, Michael Niedermayer, Michael Pollak, Ivan Sầkiĉ, and many others.

moodle-mod_datalynx's People

Contributors

bluetom avatar danerk avatar dasistwas avatar georgmaisser avatar isakic avatar michaelpollak avatar phager-at avatar whlk avatar winnidat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

moodle-mod_datalynx's Issues

Uploading images with spaces in filename generates TCPDF error upon PDF export

How to reproduce:

  1. Create a Grid view
  2. Create a field type "Picture"
  3. Create a PDF view
  4. Add an entry and upload an image that has spaces in the filename (uploading files with without spaces in filenames works fine)
  5. Export PDF

Result:

Exception - TCPDF ERROR: [Image] Unable to get the size of the image: http://localhost/moodle/pluginfile.php/13472/mod_datalynx/content/409/Screenshot_2018-09-19%20H%C3%9C4%20SPO%201%20%2C%203%204%20Fall%20%28servus%2C%20miles%2C%20puella%3B%20Sg%20Pl%29.png

More information about this error
Debug info:
Error code: generalexceptionmessage
Stack trace:


    line 2927 of /lib/tcpdf/tcpdf.php: Exception thrown
    line 6890 of /lib/tcpdf/tcpdf.php: call to TCPDF->Error()
    line 18897 of /lib/tcpdf/tcpdf.php: call to TCPDF->Image()
    line 18284 of /lib/tcpdf/tcpdf.php: call to TCPDF->openHTMLTagHandler()
    line 5828 of /lib/tcpdf/tcpdf.php: call to TCPDF->writeHTML()
    line 18216 of /lib/tcpdf/tcpdf.php: call to TCPDF->MultiCell()
    line 741 of /mod/datalynx/view/pdf/view_class.php: call to TCPDF->writeHTML()
    line 251 of /mod/datalynx/view/pdf/view_class.php: call to datalynxview_pdf->write_html()
    line 138 of /mod/datalynx/view/pdf/view_class.php: call to datalynxview_pdf->process_export()
    line 672 of /mod/datalynx/mod_class.php: call to datalynxview_pdf->process_data()
    line 50 of /mod/datalynx/view.php: call to datalynx->set_content()

Convert datalynx.js to AMD module

There is still one JavaScript file using YUI: datalynx.js. This should be converted to an AMD module. Most of the JavaScript Code is used to transform the patterns [[fieldname|behavior|renderer]] or [[author:username]] to a more user friendly editable field within the editor when editing the view settings. The implementation is not perfect: For example you can not drag and drop the patterns somewhere else in the editor.

  1. So first thing is to do a research: What is the best and easiest way to implement such a UI for the patterns with jQuery?
  2. Next is to post an outline of the desired approach here.
  3. Then start the implementation.
  4. I think currently only Atto editor is supported. Maybe extend support to other editor too.
  5. We have to keep in mind, that sometimes a field is used within an html attribute like
    <a href="http://example.com/?id=##entryid##" >some linktext</a>

There is also some other JS in the datalnx.js file. And I think some of the functions are obsolete like showHideAdvSearch and bulk_action (but this has to be verified.

Custom filter: teammemberselect does not work

When creating a custom filter and adding the field of type teammemberselect to it, the filter form is not rendered correctly and probably also not working correctly. It apparently is not using the method

public function render_search_mode(MoodleQuickForm &$mform, $i = 0, $value = '') {

Please also test the custom filter form a little bit. There might be additional bugs.

Adding more than 1 field of same type should be possible in a view

Currently it is not possible to add more than one field of the same field type.
Example:
Field named "Description" of type editor has 2 variants:
[[Description]]
[[Description:excerpt]]

If I add the 2 patterns in the entry settings of the view, I can not save the view due to an error message " You can not use the field Description more than once. "

URGENT: Saving / displaying and editing entries with fieldgroups does not work

How to reproduce:

  1. Add fieldgroup (settings: 1 required, 3 default, 10 max)
  2. Add field time also to fg
  3. Add field picture also to fg
    4 Add field text also to fg
  4. Add field editor also to fg
  5. Add field textarea also to fg

Create grid view from default. Make it default view and edit view
Add one entry with one fieldgroup. Save.
Edit entry: add further 2 fieldgroups. Save.
Edit entry: Change the content of the 3 fieldgroups, Save.

Result: Content not changing, in view mode not all entries show up, and a lots of other issues.

What causes those strange problems? We need to solve this and make it a solid solution.

Make it possible to override view filter

Current situation: When a filter is defined in the view settings, then it is not possible to add a custom filter to the view. It should be possible to override this filter with a custom filter, that is added to the view template. So there should be a checkbox in the view settings in order to make it possible to override the predefined filter with the filter in the view settings. The checkbox must be unchecked per default, as this is a security issue: Sometimes a filter is used in order to prevent people to see entries they are not allowed to see: Example: They can just see entries they created. So only when the checkbox is activated overriding the filter with a custom filter should be possible.

Display of fieldgroup in PDF view

In PDF view the fieldgroup should be displayed as a table with the fieldnames in the header of the table.
This should be done in the future by a special renderer for the field of type fieldgroup, but meanwhile a special template for PDF view should to the trick.

For field checkbox I can enable autocomplete

When I set up a new field of class checkbox I can select autocomplete: yes. But there is actually no renderer for this option. Should be fixed in the class when we have time.

It is unclear how this relates to mod_dataform

It is apparent that the module re-uses significant parts of the existing mod_dataform plugin. It even tries to handle its content files via the pluginfile callback. However, I haven't found any clarification of what makes this module unique, why it has been forked (instead of contributing to the original one), what are made differences etc.
Also, copyright notices are not clear on this, kept with Itamar Tzadok's copyright. Please refer to https://docs.moodle.org/dev/Plugin_contribution_checklist#Copyrights

Restore teammemberselect removes quotes

When I restore a teammemberselect field the content is inserted without quotation marks.
The quotation marks are present in the backup file.

Correct format: ["123"], ["123","234"]
Restored: [123], [123,234]

After backup / restore error message due to not backing up / restoring fields in fieldgroup

`

Exception - Call to a member function for_use_in_fieldgroup() on boolean

More information about this error
Debug info:
Error code: generalexceptionmessage
Stack trace:

line 185 of /mod/datalynx/field/fieldgroup/renderer.php: Error thrown
line 47 of /mod/datalynx/field/fieldgroup/renderer.php: call to datalynxfield_fieldgroup_renderer->get_subfields()
line 155 of /mod/datalynx/field/renderer.php: call to datalynxfield_fieldgroup_renderer->render_display_mode()
line 303 of /mod/datalynx/field/field_class.php: call to datalynxfield_renderer->replacements()
line 1255 of /mod/datalynx/view/view_class.php: call to datalynxfield_base->get_definitions()
line 1230 of /mod/datalynx/view/view_class.php: call to datalynxview_base->get_entry_tag_replacements()
line 1157 of /mod/datalynx/view/view_class.php: call to datalynxview_base->get_entries_definition()
line 1116 of /mod/datalynx/view/view_class.php: call to datalynxview_base->definition_to_html()
line 588 of /mod/datalynx/view/view_class.php: call to datalynxview_base->display_entries()
line 768 of /mod/datalynx/classes/datalynx.php: call to datalynxview_base->display()
line 55 of /mod/datalynx/view.php: call to mod_datalynx\datalynx->display()`

The reason seems to be, that the fieldgroup does not have any field anymore. So backup/restore does not include the fields of the fieldgroup in the fieldgroup settings on backup/restore.

digifolio issue when adding new view of type grid

Notice: Undefined index: Fields in /data/web/www/vhosts/www.digifolio.at/data/nachweis/mod/datalynx/view/view_form.php on line 327

Warning: Invalid argument supplied for foreach() in /data/web/www/vhosts/www.digifolio.at/data/nachweis/mod/datalynx/view/view_form.php on line 327

Multiselect fields refuse to be empty

I set up a basic datalynx instance,
I add a field multiselect,
I select the value (a),
I save, everything is as expected.

I edit this entry,
I remove (a) and save.
I still see (a).

Multiselect does not pass along an empty value.

New feature: Repeatable fieldgroups

Goal

The goal of this feature is to have the possibility to have several fields grouped, that can be filled out repeatedly within a single entry.
Example: Work experience has to be filled out. So there are alwas the same fields, that have to be filled ou in a repeated way. So the repeated field group will be named „Work experience“ and consists of 4 fields: Employer, job title, from, to.

Work experience:
Employer, Job title, from, to

It is possible to fill out these field multiple times.

Hierarchy of the feature
The feature should be implemented at the same hierarchical level as behaviour and renderer. So there will be behaviour, renderer and fieldgroup as submenu of the fields section in the datalynx manage view.

Settings

These field settings should be implemented:

  1. Number of times the field group can be filled out
  2. Text only field: Each line can have a fieldname. The vertical order of the field names defines the position of the field in the field group. Example setting:
    employer
    job title
    from
    to
  3. Field name
  4. Field description
  5. Display mode: Card layout, Standard grid (this is optional)
  6. Number of fieldgroups to show by default (for example if I can fill out up to 10 work experiences, there will be only 3 fieldgroups be displayed when starting the form. Additional fieldgroups can be added via Ajax (clicking on a plus-Button)
  7. Number of required fieldgroups to be filled out

Implementation

In order to implement this feature there have to be several additions to be done within the base classes and the database structure itself.
datalynx_contents: There should be an extra column that includes the fieldgroup id. The fieldgroup id refers to the fieldid of the fieldgroup field and defaults to 0 (no field group) or null (no field group). This is necessary in order to identify which content belongs to a fieldgroup and which content to a regular field. Usually there is only a single datalynx_contents db-entry for each field of a datalynx entry. This will change with the implementation of implementation of the repeated fieldgroups. There can be more the one datalynx_content entries per field and dl-entry.

Possible problems

Filter and search: This has to be excluded from filter and search as the filter is done by the respective fields themselves
For the fields, there might be the need to update the search and filter SQL. Also build an abstract class in order to handle the new fields

Usability and display

Adding more than one fieldgroup should be implemented via AJAX. So starting with the default number of fieldgroups to fill out, there can be added additional fieldgroups be clicking on a button. The additional fieldgroups should then be added (if necessary by ajax, but maybe DOM-manipuliation is enough).

Challenge required field

The fields are required or not individually. So if I fill out one of 3 work experiences, then the fields may or not be required (for example the job title could be optional, but not the from and to). In addition to that, there has to be a validation, that the number of required fieldgroups is added.

mod_datalynx_mod_form::definition() calls add_action_buttons() twice

This might have been intended as a feature, trying to avoid unnecessary scrolling. However, the consistency is a key element of usability. It does not work well if all activity modules work certain way, and only this would would be different.

The add_action_buttons() should be called just once at the end, same as elsewhere.

Data of field of type text with field setting "Autocomplete" is not deleted in fieldgroup when clicking on delete button

How to reproduce

  1. Add field of type text named "mytext" make it an autocomplete field
  2. Add some other field "random"
  3. Add fieldgroup named "myfieldgroup" and add field "mytext" and "random" to the fieldgroup
  4. Create a grid view (default and editing)
  5. Add an entry with 2 repeating fields
  6. Edit the entry and try to delete the last row of the entry -> value in "mytext" is not removed.

Setting form fields without a help tooltip

Certain fields in the setting form are not fully intuitive purely from their label text. E.g. "Interval duration" or "Number of intervals". There should be a help tool-tip describing them.

Add excerpt feature for field editor

You can store a lot of text in the field editor. If you want to have a short preview of the text, then it would be good to have only the first characters displayed. So in addition to the [[fieldname]] there could also be a [[fieldname:excerpt]] pattern that is replaced with the excerpt instead of the full content. (Also with stripped HTML as plain text)

Render field of type picture in PDF does not work properly

When I have an upload field of type picture and I upload multiple picture and then integrate the pictures in PDF view, not all pictures are visible in the PDF. A save way to render would be to include one picture per page. Not sure how to assure proper integration of images in the PDF otherwise.

Pass field url as an array.

The field class URL passes _url and _alt as content. I would argue that this should be normalized and passed as an array containing url and alt, like we do with editor and other field classes.

Add user profile badges to fields

There should be a possibility to display the users' badges as a field similar to
##author:username## there should be this pattern available:
##author:badges##

Display all the badges earned by a user. (course and site badges).

After adding a site badge, warning is displayed concerning missing capability

Capability "mod/datalynx:notifymemberupdated" was not found! This has to be fixed in code.

line 453 of /lib/accesslib.php: call to debugging()
line 578 of /lib/messagelib.php: call to has_capability()
line 187 of /lib/messagelib.php: call to message_get_providers_for_user()
line 1001 of /lib/badgeslib.php: call to message_send()
line 486 of /lib/badgeslib.php: call to badges_notify_badge_award()
line 558 of /lib/badgeslib.php: call to badge->issue()
line 95 of /badges/action.php: call to badge->review_all_criteria()

Capability "mod/datalynx:notifymemberupdated" was not found! This has to be fixed in code.

line 453 of /lib/accesslib.php: call to debugging()
line 578 of /lib/messagelib.php: call to has_capability()
line 187 of /lib/messagelib.php: call to message_get_providers_for_user()
line 1001 of /lib/badgeslib.php: call to message_send()
line 486 of /lib/badgeslib.php: call to badges_notify_badge_award()
line 558 of /lib/badgeslib.php: call to badge->issue()
line 95 of /badges/action.php: call to badge->review_all_criteria()

Capability "mod/datalynx:notifymemberupdated" was not found! This has to be fixed in code.

line 453 of /lib/accesslib.php: call to debugging()
line 578 of /lib/messagelib.php: call to has_capability()
line 187 of /lib/messagelib.php: call to message_get_providers_for_user()
line 1001 of /lib/badgeslib.php: call to message_send()
line 486 of /lib/badgeslib.php: call to badges_notify_badge_award()
line 558 of /lib/badgeslib.php: call to badge->issue()
line 95 of /badges/action.php: call to badge->review_all_criteria()

Store line number in datalynx_contents

To make it easier to sort and remove content lines we will add the lineid to the database table when update is used in a fieldgroups context, else keep lineid 0.

  1. Add to database on update.
  2. Look up all multiples for "entryid" and "fieldid" and update these lineids.
  3. Extend content fetching.
  4. Extend updating
  5. Extend removing for all or specific line

Custom filter with identical names

It is possible to add two custom filters with the same name in a datalynx instance. This should not be possible to do. So upon submission of a custom filter add a validation in order to prevent that.

options_menu differs in implementation

The function options_menu is overwritten in teammemberselect but arguments are used differently. I'd argue that "$addnoselection" should always be the first argument to avoid mistakes.

New field renderer and field behavior design

There should be a major change in how field renderers and behaviors are designed. The main purpose is to move the application of the renderer from the view settings to the renderer settings so that the patterns [[fieldname|renderer|behavior]] is obsolete.
To improve the renderer we have to add the following:

Create new renderer

Right now there is a link "Add renderer" when clicking on the tab renderer. In the future there should be different types of renderers selectable from a dropdown:

  • General renderer (like the current renderer)
  • Renderer for a field type: These are specific rendering settings for a field of type URL or picture, etc.. that are only applicable for this type of field

Renderer settings

There should be additional settings for the renderer:

  • The fieldname the renderer is applied to (only display eligible fieldnames) exclude those which are already used by the same type of renderer for a view (may be complicated as there have to be 2 checks: fieldname and view the field is used in)
  • The viewname the renderer is applied to. So the renderer will only be applied in this view and not in others.

Behavior

There are only general behaviors right now. So we just add the fieldname and viewname the behavior is applied to in the settings.

Files uploaded in fieldgroup file field are not saved

This happens only when I have more than one entry per user. The first entry of the user is correctly saved, the second is not saved.

How to reproduce:

  1. Add a field of type file
  2. Add fieldgroup field including the file field
  3. add an entry and upload a file for each file field in the fieldgroup
  4. Save entry and display
  5. Result: No files are displayed.

Attention: All fields are affected. Not only files. If a user has 2 entries, then only the data is only saved for the first entry!

Line id is used twice which leads to corrupt HTML output

When I use 2 fieldgroups in a view I have the same ID twice. Using ids should always be done with care and if possible then use classes instead:

<div class="lines" id="line_1">
Just discovered, that there is more HTML mess. Please be careful:
<div class="form-control-feedback invalid-feedback" id="id_error_" >

Fieldgroups _id and _content gets dropped

Trying to track this down for a while now,
when I delete all but one line in a fieldgroup there is some strange behaviour. Figured out that in the $entry I can not see the normal _id and _content, both are empty at that point but should show the contentid of this line.

Expected behaviour is:
In case there is only one line in the database use _id to be backwards compatible,
else build array _id_fieldgroup to store multiple content ids.

UX and UI of fieldgroups not yet good

The fieldgroups lacks some features:

  • Not yet BS4 classes
  • ids and classnames not conforming to id and class naming rules
  • In display mode: Field names are repeated for every line. That's not so cool.
  • only last line can be deleted. what if I want to delete the line in the middle?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.