Automatically adding picture of user to his name possible?
I would like to know if there is a way to automatically add the picture of the user to his name in a database? I searched this forum, the FAQ and some examples but I couldn't find a solution. Perhaps I overlooked some instruction. All advice appreciated.
With kind regards,
Hartmut
Re: Automatically adding picture of user to his name possible?
For example, yours is:
But I don't think there is any way to add this automatically to a Moodle database activity?
It would need a field similar to ##user## returned from the database - maybe ##user_image## but this would have to be an addition to the database module.
Re: Automatically adding picture of user to his name possible?
Re: Automatically adding picture of user to his name possible?
Re: Automatically adding picture of user to his name possible?
Re: Automatically adding picture of user to his name possible?
that is a great idea.
I would have another idea for the database module:
Add the possibility to assign roles to the fields so that some fields only can be filled out by teachers, after a student has created an entry or that students can edit a field the teacher provided. So you can create complex exercices.
What do you think about that?
Yours,
David
Re: Automatically adding picture of user to his name possible?
Re: Automatically adding picture of user to his name possible?
yes I think you are right, that this would not be useful for many. I was just thinking, that this could be nice for example for administration purposes. The teacher could upload a certificate to a record created by a student. Or that some information entered in a record is only visible to the teacher (confidential) but all other fields are visible for all the students, ...
But there is another point perhaps more important: I develop courses for teachers like "Learn how to use moodle in your class". I personally like the database module and use it often instead of a wiki, because it is easier to use for the students.
Nevertheless teachers do not use the database tool for one specific reason: It is too complicated to create.
The solution would be a database creation wizard (Create your database in 5 guided steps)
1) Choose the fields you need
2) Now the fields chosen appear and you are asked to choose the ones appearing in list or single view, including checkboxes for the ##user##, ##...##
Example (instead of yes/no use checkboxes)
List view |
Single view |
|
Show username |
yes/no |
yes/no |
Show the date the record was made | yes/no | yes/no |
Show the field "Uploaded File" | yes/no | yes/no |
Show the field "title" |
yes/no |
yes/no |
3) Choose display mode for list view (For 99% of the use of database 5 different display modes are enough)
First display mode: Fieldname as title of columns, records below. The teacher can choose to alter the name of the columns
TITLE |
Uploaded file |
Username |
Date uploaded |
Content of the field "title" |
Uploaded file |
example name |
date1 |
Content of the field "title" | Uploaded file | another name |
date2 |
Second display mode: Just group the records and display one below the other
Third display mode: Drag and drop the possible fields in a given matrix
Fourth display mode: manual template: Create your view with the editor (as it is now for html experts)
Fifth display mode: display records horizontally.
4) Choose the default display order of list view (sort by date, title, username, etc)
5) Choose style template (three styles available)
But perhaps this wizard takes too much time to program?
Another idea for the database: possibility to define certain fields as "required". Now you can submit a record with empty fields, this should not be possible if a field is required
Yours,
David
Re: Automatically adding picture of user to his name possible?
I see your ideas on templating as expanding the options for default templates. It would be nice to have that be a plugin where the wizards could just be dropped in. That would allow folks to develop options beyond some of the simple possibilities.
As for the required field, check out MDL-5583 and feel free to watch/vote for it. I started work on it but dealing with how to actually require the form became a mess and I have not had a chance to get back to it. I have a patch in MDL-11400 which creates the tick box and if I recall will highlight it so that it says it is required but it does not actually require it. Keep the ideas flowing.
Peace - Anthony
Re: Automatically adding picture of user to his name possible?
yeah another ideo would be, that in the "Admin-Block->Modules->Database->Settings". The Admin of the Moodle Site can choose some database fields like skypename, username, or anything else to be displayed in the database with ##userprofilefieldname## or so. Other suggestions: subscribed courses, etc.. with ##subscribedcourses##. So for security reasons the admin can choose what the teachers can choose....
Thanks for posting the other issues, I just voted for them.
Yours,
David
Re: Automatically adding picture of user to his name possible?
Re: Automatically adding picture of user to his name possible?
I just created a new feature request (for 2.0) for displaying any user profile fields. So everyone is invited to vite for it!
MDL-20140
Yours
David
Re: Automatically adding picture of user to his name possible?
Re: Automatically adding picture of user to his name possible?
With kind regards,
Hartmut
Re: Automatically adding picture of user to his name possible?
Re: Automatically adding picture of user to his name possible?
With kind regards,
Hartmut
Re: Automatically adding picture of user to his name possible?
Re: Automatically adding picture of user to his name possible?
Hi Anthony,
Today we updated to Moodle 1.99. When TMDHosting tried to apply the patch for adding user pictures to any database activity, they received the error message:
can't find file to patch at input line 25
Is this patch working in Moodle 1.99? How can I apply this patch to an Apache server with PHP 5.2.11?
Any help is highly appreciated.
With kind regards,
Hartmut
Re: Automatically adding picture of user to his name possible?
Hartmut - I have not tried it but I did not notice any significant changes to /mod/data/lib.php that would make it not work. The patch is pretty small and simple, so you may just want to make it manually. Let me know how I can be of help. Peace - Anthony
Re: Automatically adding picture of user to his name possible?
Thank you, Anthony, for your prompt reply and for offering your help. As I have never applied a patch in Moodle before, I will try out the patch in a test domain first.
With kind regards,
Hartmut
Re: Automatically adding picture of user to his name possible?
Hartmut - Let me know how it goes and please feel free to report any problems in the tracker at MDL-20053. Peace - Anthony
Re: Automatically adding picture of user to his name possible?
Hi Anthony,
I followed your advice and added the patch manually - and it works. Thanks for your encouragement.
With kind regards,
Hartmut
Re: Automatically adding picture of user to his name possible?
Excellent! Glad to hear it works. Today you applied it manually, next time it will be with your IDE (like Eclipse) and then after that you'll be applying it via the command line. Happy Moodling! Peace - Anthony
Re: Automatically adding picture of user to his name possible?
Hi Anthony,
I would like to use ##userpicture## in Moodle 2.x.x as well, but the patch MDL-20053 works only in Moodle 1.9. Can you help me with a patch for Moodle 2.x.x?
With kind regards,
Hartmut
Re: Automatically adding picture of user to his name possible?
Hartmut - I'll see if I can get MDL-20053 some attention and if I have a chance I'll work up a patch for 2.0. Peace - Anthony
Re: Automatically adding picture of user to his name possible?
You are fast, Anthony, and it works. Today, I applied your patch manually. Many thanks for your work.
With kind regards,
Hartmut
Re: Automatically adding picture of user to his name possible?
Hartmut - I am glad to hear that the revised patch work and hopefully the tracker issue will be resolved soon especially as 2.1 aims to improve the various activity modules. If you need anything else just let me know. Peace - Anthony