Help - Search - Members - Calendar
Full Version: Username associated with text feedback
Big Red Spark Forums > Big Red Spark.com Forums > Unit Command Climate Assessment and Survey System (UCCASS)
Cyber Sapp
Can you associate a username with a feedback block? How can you tie in the feedback from a completed survey which has a text block for feedback?

JHolmes763
You can't. The surveys and the system is designed to by anonymous. You'd have to hack something into the code to save an extra value at the end of the survey in order to relate the two.
lorenzo vigentini
if the participants don't mind, just add a text field for them to put their username in smile.gif

QUOTE(Cyber Sapp @ Jul 5 2007, 12:21 AM) *

Can you associate a username with a feedback block? How can you tie in the feedback from a completed survey which has a text block for feedback?

sysanalyst
I've found a way to add UID to each answer, text or other. If it is okay with Mr. Holmes, I'll share that "code hack" with you, but I think this software was designed to keep results anonymous, so I'm not so sure he will approve. I must say, this is a very nice survey design package, and has basically saved me weeks of work (and/or heaps of money). Perhaps if you contribute to Mr. Holmes PayPal account, he may approve the necessary hack?
JHolmes763
I don't mind you posting the hack. No approval is necessary by me - it's your code.
sysanalyst
QUOTE(JHolmes763 @ Sep 21 2007, 07:44 PM) *

I don't mind you posting the hack. No approval is necessary by me - it's your code.

That said...
A couple of database changes;
table name RESULTS_TEXT add column uid (INT11) and index it
table name RESULTS add column uid (INT11) and index it

The rest of this may look a little messy, but it is the diff output from the changes to editsurvey.class.php:
# diff survey.class.php.backup survey.class.php
780c780,783
< $results_text[] = "($rid,$id,{$survey['sid']},{$r['qid']},$answer,$now)";
---
>
> $uid = $_SESSION['priv'][$survey['sid']]['uid'];
>
> $results_text[] = "($rid,$id,{$survey['sid']},{$r['qid']},$answer,$now,$uid)";
793c796,798
< $results[] = "($rid,$id,{$survey['sid']},{$r['qid']},$a,$now)";
---
> $uid = $_SESSION['priv'][$survey['sid']]['uid'];
>
> $results[] = "($rid,$id,{$survey['sid']},{$r['qid']},$a,$now,$uid)";
804c809,811
< $results[] = "($rid,$id,{$survey['sid']},{$r['qid']},$answer,$now)";
---
> $uid = $_SESSION['priv'][$survey['sid']]['uid'];
>
> $results[] = "($rid,$id,{$survey['sid']},{$r['qid']},$answer,$now,$uid)";
816c823
< $rs = $this->db->Execute("INSERT INTO {$this->CONF['db_tbl_prefix']}results_text (rid,
sequence, sid, qid, answer, entered) VALUES $t_string");
---
> $rs = $this->db->Execute("INSERT INTO {$this->CONF['db_tbl_prefix']}results_text (rid, sequence, sid, qid, answer, entered, uid) VALUES $t_string");
824c831
< $rs = $this->db->Execute("INSERT INTO {$this->CONF['db_tbl_prefix']}results (rid, sequence, sid, qid, avid, entered) VALUES $r_string");
---
> $rs = $this->db->Execute("INSERT INTO {$this->CONF['db_tbl_prefix']}results (rid, sequence, sid, qid, avid, entered, uid) VALUES $r_string");

(the funny numbers in front of the changed lines are the byte offset from the beginning of the file to the noted change, and the second number is the line offset from the beginning of the file).

These changes are implemented on an HP-UX system (HP-UX 11i), running PHP 5.2, MySQL 5.0.45, and Apache 2.0.58.

The idea behind the hack, is to add the uid values to the results tables per question. Let me know if you find any issues with this hack, we've used it for a couple of surveys thus far (and have told our participants up front that their user information would be tracked) and we are using the results as a training course inventory. At some point, I'd like to parameterize the anonymity so a flag could be set to either capture UID or not.

Johns work on this project is absolutely phenomenal. His reasons for implementing anonymity are very sound and absolutely necessary if you expect trust from your participants, and expect honest and unadulterated feedback. Please don't implement these changes and begin to ask for support on them; they are a one off hack to accomplish a very specific task. Nuff said.



Almost forgot.... please contribute to Mr. Holmes PayPal account, he does spend a lot of time on this very worthwhile project.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.