Note: You are currently viewing documentation for Moodle 3.3. Up-to-date documentation for the latest stable version of Moodle is probably available here: Database fields.

Database fields: Difference between revisions

From MoodleDocs
(→‎Textarea: added screenshot)
(content moved to Building Database)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Database}}
#redirect [[Building Database]]
{{Update}}A '''field''' is a named unit of information. Each entry in a [[Database activity module|database activity module]] can have multiple fields of multiple types e.g. a text field called 'favourite color' which allows you to type in your favourite shade, or a menu called 'state' that lets you choose one from a list of the 50 that make up the United States of America. 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.
 
 
== 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 ===
 
[[File:Checkboxfield1.png]]
 
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.
 
=== Date ===
 
[[File:Datefield1.png]]
 
This allows a user to enter a date by picking a day, month and year from a drop down list.
 
=== File ===
[[File:Filefield.png]]
 
Users can upload a file from their computer. If it is an image file then the picture field may be a better choice.
 
=== Latitude/longitude ===
 
[[File:Latlongfield.png]]
 
Users can enter a geographic location using latitude and longitude. For example, [http://moodle.com/hq/ Moodle HQ] is at latitude -31.9545, longitude 115.877. When viewing the record, links are automatically generated linking to geographic data services such as [http://earth.google.com Google Earth], [http://www.openstreetmap.org/ OpenStreetMap], [http://www.geabios.com/ GeaBios],[http://www.mapstars.com/extern/deltaworks-holland Mapstars] and more. (The teacher can choose which of those links appear, if any.)
 
=== Menu ===
 
[[File:Menufield.png]]
 
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.
 
=== Menu (Multi-select) ===
 
[[File:Multiselectfield.png]]
 
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.
 
=== Number ===
 
Stores a floating number. Examples:
* -1000
* 0
* 0.123
 
=== Picture ===
 
[[File:Picturefield.png]]
 
This 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 ===
 
[[File:Radiofield.png]]
 
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.)
 
=== Text ===
[[File:Textfield.png]]
 
Users can enter 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 textarea field.
 
=== Textarea ===
 
[[File:Textareafield.png]]
 
This allows users to enter a long piece of text using the rich text editor (TinyMCE)
 
=== URL ===
 
Ask the user to enter a URL. If you select ''autolink'' then the URL becomes a clickable link. 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.
 
==See also==
 
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=86927 Time stamp for database entries?] forum discussion
 
[[de:Datenbank-Felder]]
[[ru:Поля]]
[[fr:Champs]]
[[ja:データベースフィールド]]
[[nl:Databank velden]]

Latest revision as of 09:43, 9 January 2012

Redirect to: