-

Note: You are currently viewing documentation for Moodle 3.10. Up-to-date documentation for the latest stable version of Moodle may be available here: Database activity FAQ.

Database activity FAQ: Difference between revisions

From MoodleDocs
(see also)
(How can I create a database in which students can only view their own entries?)
Line 1: Line 1:
{{Databases}}==How can I enable a sort function by clicking on the field headings?==
{{Databases}}==How can I create a database in which students can only view their own entries?==
 
Either:
*Set up the database so that entries require approval. If the entries are never approved, then only the student that added a particular entry and the teachers can view it.
 
Or:
*Set the group mode of the database to "Separate groups" and assign each student to a separate group.
 
==How can I enable a sort function by clicking on the field headings?==


For sorting, you need to manually create the link in the template around that heading.  To find the URL you need, you can do a sort using the menus and then look in the URLs. Take out everything but the d, sort and order parameters. For example,
For sorting, you need to manually create the link in the template around that heading.  To find the URL you need, you can do a sort using the menus and then look in the URLs. Take out everything but the d, sort and order parameters. For example,
Line 31: Line 39:


*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=74243 How can I list database information horizontally instead of vertically?] forum discussion
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=74243 How can I list database information horizontally instead of vertically?] forum discussion
[[Category:FAQ]]

Revision as of 08:26, 16 May 2008

Template:Databases==How can I create a database in which students can only view their own entries?==

Either:

  • Set up the database so that entries require approval. If the entries are never approved, then only the student that added a particular entry and the teachers can view it.

Or:

  • Set the group mode of the database to "Separate groups" and assign each student to a separate group.

How can I enable a sort function by clicking on the field headings?

For sorting, you need to manually create the link in the template around that heading. To find the URL you need, you can do a sort using the menus and then look in the URLs. Take out everything but the d, sort and order parameters. For example,

http://moodle.org/mod/data/view.php?d=13&sort=44&order=ASC

http://moodle.org/mod/data/view.php?d=13&sort=44&order=DESC

How can I add highlighting like on the Module and plugins page?

In the repeated part of the template (note onmouseover and onmouseout to change the classes):

<tr onmouseover="this.className='trhighlight'" onmouseout="this.className='trnormal'">
 <td class="c0"><b><a href="##MoreURL##">[[Name]]</a></b></td>
 <td class="c1">[[Type]]</td>
 <td class="c2">[[Requirement]]</td>
 <td class="c3">[[Status]]</td>
 <td class="c4">[[Summary]]</td>
 <td align="center" class="c5">##Edit## ##Delete## ##More## ##Approve## </td>
</tr>

In the CSS template there are two styles:

.trnormal td {
   background-color: #FFFFFF;
 }
 .trhighlight td {
   background-color: #EEEEEE;
 }

See also