Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Include Page
Training_Page_Header
Training_Page_Header
 

This refers to Moodle 4.3 .8 from September 2020 onwardfrom August 2024 onwards

How to: create a database activity

...

  1. Login to your module and click on the 'Turn editing on button Edit mode' toggle switch (top right).  Turn editing on buttonImage Removed Edit mode toggle switchImage Added
  2. In the relevant section, click on the the '+  Add Add an activity or resource hyperlink ' button. Add an activity or resource buttonImage Added
  3. A window will open. Select Click on the word 'Database' and click on 'Add'

Add an activity or resource windowImage Removed

...

  1. you will be taken directly to the 'Adding a new database' screen.
  2. Database activity highlighted by red square in activity or resource picker.Image Added
  3. In General Settings, add

...

  1. the 'Name' of the database (

...

  1. which will display on the main module page)

...

  1. and 'Description

...

  1. ', e.g.,

...

  1. to include specific directions on how students might contribute if they are expected to.

...

  1. 'Name' and 'Description' fields in 'General' database settings.Image Added

...

Add restriction windowImage Removed

...

  1. (Optional) If you want to add a restriction, click on 'Add restriction' within the "Restrict Access" section. This will open a window, select the restriction you want to add

...

  1. .
  2. 'Restrict access' settings with 'Add restriction' buttonImage Added
  3. Image Added
  4. Click on the
  1. 'Save and display' button to see the database and start setting it up as below 'Save and return to module', 'Save and display' and 'Cancel' buttons. 'Send content change notification' tickbox located above.Image Added (or 'Save and return to module'

...

  1. to go to module front

...

  1. page)

...

  1. Click on the '

...

  1. Edit mode' button

...

  1. 'Edit mode' toggle switchImage Added on your main Moodle page

Other settings

You can also add settings to:

  • "Entries": - Set teacher approval for database entries to be viewable, allow comments, maximum entries, set entries required for completion of the activity or before students can view the entries of others.
  • "Availability": - Similar to restrict access
  • "RSS": - Add entries to RSS feed"Grade": Controls the category in which this activity's grades are placed in the gradebook.
  • "Ratings": - Allow users to rate items

...

  1. Open your database. For a new database, the Fields window will open automatically. If not, click on the Fields tab.

...

  1. Fields tab selected in database settings. with 'create a field' button at the bottom.Image Added

...

  1. Under 'Create a

...

  1. field' dropdown. Choose to select the type of field

...

  1. .  Field types include:

...

    1. ...

        1. 'Checkboxes' - This 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. They can check more than one box.
        2. 'Coordinates' - This allows users to add a location via link out services such as Google Maps.
        3. 'Date

      ...

        1. ' - This allows a user to enter a date by picking a day, month and year from a drop down list.

      ...

        1. 'Dropdown list' - The text entered in the options area will be presented as a drop-down list for the user to choose from. Each line become a different option.
        2. 'File' - Users can upload a file from their computer. If it is an image file then the picture field may be a better choice.

      ...

        1. 'Image' - This allows

      ...

        1. 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.
        2. 'Multi-select list'
        1. - The text entered in the options area will be presented as a list for the user to choose from and each line become a different option. By holding down control or shift as they click, users will be able to select multiple options. This is a fairly advanced computer skill so it may be wise to use multiple checkboxes instead.
        2. 'Number

      ...

        1. ' - This allows users to enter any number.

      ...

        1. 'Radio buttons' - The user gets radio buttons and can choose only one. They can only submit the entry when they have clicked on one button. (Note:If you only have two options and they are opposites (true/false, yes/no) then you could simply 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.)

      ...

        1. 'Short text' - Users can enter short amounts of text up to 60 characters in length. For longer text, or for text that requires formatting such as headers and bullet points, you can use a text area field.

      ...

        1. 'Text area' - This allows users to enter a longer piece of text using the text editor.
        2. 'URL' - The user can add a link to a website here. If you select autolink then the URL becomes clickable.. If you also enter aforced name for the linkthen 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.

      ...

      1. Add

      ...

      1. Field name,

      ...

      1. Field description and any other parameters to the fields

      ...

      Adding a date fieldImage Removed

      ...

      1. (The parameters will differ depending on which field type you choose.) and click 'Save'.
      2. 'Field name' and 'Field description' fields with 'Required field' tickboxImage Added
      3. Continue doing this for as many fields as you need adding fields.
      4. You can choose which of the fields is used to sort the entries (by default they are listed by time created/added)

      ...

      1. Dropdown menus to select which field is used to sort the entries, followed by a dropdown menu to select whether entries are 'Ascending' or 'Descending' by default, followed by 'Save'' button.Image Added


      Stage 3: Define the templates

      1. Click on the Templates tab. The List template and Single template define the way the database entries are displayed (there are other templates too, probably not needed for basic databases). Once you've defined the fields in step 2 you can often accept the default templates without having to change anything. (More information on the Moodle site here)
      2. Click Save templatefor each (

      ...

      1. normally List Template, Single Template and Add Template

      ...

      1. are the only ones needed).

      Template tabImage Removed'Templates' tab selected and highlighted by red square. 'Add entry template' dropdown menu selected showing 'single view template' which is highlighted by red square, 'List view template', 'Advanced search template'. 'Custom CSS', 'Custom JavaScript' and 'RSS template'.Image Added

      Stage 4: Add or import entries

      1. It's usually a good idea at this stage to add your first entry or a test entry. You will need to go to

      ...

      1. the 'Add Entry' tab of your database to do this.

      ...

      1. 'Import entry' and 'Add entry' buttons under the 'Database' tabImage Added
      2. You can import multiple entries via a CSV file if you click the

      ...

      1. 'Import entries

      ...

      1. buttonThe easiest way to determine the format of the text file is to manually add an entry to the database and then export it. The resulting export text file may then be edited and used for importing entries.
      2. 'Actions' dropdown menu showing 'Import entries' and 'Export entries' options.Image Added

      ...

      1. Image Added
      2. The expected file format is a plain text file with a list of field names as the first record. The data then follows, one record per line.

      ...

      1. Example of an export document with 'Title', 'Content' and 'Tags' headingsImage Added
      2. Example

        drug_name,action,category

        omeprazole,suppresses gastric acid secretion,proton pump inhibitor

        Records should be delimited by new lines

        Note: Certain field types may not be supported (e.g., files and images).

        Do not put spaces after your commas or upload will fail!

      3. To import a

      ...

      1. file:

        Click on
        1. Select the '

        Cogwheel' within your database and
        1. Actions' drop-down menu, the select 'Import entries'.

      ...

        1. 'Actions' drop-down menu with 'Import entries' highlighted by a red box and 'Export entries' belowImage Added

      ...

        1.  Find your file to upload and click on 'Submit'.

      ...

        1. 'Upload entries from a file' with 'CSV file' field with 'Choose a file' and 'drag and drop files to add them' options. Field separator option, Field enclosure option and 'Encoding' field with drop down menu.  'Submit' and 'Cancel' buttons are located below.Image Added

      ...

      1. It will then confirm that your entries have been imported.

      ...

      1. Click 'Continue'.


      2. 'Upload entries from a file' showing the files that have been imported. 'Continue' button located below.Image Added

       

      Further reading

      Online collaboration with Moodle Databases and Wikis is a useful Xerte toolkit that will help you use both Wikis and Databases more effectively for student collaboration.Image Removed

      See also

      Content by Label
      showLabelsfalse
      showSpacefalse
      cqllabel = "moodle_database"
      labelsmoodle_database