On This Page:
The Database activity allows students and/or instructors to populate, display, search, and comment on a bank of record entries. The format and structure of these entries is highly customizable, with the option to include images, files, URLs, numbers, check boxes, and text. Versatile settings options make the Database activity well suited for many different kinds of assignments, such as collecting and sharing information, giving students a data array to work with, and presenting content for students to comment on.
Consider the simpler Moodle Glossary activity if you only need to build a collection of terms and definitions. For more detail for Glossary activity, see Add a Glossary Activity in Moodle.
Note: With flexibility comes a fair amount of complexity. If you are considering creating a Database activity for your course, we recommend contacting the Instructional Media Lab at 413-545-2823 for assistance.
To add a Database activity to your Moodle course, first, you will configure the submission options for making entries, availability, grading, groups, etc. After completing this step, you will need to open the activity to your students.
- On your course page, click Turn editing on (green pencil icon , top right).
- In the Section where you want the Database activity to apprear, click + Add an activity or resource. The Activity chooser dialog will open.
- In the Activity chooser dialog, select Database. A description will be displayed at right.
- Click Add. The Adding a new Database page will open.
- Configure the Database options. The page opens with General, Entries, Availability, and Ratings (if you want to grade) settings in view. Select topic headings to make additional settings, or select Expand all (top right) to view all possible settings. For more information on these options, see Database Options (below), or click the help icon () next to any option.
- Select Save and return to course to return to your main course page, or Save and display to view the Database activity page.
Note: The Database activity cannot be used until fields and templates have been defined. To add fields and templates, please see Part Two: Set up Entry Fields and Select a Layout Template below.
- Database name (required)
This name displays as a link on your course page. Use something unique that clearly identifies this Database from other course activities. We also recommend keeping the name short.
- Description (optional)
Enter a summary of the Database and instructions. You can also Display description on course page. Select this option to display the description underneath the Database link on your course page. (This works best if the description is very concise).
View and adjust the record entry settings.
- Approval required
Allows you to require that an instructor or TA approve each entry before other students can view it.
- Allow editing of approved entries
Allows the users who added their entries to edit or delete the approved entries. If disabled, approved entries are no longer editable or deletable by the user who added them.
- Allow comments on entries
Allows users to comment on each other's entries. Note: The Comments option will display when users view entries individually, but not when viewing a list of all database entries.
- Entries required before viewing
The number of entries a student must submit before they can see entries by other students.
- Maximum number of entries
The maximum number of entries a student can submit before they are blocked from adding more.
View and adjust the database availability settings.
- Available from/to
The dates the database is visible to students and new entries can be added.
- Read only from/to
The dates the database is available for viewing, but not open for data entry.
Assign the Database acitivity to a given category in your Gradebook.
View and adjust how instructors and TAs will grade entries.
- Roles with permission to rate
Identifies users who have permission to rate items. Once the Database activity is created, the list of roles may be changed via the permissions link. To change the permissions, navigate and select the Database activity, next select the Actions menu (, located on the right) and from the Actions menu drop-down list, select Permissions.
Note: This feature is not enabled until the activity is created.
- Aggregate type
Determines how the ratings are entered as a grade in the Moodle Gradebook. The options are: No ratings, Average of ratings, Count of ratings, Maximum rating, Minimum rating, and Sum of ratings.
Sets the maximum score for the activity.
Note: For the "Sum of ratings" aggregate type, select the maximum for the sum of all ratings (the total grade for the activity), not the maximum for each rating.
- Restrict ratings to items with dates in this range
Limits the time frame during which items are available for rating. Check the box to enable the drop-down date windows.
Common module settings
View and adjust the database visibility and group settings.
Sets whether or not an assignment is visible to students. By default, new assignments are set to Show. (This is comparable to using the Hide/Show icon for the activity on your course page.)
- ID Number
Sets an ID number to provide a way of identify the activity or resource for purposes such as grade calculation.
- Group mode and Grouping
These options let you restrict the assignment to particular groups of students you have already created in Moodle. For more information, see Assign an Activity to a Group or Grouping in Moodle.
To add restrictions on accessing the activity click Add restriction. The Add restriction window will open, containing the following options:
- Date - Prevent access until (or from) a specified date and time.
- Grade - Require students to achieve a specified grade.
- User profile - Control access based on fields within the student’s profile.
- Restriction set - Add a set of nested restrictions to apply complex logic.
If you have groups in your course, you will see the following additional options:
- Group - Allow only students who belong to a specified group, or all groups.
- Grouping - Allow only students who belong to a group within a specified grouping.
Note: The Database activity cannot be used until fields and templates have been defined (see below).
Select Database Fields
Fields establish the kinds of content that can be added to entries in your database. To add a new field when first setting up your database:
- On your course page, click Turn editting on (green pencil icon , top right).
- To add a new Database activity:
In the Section of your course where you want the Database activity, click +Add an activity or resource, then select Database and click Add. The Adding a new Database page will open. Configure the setting for your Database and click Save and display. Skip to step 3 if you have already created a Database activity.
- On your course page, find the Database activity. Click on the name of the database activity. This will open the database page.
- Click the Fields tab, and from the Create a new field drop-down menu, select a field type. The types of fields possible are: Checkbox, Date, File, Latlong (latitude/longitude), Menu, Multimenu, Number, Picture, Radio button, Text area, Text input, and URL.
- Configure the data fields according to the options provided and then click Add.
- Use the Default sort field drop-down menu to choose the order in which fields will display in the database. By default, it is set to display by Time added, and then click Save.
Define Database Templates
Templates determine the visual layout of the database when users are adding a new entry, browsing or searching all existing entries, and viewing one entry at a time. To reduce setup complexity, we recommend creating all database fields before defining templates.
To use the default templates when first setting up your database, click the Templates tab and then click Save template.
Note: The default templates can be modified, but this requires directly editing the template HTML. For assistance customizing a template, contact the Instructional Media Lab at 413-545-2823.
Update Database Templates
If you add a new field to a Database activity after saving templates for the first time, you will need to reset the templates before the field displays to users. To update your database templates:
- On your course page, navigate to the Database activity. Click on the name of the Database activity. This will open the Database page.
- Under the Field tab, add and define new fields to use (see Select Database Fields above).
- Click the Templates tab, then click the Add template tab.
- Click Reset template (located on the left) to update the template to include newly added fields.
Note: Resetting a template will remove any changes you have made to the default template HTML.
- Click Save template. This will update the fields users see when adding a new database entry.
- Repeat the steps above in the List template, Single template, Add template, and Advanced search template tabs. This will update the fields users see when browsing database entries, viewing one entry at a time, and searching within the database.
- After you have defined database fields and templates, click Add entry to create entries and populate the Database activity.
- Once entries have been saved in the database, click View single to view them individually, or click View list to see the entries as a list.
- To search entries in the database, click Search.
For details and instructions for your students, see Contribute to a Database in Moodle.