AU Computer Gaming Club

General Club Discussion - A Polling / Voting module I've been working on (for gamers)

Stick - Jul 28, 2005 - 06:37 PM
Post subject: A Polling / Voting module I've been working on (for gamers)
www.freepgs.com/r_stich/poll/index.php

Hey, about a year ago I had talked about programming a webpage where we could vote on things like what to put on the image, elect officers, what to buy with club money, etc. I've been working on it, and am just getting to the point where most of the bugs are ironed out.
Thought you guys could give it a spin and see how it fits gamers.

couple of current bugs: the progress meters' text is funky.
I haven't implemented showing the descriptions of the items, I hope to have them as mouseovers...

Different polls are open to different levels of member. Right now everyone joins as a newb and I would have to upgrade your account for you to have access to other functions. Eventually the idea is to tie this into the existing gamers site and get user levels off of it's database.

xero, I've already set up an account for you with password xero, it is at admin level.

anyway, everyone feel free to register (even more than once if you want).
Note, if you add things (like to the beer list) try to make sure you put it in the right category.
jokeyxero - Jul 28, 2005 - 08:15 PM
Post subject: RE: A Polling / Voting module I
its pretty promising. saw a few of the bugs you mentioned, but didn't have time to look it over or postulate about it. i like where its going though.
Stick - Jul 29, 2005 - 11:53 AM
Post subject:
**EDITED TO BE CURRENT**
+++++User manual (for normal user):++++++++++++

1) once registered, you will be presented with
--a) the option to delete your user
--b) a list of polls that your user level is allowed to vote on. Polls you have already participated in will either not be selectable, or will give you the option to delete your entries and revote
--c) a list of poll results that your user level is allowed to view

note that the lists of b and c may not be the same. For example, a poll may allow you to vote for an officer, but not allow you to see the result until the election is over...

for voting... choose a poll by selecting its radio button and click "go to poll".
2) You should now be presented with a list of drop-down boxes associated with this particular poll. There may only be one, or there may be more than one, organized by "categories". Descriptions of the categories be shown in blue.
Some categories may expand to allow more votes, as you fill in the available ones. In any case, choose selections from the various categories.
If the poll has a "limit" (ie: price, or size), then a status bar at the bottom will show how much of the capacity you have used. When you are over capacity the submit button will be greyed out - in this case "unselect" some of your choices by setting them back to "Select One".

3) in the event that the pollmaster has allowed you to add new items to the poll, a button labeled "add to list" will be available. Before using this function make sure that an identical or similiar item does not already exist among the choices.
upon clicking this a child window will open with text inputs necessary to add an item to the database.
--Choose the category that the item would best fit under.
--name the Item (something short but disctinctive)
--a longer description. Put as much pertinent information here as you can. if it is a game, make sure to include how many people can play, whether it can be played on a LAN, copy protections that may interfere with Gamers' usage, etc.
--Install size and price, if applicable. if you can find these out, please do. If the poll depends on these numbers and they are blank or incorrect, the votes for these options will have to be discarded later.
--click Go when the information has been filled in.
--refresh the parent browser, the item you added should appear among the selections.

4) When you are satisfied with your votes, click Submit Vote.
you should see a message that begins with "vote added" for each item you had selected.


++++++++admin directions++++++++++

CREATING A POLL (currently available to users of level 4 and 5
1) under the Officer section, there is a section labelled "create new poll"
Description: the title of the poll, keep it succint, as this will be the text that shows up on the list of polls.
Size Limit: If you want the poll to limit a user's votes to a count from the first field (in the db name max_1), enter the limit here.
Price Limit: same, for second field (max_2).
user level: the level of user that will be allowed to cast a vote
Add level: the level of user that will be allowed to add items to the selections.
Viewable By: the level of user that can view the results.
Revote Allowed?: Whether the user can change their vote after submitting.

2) Fill in this information and click "create". at the very minimum you need to add a title.

3) (create a poll) page:
next you come to the page where you will add choices to your vote. The choices are organized as such.
Category:
---Static
---Static?
(---Dynamic?)
next Category?...


Each "Category" you add will allow the user 1 or more choices from items located in (or under, if you select "expand category tree") a category node in the database.
**To view the category nodes and add new ones click "show tree".**
you can add categories to the database under the "show tree" window.

***If you only want the user to have one vote from the category, leave static at 1 and dynamic at 0.***

If you want to force the user to make a certain number of votes from this category, select "force static" and enter the number of forced votes into the "static" area.

If you want the user to have the option to vote more than once, enter a number in "dynamic" to place a cap on the total limit of votes you will allow. The limit will be static + dynamic. If you are not forcing the user to choose from this category, it is suggested to leave static at 1 and put the rest of the number in dynamic.

4) click "another cat" to add this category to the poll (even, if you don't have another category to add).
now your poll should take shape, filling the top of the window and allowing you to continue adding categories below. If you make a mistake, the only option now is to "delete", which will delete the entire poll, and start over from the previous page.
Note that the categories will always appear in the order you created them, and that the "force static" and "expand tree" are seperate for each category.

MANAGE USERS for admin only.
will allow you to change user levels, or delete, other users.

CLEANUP POLLS for admin only.
will allow you to delete a poll.
Stick - Jul 29, 2005 - 12:02 PM
Post subject:
So, uses which I had in mind when designing this:

--)The one above, voting for games to put on the image. Further, you could force everyone to choose at least one FPS, one RTS, etc. Restrict it to active gamers.

--)Purchasing games. Same as above, but restrict by price. Limit to paying gamers.

--)Voting for officers. Only one vote allowed per gamer. restrict to active gamers.

--)Vote for tournies at TigerLan. ignore the weights and just give everyone a certain number of choices. open to anyone maybe? Of course, each person only gets one vote.

--)KOTN game selection.

did I miss anything?
Bandit - Jul 29, 2005 - 01:58 PM
Post subject:
That is very interesting. How does one fix things in the list if incorrect? or add to information if incomplete at the time?

BTW I think this idea is awsome and cudos to you for actually makeing it. I hear so many people say it would be cool if. And then they never take the action to figure out how to make it.
Stick - Jul 29, 2005 - 05:13 PM
Post subject:
well, so far all editing is left to phpMyAdmin, ie: editing the database directly. Actually, today I've been adding a script that will allow the officers to create a poll, but, at least for gamers, I think directly editing the database to set stuff up and correct entries is quicker and prettier using phpMyAdmin.

Bandit, if you've registered already as a user I will give you admin status... probably by tomorrow you will be able to create new polls. and, as explained above, giving permission to users to add Items to the polls is up to the poll originator.
Bandit - Jul 29, 2005 - 05:52 PM
Post subject:
I'm registered. Hook me up.
Stick - Jul 29, 2005 - 06:33 PM
Post subject:
done, bandit. I'm almost finished with the poll creation scripts, that should be online tomorrow.
edit: just lucky, I guess, they are up now. Bandit and xero can create new polls... no error checking yet, though, so you have to go by the rules. the main thing is that you have to use acceptable categories...
will fix that first.


xero, any chance I could upload this stuff to the augamers.org website and start looking into tapping into the user database?
Bandit - Jul 29, 2005 - 07:03 PM
Post subject:
Hmm I need to be able to edit the poll. As in delete things that shouldn't be there or I screwed up because I didn't understand the interface.
Stick - Jul 29, 2005 - 07:08 PM
Post subject:
Wow, bandit looks like you beat me to it. I fixed the category selection thing, evidently while you were adding one. Working on the delete ability right now, have it up tomorrow.
jokeyxero - Jul 29, 2005 - 07:32 PM
Post subject:
It'd be best to just setup a system like ours on your local setup for testing. If you want a MySQL dump of our database I can get you one. Just so you know, here's our setup:

Postnuke 0.75 Gold (with all of their patches) - http://www.postnuke.com
PNphpBB2 Plugin 1.2g - http://www.pnphpbb.com
MySQL (not sure version, probably latest stable) - http://www.mysql.com
Running on Apache w/ Linux


The user tables in there are pretty easy to tie into (just put a User_ID column in your tables somewhere). Permissions can be handled via Postnuke also if needed (preferred). All that would really be needed is a Postnuke Module that we can drop into our system. When its like that then we can set it up anywhere we want on the site.

For now I would focus on just getting the module working the way you want outside of Postnuke. That way you can just translate the flow of the algorithms into the Postnuke Module style instead of trying to learn their methods while trying to develop the module. The way PN wants you to do things is a little odd but highly regimented so it works out.

I'd love to dig in and help you out at the moment but I don't have time to do much of anything until finals are over. It's back to back work.
Stick - Jul 29, 2005 - 07:45 PM
Post subject:
actually the other reason was because, although I paid $3 to set up at freepgs.com, it is otherwise free. Which is fine, but the phpMyAdmin is really really slow. i also suspect that the PHP version is older. In any case, I was hoping for a small bit of hosting space at the same time. if you don't want me to mess with the database that's ok, but if it's there that would kill two birds...

Additionally, then you guys could get into the tables and change stuff to see how you like it. As it is now I don't think I can add more users with access through phpMyAdmin at freepgs.com, dig?
Bandit - Aug 01, 2005 - 01:29 PM
Post subject:
I don't see the Admin section Stick. I thought you said you added it?

BTW please apply sorting to all the drop down lists. Also think about adding the ability to dynamically add descriptors to item types. So like for a game an administrator could add Video Card Minimum requiremetns w/o having you rewrite the module. Or for Beer one could add a descriptor such as % alcohol content. These descriptors would then have drop down lists that could be user populated.

Just an idea.
Stick - Aug 01, 2005 - 03:23 PM
Post subject:
hey, i like that idea, bandit. i was already thinking about adding more descriptors (in the programs terms I call them "weights". You've given me an idea, I could just add a third, with an extra field that describes it.

What kind of sorting do you mean?

no admin section, I decided that creating polls should be available at officer level and up. Admin would be just for maintaining users-type responsibilities, but for now phpMyAdmin is a much better tool for that.

Right now I'm adding an optional validation routine, so that for each category you can "force" the user to make the static selections. Also will be adding the item descriptions at some point.
Bandit - Aug 01, 2005 - 04:25 PM
Post subject:
I recommend using the US MLA English Standard sorting method. Alpha-Betaical

By Admin section I meant to say. ... I thought you said the ability to delete or edit polls once created was ready for testing.
Stick - Aug 01, 2005 - 04:51 PM
Post subject:
no, sorry. I added a "delete" option while creating the poll. Once it's done it can only be changed (currently) by editing the database. Which isn't hard...

In fact I think that's a better way, otherwise it would be too easy to manipulate votes that have already been placed. but, I may get around to doing that as well.
Right now DHTML objects are giving me headaches.
Stick
Bandit - Aug 01, 2005 - 05:44 PM
Post subject:
Can you explain the fields I see when I'm creating a poll?

Static 1 Dynamic 0 Expand Category Tree
Stick - Aug 01, 2005 - 05:59 PM
Post subject:
the 3rd post in this thread goes into some detail on the structure, but, to supplement:

Static: this will determine how many selections start underneath a category. In the next upload there will also be an option to make that many selections mandatory (an option per category) for the entry to be validated. There should be a minimum of 1 for each category.

Dynamic: Once the last static selection has been filled, the dynamic ones will be added to the form to increase the number of selections, up to a limit of static+dynamic. The reason this might be useful is if you wanted to get the voter the option to select a lot of one category, without cluttering up the poll.

if static were 2, and dynamic 4, and the "make static mandatory" option was enabled, it would mean this:
choose from 2 to 6 items from this category.

You can set up Categories in a tree structure by assigning parents in the database. for example, GAME is the grandfather category of all games. Under that comes Library games and ToBuy games. Under Library games comes FPS's, RTS's, etc. if you want to include all the categories underneath your root category selection (ie: all Library games) you enable Expand Category Tree.

Make Static mandatory: I will add this soon. if left unchecked, the previous example of 2 static, 4 dynamic, would be this: choose up to 6 selections from this category.
Bandit - Aug 03, 2005 - 05:28 PM
Post subject:
Anything new on this?
Stick - Aug 04, 2005 - 11:11 AM
Post subject:
every day something new.

...except yesterday.

When you are creating a form, now you can see the category tree to help choose the right category.
Today will be adding a user manager for the admin.

sometime in the future will add the ability to set expiration date and remove old polls.

xero, any opinion on hosting this app and giving me access to the augamers databases?
Stick - Aug 04, 2005 - 05:43 PM
Post subject:
ok, I have updated the user/admin manual (3rd post from the top of this thread.
Things added today:
Admin can now view and add categories to the tree
admin can now change status and delete other users. In the gamers, it would be recommended to leave admin duties to the secretary. When someone pays them dues or attends an O-meeting he can update their status quickly.
Admin can now delete polls.

It's at the point now, i think, where you guys could go ahead and set up the polls, categories, and items and use it without my interference. If anyone else would like to do this, I can grant admin status, or even better, setup a completely fresh personal page in another directory for your use only.
C'mon guys, having a party and want to let your friends decide what keg to buy?
let your relatives vote on the next location for a reunion.
obviously, there are lots of places on the web to set up a simple poll, but with this one you can allow the votees to add items, only allow them to vote once if you want, and what not.


anyhoo, put suggestions here. It's not dummy proof yet, so if you want to break it you will be able to.
Bandit - Aug 04, 2005 - 06:00 PM
Post subject:
cleanup polls is not working for me. Just brings up a dropdown box in a new window. But no submit button.
Stick - Aug 08, 2005 - 12:41 PM
Post subject:
can you try again, Bandit, could be that I was working on it at the time... It works for me.
There is no "submit" button, just a "delete" button to the right of the drop down.
Bandit - Aug 08, 2005 - 01:28 PM
Post subject:
It is not working using Firefox
Stick - Aug 08, 2005 - 02:17 PM
Post subject:
ok, good clue.
unfortunately I'm not allowed to install FireFox at work, so it's hard to test browsers.
Anything else you notice please let me know.

I'll check into that submit button, should be easy, as all the others work, right?
right?
Bandit - Aug 08, 2005 - 04:02 PM
Post subject:
All of them that I know about.
Stick - Aug 08, 2005 - 04:41 PM
Post subject:
Here's my current to do list. Feel free to suggest more important things:

DONE-insert calender on poll creation to set expiration date:
DONE- :add expiration check on poll viewer, on admin cleanup, etc.

--Categories will include a description of what item:field1 and field2 are --set when the category is created, and be able to set either or both as mandatory. ie: for a game in the library, we don't care what price it is, but we must know how much disk space it takes (field1) and could ask how many players it can involve (field2). For a game up for purchase, we must know the price.
:when adding categories check to make sure the parent exists.

-- on adding items screen, the form will react to the selection of the category, category description will appear and field names might change.

DONE---Iron out browser specific problems
Bandit - Aug 11, 2005 - 12:21 PM
Post subject:
Check out the last poll I added. How come it will allow multiple selections but only keep track of one vote?
Stick - Aug 11, 2005 - 05:29 PM
Post subject:
I assume you are talking about "Best Games of All Time".
I chose 3 games and they were all added successfully.

Note that duplicate votes are currently not permitted. This is not a bug, but still a design question. Further down the road this will probably be an additional option when setting up a poll, whether to allow duplicates or not.

Just uploaded a new version of the thing. The next thing I will tackle is organizing users into groups that cannot interfere with or even see other groups' polls.
Bandit - Aug 11, 2005 - 06:17 PM
Post subject:
Try it again in FireFox. Something isn't right. I voted on 4 games and hit submit then the page said your 1 vote was added. Then I viewed the results and only 1 of my votes was counted.
Stick - Aug 11, 2005 - 09:30 PM
Post subject:
ok, I see what you mean. That looks like something more than a missing bracket (the last time that was all, and IE just glossed over it).
It might be awhile before I get to that. I really want to set up the Groups thing.

I just added some admin-level database checks, that will root out problems in the database, for example, branches not connected to the category tree, votes for polls that have been deleted, etc. This stuff shouldn't be allowed to happen, but I threw it in just in case.

Thanks for the bug notice, Bandit.
Stick - Aug 17, 2005 - 01:44 PM
Post subject:
Well, I've added member groups and some additional admin utilities, which I'll detail below. unfortunately, after looking into the Firefox thing I'm not sure if I'm going to be able to fix it so readily.

Groups:
Groups are tied into the category tree. Any node of the category tree can be made into a group root. Each user belongs to a specific group. They do not have access to polls outside of their group. This is almost completely independent from user level (the 5 levels from guest to admin). A user can be admin of a subgroup. Let me explain with an example. Right now I am set up as admin of "NONE", which is the trunk of the category tree. Under that I have the categories "DEMO", "STICH", and "GAMERS". Lets say Xero is admin of "GAMERS". Even though he has admin rights, when he goes to the item manager screen, he will only be able to edit and move around items within the GAMERS' tree. Now lets say the club's secretary will be in charge of voting for officers. Under the GAMERS category we can add an Officers category, and make the secretary admin of that. That way he can allow admin (or officer level) rights, without threating the main polls in the gamers' tree. Folks in the DEMO and STICH trees will never know anything at all about GAMERS, and vice versa.

If anyone wants a completely new category tree to play with let me know.

Admin tools:
user manager: you can change user level and groups of users that are either less than admin level or admin level of a lesser branch.
poll manager: delete a poll or change user levels for voting, viewing, and adding items. change the option to revote. You are not allowed to change expiration date or number of votes or category weight caps or anything. Any of these would malign the integrity of the existing votes cast.
item manager: edit an item, move it to a different category, or delete it. This presents an ethical problem. If the price, for example, of an item is changed, and it had already been used in previous votes, it potentially changes the validity of those votes. Should they be deleted? Caution must be taken.
Category browser. Add and delete categories.
check database. a few logical checks are run on the database and inconsitencies may be eliminated.
Bandit - Aug 17, 2005 - 03:02 PM
Post subject:
In Firefox.

I have noticed I can't see polls that are other than guest polls but I'm an admin.

Also an observation. I check out some of the generated page code and it looks like you are doing most of your vote validation in java script. Although this is faster on the user end and less stressfull for the server I hope you are doing some validations on client side on those submits. Otherwise a devious person could write their own page and submit what they like to your server. I understand you just want to use this for the gamers and it may be fine with out those checks on a local level. But if you intend to make this into a module that can plugin to websites you need to add that security.
Stick - Aug 18, 2005 - 04:30 PM
Post subject:
yer a dirty no 'count hack3r.
jokeyxero - Aug 18, 2005 - 06:17 PM
Post subject:
lmao
Stick - Aug 19, 2005 - 03:07 PM
Post subject:
Ok, Stick's WikiPoll of Evil has listened to it's extensive userbase (ahem, bandit), and it has responded!!

Should be ok to use Firefox now. Thanks for finding those bugs, Bandit. Please let me know if you see anymore.
everything should be working fine, except I haven't coded in any hacker protection.

anyone: if you want to set up your own "domain" within the polling system, let me know. It can be fairly handy
Bandit - Aug 19, 2005 - 04:19 PM
Post subject:
looks good now.

Apply weights button shouldn't show if there are no weights to apply.
Stick - Aug 19, 2005 - 04:38 PM
Post subject:
oh, now that's a good idea.
consider it done. although it won't be until I do it ...
Bandit - Aug 19, 2005 - 09:07 PM
Post subject:
Oh and it bugs the hell out of me that my password is showing on the main page.
Bandit - Aug 26, 2005 - 06:48 PM
Post subject:
Maybe you should add a section that allows you to edit the tree and items in the tree. I like the feature that lets you add things on the fly at non-admin level. But what about editing errors or inclomplete entries?
Bandit - Sep 13, 2005 - 01:29 PM
Post subject: so
You just give up on this tool Stick? Or get in trouble at work?
Ack - Sep 14, 2005 - 12:55 PM
Post subject: RE: so
He might just be really busy, but this did bring up some good points. Hey Xero, who's responsible for handling the website? You might want to start making sure people know how to use all the proper languages just in case.
jokeyxero - Sep 14, 2005 - 05:19 PM
Post subject: RE: so
I am, and what the hell are you talking about 'languages'?
Ack - Sep 14, 2005 - 07:04 PM
Post subject: RE: so
HTML, Java, PHP, all that good stuff. Whatever programming languages they'll need to know.
jokeyxero - Sep 15, 2005 - 11:05 AM
Post subject: RE: so
Don't need to know anything, there's a content management system (Postnuke) so you don't really have to know anything but HTML and how to moderate a forum. Since I host the website on my personal account I will remain the webmaster as long as I host it. Though I can make more admins in Postnuke so others can update things.
Ack - Sep 15, 2005 - 11:37 AM
Post subject: RE: so
Ok, cool beans. Glad the system works.
Bandit - Sep 15, 2005 - 11:39 AM
Post subject: RE: so
By hosting it on your account do you mean your Auburn account?
jokeyxero - Sep 15, 2005 - 06:28 PM
Post subject: RE: so
no, I mean the account my other domains are on, my personal web hosting account with slhost.com
Stick - Oct 03, 2005 - 11:38 AM
Post subject: Re: so
      Bandit wrote:
You just give up on this tool Stick? Or get in trouble at work?


(*trail of drool to desk, red eyes*, waking up) trouble, wha? who?

yessir, no, everything's good sir, good morning, thank you.

No, not in trouble, I haven't looked at the code in awhile. I got it to a point that I liked, that I thought was pretty useable. I used it myself for something (without telling people it was my code). Was going to set up a page on SourceForge, but my request for a new account was never answered.

To answer a previous request, admins can edit items (ie: delete, move them to a new category, or change the weightings). This should help in case you allow people to add items but they don't fill in the weights correctly.

I still think this would be very useful to the gamers in many ways (heck, that's what it was designed for), and would love to see it used. If you are interested, officers, ask me and I can help get it moving. Would be ideal for selecting club purchases, selecting games for image, officer voting, TigerLAN competition choice, etc.

As far as making it a PostNuke module, I don't see the point, it's fairly easy just to link to the voting page. If gamers started to use it and found it helpful we could look into embedding it as a module. The main negative now for having it seperate is that each gamer would have a seperate login than their website login, but at the same time, for security, you could think of that as a plus. That was a design choice Smile

Anyhow, in it's current stage, if anyone wants their own little voting/polling tool, it can be set up to be completely isolated and private from the other polls. Just shoot me an email or respond to this thread.

Stick
All times are
Powered by PNphpBB2 © 2003-2009 The Zafenio Team
Credits