To create a database, first create the Database activity, then define the database fields and edit the database templates to display the information in a particular way.
This page provides instructions for all these actions, as well as help with course rollover and searchability.
When to use
A database can be a useful way to encourage students to contribute to the class's learning. For example, with no previous experience you can build a simple database in Moodle where:
- students can record the details of reference works they have found useful for your course, or where
- supervisors can advertise the research projects that they are prepared to supervise, providing information for students making their choices about research work.
- Supervisors can also use the Database activity to allow students to share work—such as book reviews, personal reflections, collaborative activities where content builds on previous contributions—with other students.
Once your database is created, you and your students can:
- begin adding entries in the Add entry page, either individually or by uploading a .csv file (In the Settings block, select Database activity administration, then Import entries.)
- comment on and rate submissions, if you've enabled this
- view individual database entries or a list, and search and sort the database.
Step by step instructions
- Create a Database activity
- Define the database fields
- Databases and course rollover
- Make your database searchable
- On the course home page, click Turn editing on . In the relevant section click Add an activity or resource, and in the activity chooser select Database from the pop-up list and click Add.
- On the Adding a new Database page, click Expand all, then in the General section enter a Name for the database and some text in the Description field explaining how the database will be used.
Under Entries, select:
- whether the supervisor's Approval is required before the entry will display to other students in the database, and
- whether you will Allow comments on entries
- the number of Entries required for completion per student if the activity is to be considered complete, and
- the number of Entries required before viewing other students’ entries. If you are requiring students to make entries before viewing, contact the system administrator to have the database’s auto-linking filter disabled.
- the Maximum number of entries any student can contribute to the database.
- If necessary, under Availability, Enable the date fields and define the periods for which the database will be Available (i.e. open to contributions) and available in Read-only form.
- Under RSS, select how many Entries in the RSS feed you want to display.
- Under Grade, select the Grading category in the Gradebook where you want the database to be listed.
Set up the Ratings system, if you want students to be able to rate entries. (You must save the activity before the Roles with permission to rate will display.) You can:
- tell Moodle how to decide on a final rating (Aggregate type)
- indicate whether to apply a Scale to the ratings
- Restrict ratings to items with dates in the given date range.
- Complete the remainder of the page and click Save and display. The database's home page displays. Define the database fields using the next set of instructions on this page.
- On the database's home page (to access this page from the course home page, click the database's link), if necessary select the Fields tab.
On the Fields page, do you want to:
- use a predefined set of fields (a "preset")? If yes, continue to the next step.
- create your own fields? If yes, go to step 4.
You can also, on this page, choose to import a zipped file of a preset.
To use a predefined set of fields:
- Click the choose a predefined set link.
- In the Presets page, scroll down to the Use a preset section, select the preset and click Choose.
- On the Field mappings page select the Overwrite current settings check box and click Continue—you will be invited to Add entries.
- To create your own fields:
- From the Choose drop-down list, select the field type you want to create.
- Enter the Field name, Field description and any other required information, and click Add.
To make it possible for you to view created entries, once you’ve defined the fields do the following:
- Click the Templates tab.
- On the template page, click Save template.
- Click the tab for the other template type.
- On the second template page, click Save template.
- You may want to edit the database templates to make the database entries display the way you want them. Do this on the Templates pages. The Moodle Docs page "Database templates" provides useful instructions, tips and further information about creating database templates.
When you roll a course over, the database content does not come across to the new course, because the content is counted as user data, contributed by students who will not be in the course the following semester.
To move the database into the new course, you must export it from the old course and import it into the new one.
Once you and your students have built the database beyond a certain size, you'll want it to be searchable.
You can make your database searchable in two ways. First, on the View list or Search page, deselect the Advanced search check box and click Save settings. Then do one of the following two things:
- Use the fields that now display below the list to conduct a simple search. To search, enter a Search term and either click Save settings or press Enter.
- Select the Templates tab, then on the Templates page select the Advanced search template tab, and define the template to suit your and your students' needs.
This Moodle Docs page, "Database templates", provides useful instructions, tips and further information about creating database templates.
If you experience technical or other issues, consult the Where to get help page.