Ad hoc query against the Moodle db and a course db activity

Re: Ad hoc query against the Moodle db and a course db activity

by AL Rachels -
Number of replies: 0
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Using profile fields in the database activity directly is very limited and the fields you can use depends on which template you are adding them to. For instance, you can add User and User picture to the List and Single templates. In this case user is both first and last names. The Advanced search template lets you use firstname and lastname. If you want anything more, an ad-hoc query would be the way to go. With perseverance, you can get it to spit out anything in the Moodle database as long as you can come up with a working query.

If you have the Generico filter installed, it will let you add the other profile fields. Read about it here and scroll down to USER PROFILE VARIABLES. The nice thing about Generico, is it will let you put the information just about anywhere in Moodle that you can open the Atto editor. UNFORTUNATELY adding a Generico filter to a template is NOT one of those places and does NOT work. BUT, if you add the text of the filter, e.g. {GENERICO:type="firstname"} into a text field when adding an entry, so that it's results are part of the database entry, it does work there. thoughtful

Average of ratings: Useful (1)