1.8.2 possible solution for display of lastname, firstname when assigning roles/groups

1.8.2 possible solution for display of lastname, firstname when assigning roles/groups

A. T. Wyatt發表於
Number of replies: 17

For those of us who use rosters arranged in lastname, firstname format, Moodle presents some challenges! Most common is display of firstname lastname format, compounded by the problem that in some places the users might be listed alphabetized by first name.

When assigning students to a course in Moodle 1.8.x, users are now alphabetized by lastname, but continued to be displayed firstname lastname. (Earlier versions of Moodle, i.e. 1.6.3, ordered students by firstname AND displayed them by firstname.) Of course in some places, a sort link was provided so you could order by surname. But our problems were particularly with assigning roles and assigning users to groups, since those lists were quite hard to read when they did not match the course rosters from which the faculty were working!

Therefore, Anthony Borrow was kind enough to share two hacks with me to help with this problem in Moodle 1.8.2. The first hack has to do with moodle/admin/roles/assign.html and assign.php. (See file attached--includes diffs)

And he posted a second hack to force the display of lastname, firstname when assigning members to groups within a course in the Moodle issue tracker. While it is true that the participants for assigning roles to a group is limited to those who are members of the course, we have some situations where up to 300 students are assigned to a course and separated into sections using groups. It was quite difficult to assign the students to groups manually when they were ordered by firstname.

http://tracker.moodle.org/browse/MDL-7163#action_28075

 Anthony Borrow - [18/Mar/07 12:54 PM ]
 To change the order of the list of members
 in the group members box I changed
 line 63 of /group/lib/utillib.php
 from: $fullname = fullname($user, true); 
 to: $fullname = $user->lastname.', '.$user->firstname; 

I have applied both these fixes on my instance, and so far have had no problems. I am posting this information here with Anthony's permission.

Related issues filed in tracker (if you are disposed to go vote!)

http://tracker.moodle.org/browse/MDL-7163
http://tracker.moodle.org/browse/MDL-7591

Related discussion:

http://moodle.org/mod/forum/discuss.php?d=76799

評比平均分數: -
In reply to A. T. Wyatt

Re: 1.8.2 possible solution for display of lastname, firstname when assigning roles/groups

Anthony Borrow發表於
Core developers的相片 Plugin developers的相片 Testers的相片
ATW - Thanks for sharing these with the community. I've not checked how they might work (or not in Moodle 1.9); however, if someone would like or need them for 1.9 I would be willing to give it a crack. Peace - Anthony
In reply to Anthony Borrow

Re: 1.8.2 possible solution for display of lastname, firstname when assigning roles/groups

A. T. Wyatt發表於
Yes, yes, yes! We would love it if you could check that out!

atw
In reply to A. T. Wyatt

Re: 1.8.2 possible solution for display of lastname, firstname when assigning roles/groups

Anthony Borrow發表於
Core developers的相片 Plugin developers的相片 Testers的相片
OK - I'll add it to my to-do list. Peace - Anthony
In reply to Anthony Borrow

Re: 1.8.2 possible solution for display of lastname, firstname when assigning roles/groups

Anthony Borrow發表於
Core developers的相片 Plugin developers的相片 Testers的相片
ATW - OK, I'm ready to move this to my to-done list. I did some quick testing and it seems to work. I have created CONTRIB-356 to add this minor patch to CVS if there is significant interest in doing so. My clear preference would be that the diff file attached to the issue will suffice for those who want to make the change; however, if there is greater interest then I would be willing to maintain it as a more official minor patch. Please only vote on the issue if you want it included in CVS. If you can handle working with the patch feel free to watch the issue. Let me know if there are any questions or bugs. Peace - Anthony
In reply to Anthony Borrow

Re: 1.8.2 possible solution for display of lastname, firstname when assigning roles/groups

A. T. Wyatt發表於
It doesn't look too bad!

Your choice. I am just thinking about previous discussion. Patches are hard for some people, and they probably need to just have a file to drop in.

atw
In reply to A. T. Wyatt

Re: 1.8.2 possible solution for display of lastname, firstname when assigning roles/groups

John Ryan發表於

Might another way of solving your problem be to use the enrolment module to automatically add students to your course.

At the moment this module does not add students to groups within a course but it should be a simple task to make an amendment to allow this.

I have made this amendment to my site and it works well, though it can only assign a student to one group.  It is a rather ugly hack as I am not that proficient at programming in PHP. It would be nice to see a proper amendment put into the core moodle version (written by someone who does know what they are doing!) but I am not sure how to raise this as an issue.

As you already have your lists of students and their groups this should make the process a lot simpler for you.

John

In reply to John Ryan

Re: 1.8.2 possible solution for display of lastname, firstname when assigning roles/groups

Iñaki Arenaza發表於
Core developers的相片 Documentation writers的相片 Peer reviewers的相片 Plugin developers的相片

but I am not sure how to raise this as an issue.

I think the best way to do it is by opening a bug/feature request in the bug tracker 微笑

Saludos. Iñaki.

In reply to John Ryan

Re: 1.8.2 possible solution for display of lastname, firstname when assigning roles/groups

Mark Lew發表於

Although Alhabetizing is being set for the entire Moodle site, it would be nice if it was also able to be assigned within each course. 

My biggest aggravation with alphabetizing is not only does it always show first name first regardless how it is alphabetizing, but when it is alphabetizing by last name, it does not also alphabetize first names when students have the same last name. 

Name alphabetizing should be a standard feature of any SIS system.

In reply to Mark Lew

Re: 1.8.2 possible solution for display of lastname, firstname when assigning roles/groups

Steve Bilton發表於
I have recently edited the way alphabetising displays users on my moodle so users are listed by First, Lastname format and alphabetised accordingly.

You can find the changes I made here, thanks goes out to Matt Campbell:
http://moodle.org/mod/forum/discuss.php?d=94007

I have also changed the block - QUICKMAIL to display the same way in this thread, firstname, last name alphabetised.

Quickmail allows teachers and/or students to send emails to others listed in the course. It allows attachments and uses wysiwyg/plain text editor. Quick mail emails the sender the sent email along with a list of those to which it was addressed. Quickmail also allows bulk sending of emails to any number of students on the course, (or teachers). I have re-arranged the users to be displayed in a more readable manor (For our purposes at least).

Matt provided one method for the version of quickmail he used and I have provided another method for the version of quickmail I currently use.

Hope this helps someone else.

Steve


In reply to A. T. Wyatt

Re: 1.8.2 possible solution for display of lastname, firstname when assigning roles/groups

Jamie Tinley發表於
Hi Anthony, ATW, et al. I've been reading all the trackers and forums about this issue. Correct me if I am wrong, but this diff patch fixes the assign roles mainly.

It has been requested informally in tracker MDL-7163 to allow sorting in administration too by lastname. It has not been made into a separate tracker and I know that Anthony had expressed how busy the programmers are so I will not create a request there but here instead.

using 1.9, when I go to admin/security/site policy and select 'full name format' to display by 'surname + firstname' it still sorts by firstname in my administration list of users. I know others have said it works fine for them that way but not me as it default sorts to first name no matter what. Same in a course when I view participants there is no default order.

Yes, I can click surname, but then I have to do that ever time it refreshes which is a pain. I would like a default hack that sorts by lastname by default.

Thanks, James
評比平均分數:Useful (1)
In reply to Jamie Tinley

Re: 1.8.2 possible solution for display of lastname, firstname when assigning roles/groups

A. T. Wyatt發表於
Greetings, James!

I think it is better to make a tracker request. If you think it is not a duplicate request, please do make a separate one and post back here so we can all vote! You can reference related tracker issues when you file.

I really really would like to have this feature!

atw
In reply to A. T. Wyatt

Re: 1.8.2 possible solution for display of lastname, firstname when assigning roles/groups

Anthony Borrow發表於
Core developers的相片 Plugin developers的相片 Testers的相片
Yep, it looks like a minor bug to me. I have created MDL-15930 and attached a patch file so hopefully we can get this fixed up pretty quickly and save mouse-clicks around the world 微笑

Just to clarify, regardless of how busy developers might be, good bug reports are always welcome. It is helpful to hear what users want and need so please do not hesitate to file issues in the tracker for bugs, feature requests, and other improvements detailing as much as possible how we can all work together to make Moodle even more awesome and better serve the needs of the community.

Peace - Anthony
In reply to Anthony Borrow

Re: 1.8.2 possible solution for display of lastname, firstname when assigning roles/groups

Jamie Tinley發表於
Thanks Anthony! I downloaded the patch and am trying to install it correctly.
James
In reply to Jamie Tinley

Re: 1.8.2 possible solution for display of lastname, firstname when assigning roles/groups

Annette Knobloch發表於

Patch? OK, that for system administrators? As faculty, I don't think I can do anything with a patch.