Add a Database

The database activity module allows the teacher and/or students to build, display, and search a bank of record entries about any topic. The format and structure of these entries is almost unlimited, including images, files, URLs, numbers, and text.

To add a database activity:

    1. With editing turned on, in the section you wish to add your database, click the Add an activity or resource link (or, if not present, the Add an activity drop down menu) and choose Database.
    2. Give your database a name and a description.
    3. Select the general options (see below) and the common module settings.
    4. Click the Save and display button at the bottom of the page.
    5. Define the fields or use a preset.
    6. Define the templates.
    7. Add one or two same entries then edit the templates as appropriate.

General options

Available from/to

The dates the database is visible to students.

The database will also be open for data entry, provided we are not within the date range specified by the "read only from/to" settings.

Read only from/to

The dates the database is available for viewing, but not open for data entry.

The "available from/to" settings override the "read only from/to" settings. So if a database has "read only from" 1 January, and "available from" 1 February, students will not be able to view its content during January.

Required entries

The number of entries each student is required to enter before the database activity can be considered complete. The student will see a reminder message if s/he has not submitted the required number of entries.

Entries required before viewing

The number of entries the student needs to submit before s/he can see entries by other students. If the student has not submitted the required number of entries, s/he will only see the entry page and not the list or single view pages.

Note: If entries are required before viewing, the database auto-linking filter should be disabled. This is because the database auto-linking filter can't determine whether a user has submitted the required number of entries.

Maximum entries

The maximum number of entries the student can submit before s/he is blocked. This prevents people from spamming the system, either in the hope that one entry is good enough or, on a public site, as a way of advertising.


Enables commenting on entries. The comments field appears on the single view template when this is enabled.

Require approval?

Allows you to require each entry to be approved by someone with the appropriate role before other users can view it.

RSS articles

Enables you to publish an RSS feed of entries in the database. The option here sets the number of entries available in the feed.

Rating a database

Lets you allow posts to be rated, which will enter a score in the gradebook for the students' submissions in the database. The grade is set using the dropdown menu below this option.

Building a Database

Next, you define fields to collect your information. For example a database of famous paintings may have a picture field called painting for uploading images of paintings and two text fields called artist and title for the name of the artist and the title of the painting. Alternatively, you can use a database preset (see below).
It is then optional to edit the database templates to alter the way in which the database displays entries.

Database fields

A field is a named unit of information. By combining several fields with appropriate names and types you should be able to capture all the relevant information about the items in your database.

Note that if you later edit the fields in the databases you must use the Reset template button or manually edit the template to ensure the new fields are added to the display.
Field name and description

The name is what is shown when an entry is added. It must be unique and short. The description is for your benefit to help identify that field.

Field types

Checkbox allows you to offer checkboxes for the user to select. Add the options one under the other. The word will appear next to a checkbox when the user clicks to add an entry. Users can check more than one box.

Date allows a user to enter a date by picking a day, month, and year from a drop down list.

File allows users upload a file from their computer. If it is an image file then the picture field may be a better choice.

Latitude/longitude allows users to enter a geographic location using latitude and longitude. For example, CourseSpaces HQ is at latitude -31.9545, longitude 115.877. When viewing the record, links are automatically generated linking to geographic data services such as Google Earth, OpenStreetMap, GeaBios,Mapstars and more. (The instructor can choose which of those links appear, if any.)

Menu allows users to enter text in the options area. These options are then presented as a drop-down menu.

Menu (Multi-select) is a variation on menu. When users hold down Control or Shift key as they click, they are able to select multiple options. 

Number allows users to enter any number. For example:


    (For those who care about the technical details, the field stores floating point numbers.)

Picture allows a user to upload and display an image file. "Single view" is when the image is viewed on its own; "list view" is when it is viewed in with other images. Single view can be larger than list view.

Radio buttons allow user to select single choice buttons. Note: If you have only two options and they are opposites (true/false, yes/no) then you could use a single checkbox instead. However, checkboxes default to their unchecked status and so people could submit without actively selecting one of the options. This may not always be appropriate.

Text allows users to enter up to 60 characters. For longer text, or for text that requires formatting such as headers and bullet points, you can use a text area field.

Text area allows users to enter a long string of text using the text editor.

URL allows users to add a link to a website here. If you select autolink then the URL becomes clickable. If you also enter a forced name for the link then that text will be used for the hyperlink. For example, in a database of authors you may wish people to enter the author's website. If you enter the text "homepage" as a forced name then clicking on text "homepage" will take you to the entered URL.

You can choose to have the URL open in a new window if so desired.


To avoid the necessity of always having to create a new database from scratch, the database activity module has a presets feature. An image gallery preset is currently included in the database module to help get you started. You can create your own presets as well and share them with others.

Importing a preset

To use a preset:

    1. On the database page, click the Presets tab.
    2. The usual way to import a preset is clicking the "Choose file" button and browsing to the ZIP file containing the preset (eg. "") stored on the server. If there does not yet exist a preset ZIP file on the server, upload it from your local computer. Choose the desired preset file by clicking on its action "Choose." Finally, press the "Import" button.
    3. Alternatively, you can choose a previously loaded preset.
    4. After the import, you can start to add or import entries. All the hard work of setting up the fields and templates has been done for you. If you desire, you can still customize the fields and templates.

You will see a "Overwrite current settings" checkbox after the "Import" button has been pressed. If checked, the database activity overwrites some of its current general settings by those stored in the preset:

    • the "Introduction" HTML text
    • "Required entries"
    • "Entries required before viewing"
    • "Maximum entries"
    • "Comments"
    • "Require approval?"
    • rssarticles