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, checkboxes, 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.
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 (413-545-2823) for assistance.
To add a Database activity to your Moodle course, first, you'll configure the submission options for making entries, availability, grading, groups, etc). After completing this step you'll need to open the activity to
- On your course page, click Turn editing on (top right).
- Locate the Section of your course page where you will add the database.
- At the lower-right of the Section, click + Add an activity or resource. The Add an activity or resource window will open.
- In the Add an activity or resource window, select Database. A description will be displayed at right.
- Click Add. The Adding a new Database page will open.
- To configure submission settings, on the Adding a new Database page, click the headings to view available settings, or to view all settings, click Expand all (upper right). At the bottom of each section, Click Show more... to reveal all options.
Entries: 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 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 for completion
The number of entries each student is required to add before the Database activity is considered complete. Students will see a reminder message if they have not submitted the required number of 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.
- 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.
Ratings: View and adjust how instructors and TAs will grade entries.
- Roles with permission to rate
Identifies users who have permission to rate items. The list of roles may be changed via the permissions link in the Administration block.
- 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, Sum of ratings, and Manual Gradebook rating.
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.
- Visibility to students
Set 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.)
- Group mode, 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.
- 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.
- Approval required
Click Save and display at the bottom of the page. The database opens to the Fields tab.
Under the Fields tab, define the fields to use (see Select Database Fields below).
Under the Templates tab, define the layout templates to use (see Define Database Templates below).
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, find the Database activity. Click on the name of the database activity. This will open the database page.
- Click the Fields tab, and select a field type from the Create a new field drop-down menu. The types of fields possible are: Checkbox, Date, File, Latlong (latitude/longitude), Menu, Multimenu, Number, Picture, Radio button, Text area, Text input, and URL.
- Enter a Field name, Field description, and field Options(if applicable).
- Click Add.
- Use the Default sort field drop-down menu to choose the order in which fields will display in the database. The default is to display by Time added, or you choose to sort on any of the database fields you have defined.
- 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 (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 will display to users. To update your database templates:
- Click the Templates tab, then click the Add template tab.
- Click Reset template 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.