What about a place in the admin area to contral the points. Where the admin can give points or take them away. Like give points as gifts. What about a way to donate points to each other. Where one user can give another users his points. Kind of like cash. I know a lot of forum have something like a cash mod.

CommentFileSizeAuthor
#10 userpoints.zip4.76 KBneeraj_slash

Comments

kbahey’s picture

This can be added, either as an option for this module, or as a separate module.

Do you need this for a commerical site? If so, you can sponsor this feature.

hayscg’s picture

It's for a personal site. So how do I get it to work?

kbahey’s picture

It is not a feature that is already in the current version. Therefore, it needs to designed, coded and tested, and hence my comment.

kbahey’s picture

Title: Point Contral » Administrator defined points

In another issue, sciman wrote:

Administrator Points for Participation?

There's a thread over at drupaled.org http://drupaled.org/node/74#comment-249 focusing on some possibilities for making user points even more helpful, and a key item is along the lines of another request for "point contral".

Is it possible to piggy-back the news that one can add points for any node type and create new nodes (maybe with flexinode?) that would allow the administrator to add bonus points to the record for specific users? This way, for instance, a faculty member might be able to give credits for performances on the site -- participation bonuses so to speak;-)

kbahey’s picture

One potential issue here is that users may not like such a features, since it may lead to (or be caused by) favoritism, real or perceived.

If we say that this is left to the discretion of the site owner, then we can proceed with this.

Remember that there is no detailed record of points added/subtracted, just a running total per user. So this will be difficult to trace if the need arises.

Anyway, how about this:

- a permission is added (grant userpoints)
- If a user has that permission, they can add or subtract points to others. This way a role can be set up for this if needed.
- a form is presented with two boxes, one the uid (user ID), and the other is points. Points can be negative (subtract) or positive (add). This way, a user can have his points reset if needed. The uid box cannot be a drop down list, since number of members can be to large for this for many sites.

Ideas? Comments? Suggestions?

kbahey’s picture

Forgot to say that when admin clicks on submit, there will be a confirmation dialog before the points are added/subtracted. This is necessary because someone may enter the wrong UID and realize the mistake they did.

Chiquechick’s picture

Suggestion: As of 4.7 we will have autocompletes. Please use that in stead of userid.
Also: in Drupal 4.6 the user field with a node is 'just type the name, we will validate', which is better then a UID. That is the one replaced by autocomplete, BTW.

Bèr Kessels’s picture

Sorry, logged in incorrect. That was me :)

sciman’s picture

sorry not to have responded to this. Somehow in the node type I don't get notified of updates, so unless I'm browsing, I miss out on the dialog.

I can surely se your reservation about users not appreciating others adjusting their points... it's an important issue, and surely there would need to be special permissions involved. This is done of course in most educational software.. instructors or tutors evaluate the work of students. In such cases, however, as you point out, the scores are traceable for accountability -- a student learns what grade they get on a paper as well as knowing their current point totals. Of course this is the work for some sort of grade administration module.

My fantasy of a separate node which might impact scoring was that perhaps such a node could be traced.. (for example 3 "2-point boosts" with notes..that could be summarized or stored.. little grade chits.) Your vision seems to be of a node type with two boxes.. UID (or autocomplete?) Could other items or actions be associated with the node type? Could these essentially be grade chits -- maybe like a webform where one could even embed the users email and compose a small notice.. "thanks for the great Job.. Steve is getting you another 2 points".. or some other news I might think needed to be shared for a deduction. (I envision a need to deduct in few cases.. but let's say a student does a blog that's worth 20 points and submits the minimum of 200 words required by the assignment. If the post was really low in quality, I'd not want to grant the 20 points..All of that is probably impossible. The capacity to add or subtract could still be useful, but perhaps it'd be better for me to handle this off-line.

neeraj_slash’s picture

StatusFileSize
new4.76 KB

- a permission is added (grant userpoints)
- If a user has that permission, they can add or subtract points to others. This way a role can be set up for this if needed.
- a form is presented with two boxes, one the uid (user ID), and the other is points. Points can be negative (subtract) or positive (add). This way, a user can have his points reset if needed. The uid box cannot be a drop down list, since number of members can be to large for this for many sites.

I just implemented the above on a site SlashIndia.org by hacking on the userpoints module. I am attaching my code here. I have still not set up cvs on my machine so I have been unable to make the patch file. However, the code is largely localized so it's pretty straight forward to add. I am attaching two files:

1. additions.php - which contains the code additions.
2. userpoints.module - which contains the final working copy.

The code works well and is pretty clean, I have checked it on a working copy. It shows a confimation when doing an update, which shows the username affected also. It also displays a message if the user ID is not valid. The permission required to update is 'admin userpoints'.

Do let me know if you require any minor modifications. Will be more than eager to contribute my 2 paise. ;)

kbahey’s picture

Assigned: hayscg » kbahey

Thanks for this.

I may not put it in 4.6 though, since we are so close to 4.7.

It would also be nicer if we combined this with and audit log as per here http://drupal.org/node/37759

neeraj_slash’s picture

Will the audit log be a separate table, or is it something you want me to add to watchdog. I will try to fix it sometime and upload the code.

kbahey’s picture

It should be a separate table, NOT in the watchdog.

Another thing is: is there a chance of doing this to the 4.7 version. Now that this release is around the corner, it is best to think forward and not spend too much time on older releases. It is mainly a form API issue.

neeraj_slash’s picture

Actually my site SlashIndia runs on 4.6, and I am not really planning to migrate to 4.7 until its a bit stable. But I guess I could still install 4.7 on my machine and see if it works out, I am assuming that there is not much difference in coding modules between 4.6 and 4.7. Also, I dont really understand what you mean by that 'its a form api issue',(remember I am a newbie to drupal ;) ) .

kbahey’s picture

Assigned: kbahey » Unassigned
kbahey’s picture

Version: 4.6.x-1.x-dev » master

User laexter said in another duplicate issue

"Can I have an easy way to substract or add points on the user page? Because there are times where admins want to give (manually) bonus points or punishments by point deduction."

I think putting it in the user page makes sense.

Leonth’s picture

Sorry for the duplicate issue :grin:.

How about my idea, putting it in the user page? You don't have to think about the code to mod points based on uid or username, just use the user page everyone has.

Anyway, when someone wants to mod points, the reason is that a node/comment is really good/really bad. Since the user page is accessible from every node/comment, logically admins should mod the points there.

irishsuperfly’s picture

Thanks for creating this patch!

The only problem I've run into is if a user does not already have points, you can't manually change their balance. I have a user who I need give points, but her name does not appear in the "Update User Points" list since she has 0 points now. I tried to enter her UID from the user list and add the points, but I get the following error: No user exists with User ID:40. So, unless they have points, the patch does not recognize them to manually update.

If you manually change a user's points from any number to 0, they remain in the update user points list. But they must have earned points to get put on that list first.

jwilde’s picture

Have neeraj_slash changes been update to 4.7?

Thanks,

Jim

jwilde’s picture

I updated the above patch to 4.7 but I can't get it to work all the way. Anybody want to take a look at it?

Thanks,

Jim

conta’s picture

Hi, I'm wondering if anyone actually got this to work with 4.7..

anyone?

kbahey’s picture

If someone provides a proper patch for 4.7 I will be glad to put it in.

This should go hand in hand with a points transaction database table, listing every transaction, with number of points (+ or -_ , timestamp, user, and description.

This would make auditing such additions easy, as well as providing temporal data (points for last month, total points, ...etc)

conta’s picture

Anyone?

sun’s picture

Hm, why don't we stay on focus? Let's discuss audit log of user points here and tamper with custom granting of user points for user's with appropriate permissions here.

tadashi-1’s picture

any progress with 4.7?

kbahey’s picture

Status: Active » Patch (to be ported)

This feature is now available in userpoints 4.7.x-2.0

irishsuperfly’s picture

I just upgraded my site to 4.7.6 and noticed that the user ID is no longer shown in the user list. Is there a way to get that info to show? We rely heavily on manually changing user points since our reward system is not fully automated yet, and that requires knowing a user's ID number. Maybe I should be posting this under the user core? Another site is using version 5 and the IDs don't show there either.

kbahey’s picture

Please do not confuse people by posting to unrelated issues.

This has nothing to do with this feature, or at least as you described it.

Please open a new issue with a screen shot of what you think is a problem.

jredding’s picture

Component: Code » Code: userpoints
Status: Patch (to be ported) » Closed (fixed)

latest version allows an administrator to grant or take away points.
Additionally usertouserpoints (contrib module) allows a user to transfer points to another user.

closing issue.