How to Add a Moodle Database Activity in 4 Easy Steps

A Moodle database activity allows the instructor and his or her participants or students to search, display, comment, populate a record entry bank on just about any subject that they can think of. The structure and the format of the database is highly customizable, and there is no limit to the number of relevant entries that can be added- URLs, files, images, text, checklist and numbers are all accepted.

The database activity added has a lot of versatile and useful settings that make it perfect for any and all kinds of assignments, from sharing and collecting essential information, providing a data array for the participants to work with, or showing content for the students to view and comment on. The instructions given will create one table per run, but you can just repeat the steps should you need another table. Records can then be linked to other resources and tables in the course if auto link is allowed in the name field.

How to Add a Moodle Database Activity in 4 Easy Steps

Step 1: Adding a Database

Log in to the module and find the “Turn Editing On” button, which can be found on the topmost right part of the page. Editing links and icons should appear at this point. Choose the section or topic that you would like to add the activity for, then proceed to the bottom right part of the section to click on + Add Activity or Resource (which is a link). The Activity Chooser should come up and you can select Database, then mouse on over to the Add button. At this point, the Database Settings will occupy the screen for customization. In the General settings, you can add the name or title of the database you created (and this should show on the main module window). This is also the time to add introductory text, descriptions and instructions on how the database will be utilized. You can also put in the types of data you wish to collect.

Head Over to Entries to View and Adjust Settings

Maximum entry number- This is the most number of entries a participant can submit before the system blocks him or her from adding more.

Entries needed for completion- The number of entries required for each participant before the Moodle database activity can be considered as complete. Participants will receive a reminder message if they have not yet completed the required number of entries.

Approval required- This sets the entry that students submit as pending until a TA or an instructor views and approves it.

Entries needed before viewing- the required number of submissions a participant must make until he or she can see entries submitted by other students.

Allow entry comments- Tick on this box to allow students to comment on each other’s submissions. The comments option shows up only when viewing individual entries, but not when viewing the list of database entries.

After you are satisfied with the settings above, click next on the Availability heading to adjust its settings next. The two essential fields to fill out are the Available from/to, which are the range of dates that are visible to students and new submissions can be provided, and the Read only to/from, which sets the range where the database can be viewed but where data cannot be added anymore.

Once finished, click on Ratings header to change its settings. This will enable the instructor and the participants to grade the content being submitted. Aggregate type rating follow the guidelines of the Moodle Gradebook, and you can set the options for Average, Rating count, Sum of rating, Maximum or Minimum rating. You may also set it to Scale where you can set the maximum activity score. You can click on Save and Display at the bottom window if you feel that everything is complete and you are ready for the next step. The Fields Database will come up next.

Step 2: Creating the Database Fields

Database fields are also important as they establish the kinds of information or content that can be added as entries. By default, they will be added in the order they were made. It can be modified, but additional work needs to be done by editing the HTML of the templates. Be careful and plan the fields in advance, imagine them in the order of how they should appear in the database entries.

Add a new field by selecting a field type from the drop-down menu Create a new field. The list of possible fields come up and you can choose among many options. Then enter the field name, a short but defining description for it, and a field description for your own use, as a note or a reminder. Click on Add and if you wish to create more, head on over to add additional fields. When satisfied, click on the Save button. It is highly recommended to add all the fields necessary before defining them as a reset may be needed if you suddenly need to add new fields after the the definition of the templates have been completed.

Step 3: Defining the Database Templates

Database templates are the basis of how your database looks when the participants add in a new entry, when they are either browsing or searching for specific or all entries. You may use the default templates when setting the database for the first time by clicking on Templates and choosing Save Template. Remember the rule of thumb mentioned earlier, about creating all the database fields that you think you will need on Step 2 before heading over to Step 3? Doing that will reduce the headache in the long run. Should you wish to modify the default templates, a direct HTML editing is required, and you may need to consult Instructional Media Lab for more information.

Step 4: Adding Entries and Viewing Them

You are almost done! It is now time to add your first test entry. Head on over to the Add entry tab, fill in the required fields, then click Save and View or Save and Add One More. Choose to View the List on the tab and check all added entries on one page. For a closer look, choose the View single tab to examine it one at a time. As you browse through them, think about how you wish to modify the templates according to your needs and purposes. Click on search for looking through the databases, or import existing ones via a csv file located in the Import entries link, which can be found in the Moodle Database activity admin block.


Congratulations! You have completed the course required for creating a database. You are all set, and have gained all the necessary skills and knowledge on how to add a Moodle Database Activity.

Nicole Lewis is the Lead Author & Editor of MyLMStips. MyLMStips is dedicated to providing the most engaging topics, information, tips and tricks surrounding Moodle®. It's a place where Moodle® users can receive guidance on how to get the most out of it and increase their productivity and progress.