[MOD-DB]tabulated survey at topic head

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

[MOD-DB]tabulated survey at topic head

Post by asinshesq »

This is a pretty powerful mod (IMHO ;) ). It lets any user who is allowed to post a poll design a survey of up to 8 questions that will appear at the top of a topic (like a poll does). As users answer the questions, their names appear on the left column and their individual answers appear on columns to the right with totals at the bottom where appropriate.

The person designing the survey gets to the screen that allows him to design a survey by clicking a link titled "Click here to access or hide survey design box" that appears under the post window whenever a person who is allowed to post a poll is posting a new topic or editing the first post of a topic. In designing the survey, a form allows the designing user to specify:
  • The name of the survey (sometimes this would be an overall question or text that introduces the real questions)
  • which group or groups are supposed to answer the survey
  • whether users who answer the survey should be shown in the left column or left out
  • whether the answers to the survey (the rows in the survey) should be shown alphabetically by the username column, alphabetically (or reverse alphabetically) by the first answer column or in the order in which users submitted the answers
  • whether the users in the group answering the survey who have NOT already answered the survey should be listed as non-responders (I think of this as a 'Hall of Shame')
  • the column widths for the username column and for each question column (if you leave these blank the browser will just do whatever it thinks makes sense, which usually looks pretty good)
In addition, for each of up to 8 questions, the admin specifies:
  • how the users will input the answer (small text blank, large text blank, text area, checkbox/radio buttons or drop down menu, and if checkbox/radio buttons or drop down menu the various possible selections for the user to pick from)
  • whether the responses for the question should be totalled and if so, how they should be totalled (by number of users responding, by the sum of the numbers the users put in their responses or by the total number of responses that match text the designer of the survey specifies)
  • the maximum number of users that can respond to a particular question before additional users are no longer asked that question
The survey can be something really simple like "who is coming to the charity event" or it can be something much more complex. For example, the survey could be about a large pot luck dinner where the questions basically divvy up responsiblity for who brings what...you could have yes/no questions like "I'll bring a meat course that feeds 10 people (maximum 3 families should bring this)" and "I'll bring dessert for 5 people (maximum 5 families should bring this)" and "I'll bring assorted vegetables for 15 people (maximum 4 families should bring this)"; once the maximum number of users have already said yes to one of those questions the remaining users will no longer be asked it. Or of course you could have the questions elicit textual responses so that you know exactly what each person is planning to bring.

When the survey is designed and posted, it appears at the head of the topic and each user in the groups that have been designated to take the survey will see a button labeled "Fill out Survey" that he can click. When he clicks that button, a new form opens up that asks him the questions (he inputs the questions in text blanks, radio buttons, drop downs, etc as specified by the designer of the survey).

If a user has already responded, the button he sees is not longer "Fill in Survey' but instead is "Change your answers', which allows the user to change his answers.

The survey is tabulated as people answer it so that everyone can see at a glance each user who has responded (assuming the designer does not choose to hide the responders) and what his answers are (and there are totals for any questions the survey specified to be totalled).
Anyway, here's a link to a zip file containng the mod:

[link deleted because this is now in the validated mod db here: http://www.phpbb.com/phpBB/viewtopic.php?t=278888 ]

I've included screenshots in a 'screeenshots' directory inside the 'contrib' folder so you can see what this looks like in action.

And I really think 'tabulated survey at topic head' doesn't properly describe what this is...any suggestions on the name would be most welcome.
Last edited by asinshesq on Fri Apr 22, 2005 9:21 am, edited 9 times in total.

Doe Ray Me
Registered User
Posts: 457
Joined: Mon Jun 16, 2003 5:25 am
Name: Ethan Shand

Post by Doe Ray Me »

Could i see a demo please

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

Doe Ray Me wrote: Could i see a demo please


I'm burned out from all that modding so it will be a few days, but I will get around to that in due course.

By the way, stupid question but what's the best way to get a good screen shot that I can upload? I know I can do a control-print screen to get the image on the clipboard, and I can certainly paste that into a word doc and then turn that into a pdf, but it doesn't look great. What's the best way to do this?

User avatar
mad-manne
Registered User
Posts: 776
Joined: Thu May 29, 2003 6:59 pm
Location: Marl, Germany

Post by mad-manne »

Hi asinshesq,
I'm also waiting for a demo :P But no need to hurry from my side, because I'm just curious to see your flavour of this special problem solved.
From your decription I can now better understand why my MOD wasn't right for you. Your features sound really interesting!

BTW: You ought to add a prefix according to the updated forum rules, and in your case it should be DEV, ALPHA or BETA.
(I hope this isn't already considered to be backseat-moderation :roll: )

Cheers,
Manfred.
Try not. Do or do not. There is no try. (YODA)

Thallium
Registered User
Posts: 395
Joined: Mon Aug 30, 2004 12:30 am
Contact:

Post by Thallium »

This mod looks incredible! 8O

One question before I dive into it though, which I couldn't immediately tell from looking over the code... Is there any way to restrict who may post surveys, or is it a case of whoever may post polls may also post surveys?

What I really need is to be able to restrict this to Mods or above, while allowing users to post their polls normally. If it can't be done then I may still have use for this, but it would be better if there was a seperate authorisation for it in the forum admin controls, I think.

Still, looks really good, and something that hasn't been done to death yet. Good job. :lol:

---Thallium
Complete phpBB powered websites, Mods/Hacks installed, unique templates, updates and repairs... reasonable. Email, PM or IM.

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

Thallium wrote: This mod looks incredible! 8O

One question before I dive into it though, which I couldn't immediately tell from looking over the code... Is there any way to restrict who may post surveys, or is it a case of whoever may post polls may also post surveys?

What I really need is to be able to restrict this to Mods or above, while allowing users to post their polls normally. If it can't be done then I may still have use for this, but it would be better if there was a seperate authorisation for it in the forum admin controls, I think.

Still, looks really good, and something that hasn't been done to death yet. Good job. :lol:

---Thallium


Posting is currently limited to admins. The posting authorization is contained in one line, an if statement the mod places into posting.php. Here is that if statement and a few lines above it so you can easily find it:

Code: Select all

// start mod tabulated survey at topic head...fill in survey template...(note, for future versions I may expand concept of who is authorized to create or edit polls)
//
// Survey entry switch/output
//

if( ( $mode == 'newtopic' || ( $post_data['first_post']) ) && $userdata['user_level'] == ADMIN )
Obviously you can change that line to pick up specific users or mods as well. At some point I may add code allowing the admin to specify when setting up or editing a group whether that group has a right to post a survey...that's an easy change (pretty much the same thing I did in my email posts or messages to combinations of groups mod). I imagine I will do that as an optional mod to the mod since that will require the board to do an extra DB search every time any user posts (checking to see if the user is in a group permitted to post surveys) and many people -- especially those with lots of users on their boards -- will not want the extra overhead that creates.

Let me know what you think once you've got things up and running.

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

mad-manne wrote: ...BTW: You ought to add a prefix according to the updated forum rules, and in your case it should be DEV, ALPHA or BETA....

You're right...done.

By the way, I don't plan on opening a demo on my board but I will post screen shots in due course. And I'll repeat what I asked above...what's the best way of capturing those on a windows machine and turning them into a jpg or pdf I can post? I know how to get them onto the clipboard and I can of course paste them into a word doc and convert that into a pdf, but I imagine there is some way to do this that is cleaner, no?

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

OK, I placed 6 jpg screenshots in the zip file showing what this mod looks like on a board. You can click the link in the first post to retrieve both the mod and those screenshots.

Keep in mind that I used a pretty complicated survey as a sample for the screenshots..most surveys will be much simpler (e.g. a single question like 'how many of your family and friends will be coming to graduation" with a simple total at the bottom).

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

OK, I already have a new version (version 1.0.2). The link in the first post now points to the newest version. If you already installed the earlier version I have included in the zip file an upgrade mod that shows all the changes from version 1.0.1 to 1.0.2.

Here's the change log explaining the changes:

Code: Select all

##   2005-2-28	- Version 1.0.2
##		  In the design survey form, added option to sort the tabulated results by first answer with secondary sort by username. 
##		  Also changed things so that anyone who is authorized to post a poll will be authorized to post a survey (but it's easy to change this 
##		  back so that only admins are authorized to post surveys if you want).
I want to thank mistakeprone for giving me the idea of sorting by answer (and suggesting a really easy way to do it). This type of sort can be very useful if you have a single question like "are you coming to the dinner" and you want to cleanly sort so that the people who select the answer 'yes' , 'no' or 'maybe' are each segregated in the final list.

Thallium
Registered User
Posts: 395
Joined: Mon Aug 30, 2004 12:30 am
Contact:

Post by Thallium »

Read this just in time, was about to install the old one. Will install the latest and let you know how it goes sometime in the next couple days. Thanks so much for updating this mod so quickly, I can tell it'll be a great addition to my sites. :lol:

---Thallium
Complete phpBB powered websites, Mods/Hacks installed, unique templates, updates and repairs... reasonable. Email, PM or IM.

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

No one has any thoughts on this? I'm getting ready to submit it to the mod gods, so if anyone has anything to suggest, please do so in the next few days.

Thanks.

khisanthax
Registered User
Posts: 443
Joined: Sun Mar 02, 2003 1:49 am

Post by khisanthax »

I've been dying for something like this, but why only seven questions? I would like to ask more than seven questions, this is indeed a very powerful tool.

User avatar
beggers
Registered User
Posts: 1257
Joined: Fri Nov 23, 2001 8:19 pm
Location: Las Vegas
Contact:

Post by beggers »

That's impressive! I haven't thought of a good application yet on my particular site, but it is very cool.

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

khisanthax wrote: I've been dying for something like this, but why only seven questions? I would like to ask more than seven questions, this is indeed a very powerful tool.


If you take a look at my screenshots (in the zip file), you'll see why I limit to seven questions. In order for this to make sense for what I was trying to do, I need to list responding users going down the page. And since the whole point is to have the questions fully tabulated for all to see, I need the questions to run accross the screen. So, fitting more than 7 questions plus usernames accross the screen is just not physically possilible...not enough room.

If I have more than 7 questions that need answering, I simply ask in more than one survey so that I continue to retain the simple tabulated look for each.

I could easily have set things up so that any number of questions are asked, and just had the questions and answers run down the screen rather than accross. Or I suppose I could have set things up so that if there were 7 or fewer questions it would display like it currently does but if there were more than 7 questions the display would divide up into 2 or more sets of tables, each with the responding users on the left and the answers on the right. But that would have defeated the purpose of having a nice single tabulated table where all questions and all answers of each and every respondent are organized. For my board, the point of the exercise is to get answers to questions like "who is coming to dinner and what are you bringing?" in a way so that I end up with a useful orgianized list, not to allow myself the ability to ask a ton of questions.

But if anyone wants to tweak this to show things one question at a time and get rid of the 7 questions limit, that would be quite easy (since it stores all questions in a single db field (separated by '|') and all answers in a single db field (again separated by '|')).

I suspect raise the legitimate concern about the 7 question limit is that the title of teh mod (tabulated 'survey' at topic head) is misleading. This is not really a survey, but I couldn't think of another way of describing it.

Anyway, has anyone actually installed this? I'm curious about whether people have any trouble. I've had mine up and running on my live board for a couple of weeks now and have run about 8 "surveys" since then and the only real trouble is that occassionally I get two responses from the same user when he incorrectly double clicks the submit button on the answer form. (The mod checks to see if a given user has already responded and if so he no longer has the answer to fill out the survey but instead is given the option to change his answers, so I presume that the couple of times when users have managed to get two answers in a survey it is the result of double clicking though I haven't been able to replicate that myself and it has only happened twice so far...I'll be looking into some anti-double post java script to fix that in due course.)

User avatar
mad-manne
Registered User
Posts: 776
Joined: Thu May 29, 2003 6:59 pm
Location: Marl, Germany

Post by mad-manne »

HI asinsheq,
have just taken a look at your screenshots ... looks pretty good.
And I finally understand, why my MOD isn't for you 8)

One thing comes to mind, though:
With all you said above I agree, and totally understand your point ... but are you sure, that all of your users have a screen-resolution of 1280 x 1024? I would still consider 1024 x 768 being "standard".

That's just because following your argumentation, it will be a pain in the a** to use your MOD, with "my" screen-resolution of 1024 x 768.

Just my 2 cents, and anyway good job :wink:
Manfred.
Try not. Do or do not. There is no try. (YODA)

Locked

Return to “[2.0.x] MODs in Development”