Your Moodle version

Activities: Dataform

Maintained by Picture of Itamar Tzadok Itamar Tzadok
The Dataform module allows the course manager to design and construct an entry form from various input elements (text and rich text fields, urls, files, pictures, etc.) in a flexible layout. Users can then add information records to a collection, which can be viewed in various ways and searched for particular items.
Moodle 2.0, 2.1, 2.2, 2.3

The dataform module is a major enhancement of the standard Database activity module and is meant to offer all the functionality offered by the Database module and much more in a more flexible way.

The module allows the course manager to design and construct an entry form from various input elements (text and rich text fields, urls, files, pictures, etc.) in a flexible layout. Users can then add information records to a collection, which can be viewed in various ways and searched for particular items.

The dataform features include (among other things):

  • A multiple views system - allows the instructor to design several different views of the entries in a datform activity. Each view can show a designated subset of the entries in a designated layout.
  • Enhanced template tags - A new template tags system allows for exposing many more bits of information and makes it easy to add designated patterns in new field and view types.
  • Enhanced entry actions - Bulk edit, duplicate, delete, approve etc. Inline editing. Form editing options such as required fields (via Moodle forms).
  • New packaging system - based on Moodle backup/restore and allows for packaing a dataform instance and restoring into an existing instance.
  • Enhanced filtering system - allows the instructor to define different filters each of which can determine sort (including nested sort) and search options (various search criteria). Filters can be fixed to particular views or applied on the file from the activity main page (if included in the view template).

New view/field types include (among others):

  • Tabular view - a view type which allows for displaying the entries in a table. The design of the entries table has been simplified to drawing the desired table with optional header row and an entry row in the moodle editor.
  • Nanogong field - a field type for adding audio content to an entry via the nanogong applet.
  • Calculated field - a field type which can display a result of a simple calculation on one or two number fields in the entry.


This plugin is part of set Dataform.


Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4
Screenshot #5


Picture of Itamar Tzadok
Itamar Tzadok (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Yong Ra
    Fri, Sep 5, 2014, 3:16 AM
    I went from 2.5 to 2.7.1 and encountered following error.


    Debug info: The table dataform_rules is not defined in file [dirroot]/mod/dataform/db/install.xml
    Error code: ddlunknowntable
    $a contents:

    Stack trace: •line 390 of /lib/ddl/database_manager.php: ddl_exception thrown
    •line 382 of /mod/dataform/db/upgrade.php: call to database_manager->install_one_table_from_xmldb_file()
    •line 62 of /mod/dataform/db/upgrade.php: call to xmldb_dataform_upgrade_2012092002()
    •line 697 of /lib/upgradelib.php: call to xmldb_dataform_upgrade()
    •line 420 of /lib/upgradelib.php: call to upgrade_plugins_modules()
    •line 1615 of /lib/upgradelib.php: call to upgrade_plugins()
    •line 434 of /admin/index.php: call to upgrade_noncore()

    Can anyone help?
  • Picture of Itamar Tzadok
    Fri, Sep 5, 2014, 4:05 AM
    See my reply to your query in the Database activity at smile
  • Picture of Miryan salas
    Fri, Oct 24, 2014, 8:42 PM
    I have installed the last version for Moodle 2.3:
    But no error message is shown when field rules do not comply. For example, if a user completes a number field with a character and submit the entry, nothing happens, and the new entry page is reloaded without any error message. This happes for all rules related to form fields.
    Thank you
  • Picture of Itamar Tzadok
    Sat, Oct 25, 2014, 1:28 AM
    The rules tab in Dataform 2.3 is only a stub. The implementation of this feature in Dataform 2.3 has never been completed. You will have to upgrade to Dataform 2.6 or higher (requires Moodle 2.6 or higher respectively). smile
  • Picture of Miryan salas
    Tue, Oct 28, 2014, 9:59 PM
    mar, 28 de oct de 2014, 21:59
    I found the problem, it was a bug reported by you:
    But now, I have another issue trying to import a csv file through the csv view. The problem is that the author id imported is always the id of the user who imports the csv, instead of the id stored in the csv (author:id column). Could you help me please? Thank you
  • Picture of Itamar Tzadok
    Tue, Oct 28, 2014, 10:07 PM
    Miryan, let's continue this discussion in the Dataform forum at smile
  • Picture of David Mudrák
    Thu, Dec 18, 2014, 11:33 PM
    I am happy to announce the Dataform is our next Featured Moodle plugin! Read more at Well done Itamar and congrats!
  • Picture of Abdul Majid
    Thu, Jan 15, 2015, 6:10 PM
    Hi Itamar,

    I've noticed that the filter feature does not work but instead throws an SQL error on Moodle running PostgreSQL. Please see debug info and stack trace below:

    Error reading from database

    Debug info: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
    SELECT DISTINCT, e.dataid, e.state, e.timecreated, e.timemodified, e.userid, e.groupid, AS uid ,u.picture,u.firstname,u.lastname,u.firstnamephonetic,u.lastnamephonetic,u.middlename,u.alternatename,u.imagealt,,u.idnumber,u.username FROM mdl_dataform_entries e
    JOIN mdl_user u ON = e.userid LEFT JOIN mdl_dataform_contents c16 ON c16.fieldid = 16 AND c16.entryid = WHERE e.dataid = $1 ORDER BY c16.content ASC LIMIT 20 OFFSET 0
    [array (
    0 => '5',
    Error code: dmlreadexception
    Stack trace:
    line 443 of /lib/dml/moodle_database.php: dml_read_exception thrown
    line 243 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
    line 748 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
    line 343 of /mod/dataform/classes/entry_manager.php: call to pgsql_native_moodle_database->get_records_sql()
    line 133 of /mod/dataform/classes/entry_manager.php: call to mod_dataform_entry_manager->fetch_entries()
    line 341 of /mod/dataform/classes/pluginbase/dataformview.php: call to mod_dataform_entry_manager->set_content()
    line 324 of /mod/dataform/classes/pluginbase/dataformview.php: call to mod_dataform\pluginbase\dataformview->set_entries_content()
    line 404 of /mod/dataform/classes/dataform.php: call to mod_dataform\pluginbase\dataformview->display()
    line 70 of /mod/dataform/view.php: call to mod_dataform_dataform->display()

    Hoping you can fix this.

  • Picture of Itamar Tzadok
    Thu, Jan 15, 2015, 10:37 PM
    Hi Majid. Please open a tracker issue in the Dataform tracker component (Set: Dataform), with a simple scenario that reproduces this message, and we will take it from there. smile
  • Picture of Abdul Majid
    Tue, Jan 27, 2015, 12:46 AM
    Hi Itamar,
    I've created a new issue for you to investigate smile
  • Picture of Hamed Azimi
    Thu, Jun 25, 2015, 3:38 AM
    Hi Itamar,

    I just added dataform as an activity to a course, and all students are able to submit their works, but I want all student also be able to "View" all entries from all students (Not able to manage them. no permission to delete and ... . just view).

    I changed the permissions from dataform activity administrator but nothing happened and just course creator and teacher are able to view all entries.

    I use moodle 2.9 and RTL style. Appreciated if you would help me do what I want.

  • Picture of Hamed Azimi
    Thu, Jun 25, 2015, 4:29 AM
    Hi Itamar,

    Thanks a lot. You are right (as you helped in private message). The problem was "Separate participants" option which was set to "Yes"!

    Thanks for your absolutely great module. And also thanks for your nice support (and fast answer).

  • Picture of Hamed Azimi
    Thu, Nov 5, 2015, 5:01 PM
    Hi Itamar,
    Is it possible to control the width of "File" fields? We have two part in one of our dataforms, (1. text field 2.file) I want to make it side by side while user is adding new entry. But now it shows the editor below the upload file box.
  • Picture of L Passaglia
    Thu, Dec 24, 2015, 4:43 AM
    Does Dataform work with Moodle version 3.0?
    Can the tables mdl_dataform_fields and mdl_dataform_views be modified without affecting the plugin?
    Thank you
1 2 3 4
Please login to post comments