Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making AspMailer calculate user input?

Status
Not open for further replies.

jaslr

Programmer
Aug 16, 2001
67
AU
At the moment, I am using AspMailer.asp to do the following.

User goes to survey.asp, they fill it out and hit "submit" the results are parsed through aspmailer.com and then emailed to helpdesk@work.com and then the Helpdesk staff manually sift through the results.

The issue is that the help desk survey they've made have there questions written like so, so some automatic calculation could save a lot of work:

It's a survey and every question has the same set of answers varying from: very pleased to not pleased at all, like so:

1) Are you satisfied with the Help Desk?

a) Absolutely
b) Most of the Time
c) Not Really
d) No way, they're absurd.

...

And every question is like that, so the results come through on email like so.

Name: John Doe
Dept: Accounting
1: Absolutely
2. Not Really
3. Most of the Time
.
.
20. Absolutely

How can I have another .asp that calculates EVERY submission give me a page that looks like this.


_____

Question 1.
a: 15% of people Chose "Absolutely"
b: 35% of people Chose "Most of the Time"
c: 30$ of people Chose "Not Really"
d: 20% of people Chose "No way, they're absurd."

.
.
.
.
.
Question 20.
a: 35% "Chose Absolutely"
b: 15% "Chose Most of the Time"
c: s0$ "Chost Not Really"
d: 30% "No way, they're absurd."





___

Presently my aspmailer.asp (where the results are sent, seperated and emailed from) looks like this:



At the moment, I am using AspMailer.asp to do the following.

User goes to survey.asp, they fill it out and hit "submit" the results are parsed through aspmailer.com and then emailed to helpdesk@work.com and then the Helpdesk staff manually sift through the results.

The issue is that the help desk survey they've made have there questions written like so, so some automatic calculation could save a lot of work:

It's a survey and every question has the same set of answers varying from: very pleased to not pleased at all, like so:

1) Are you satisfied with the Help Desk?

a) Absolutely
b) Most of the Time
c) Not Really
d) No way, they're absurd.

...

And every question is like that, so the results come through on email like so.

Name: John Doe
Dept: Accounting
1: Absolutely
2. Not Really
3. Most of the Time
.
.
20. Absolutely

How can I have another .asp that calculates EVERY submission give me a page that looks like this.


_____

Question 1.
a: 15% of people Chose "Absolutely"
b: 35% of people Chose "Most of the Time"
c: 30$ of people Chose "Not Really"
d: 20% of people Chose "No way, they're absurd."

.
.
.
.
.
Question 20.
a: 35% "Chose Absolutely"
b: 15% "Chose Most of the Time"
c: s0$ "Chost Not Really"
d: 30% "No way, they're absurd."





___

Presently my aspmailer.asp (where the results are sent, seperated and emailed from) looks like this:



<%
DIM strEmail, strFirstName, strLastName, strSubject, strComments, Mail
strName = request.form("Name")
strPaycode = request.form("Paycode")
strComments = request.form("Comments")
strDept = request.form("Department")
strTally = request.form("Score")
strTotal = request.form("Total")
strQuizno = request.form("Quizno")
strEmail ="Online_Help_Desk_Survey@hotmail.com"
strQ1 = request.form("Q1")
strQ2 = request.form("Q2")
strQ3 = request.form("Q3")
strQ4 = request.form("Q4")
strQ5 = request.form("Q5")
strQ6 = request.form("Q6")
strQ7 = request.form("Q7")
strQ8 = request.form("Q8")
strQ9 = request.form("Q9")
strQ10 = request.form("Q10")
strQ11 = request.form("Q11")
strQ12 = request.form("Q12")
strQ13 = request.form("Q13")


DIM strMsgHeader
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = "femail"
Mail.From = strEmail
Mail.AddAddress "helpdesk@work.com"
Mail.AddCC ""
Mail.Subject = "Online Help Desk Survey"
strMsgHeader = "This Email has been sent via the Intranet Help Desk Survey"
Mail.Body = strMsgHeader & vbCrLf & _
"Name: " & strName & vbCrLf & _
"Paycode: " & strPaycode & vbCrLf & vbCrLf & _
"Department: " & strDept & vbCrLf & vbCrLf & _
"Quiz Number: " & strQuizno & vbCrLf & vbCrLf & _
"Tally: " & strTally & vbCrLf & vbCrLf & _
"Out of: " & strTotal & vbCrLf & vbCrLf & _
"Question 1: " & strQ1 & vbCrLf & vbCrLf & _
"Question 2: " & strQ2 & vbCrLf & vbCrLf & _
"Question 3: " & strQ3 & vbCrLf & vbCrLf & _
"Question 4: " & strQ4 & vbCrLf & vbCrLf & _
"Question 5: " & strQ5 & vbCrLf & vbCrLf & _
"Question 6: " & strQ6 & vbCrLf & vbCrLf & _
"Question 7: " & strQ7 & vbCrLf & vbCrLf & _
"Question 8: " & strQ8 & vbCrLf & vbCrLf & _
"Question 9: " & strQ9 & vbCrLf & vbCrLf & _
"Question 10: " & strQ10 & vbCrLf & vbCrLf & _
"Question 11: " & strQ11 & vbCrLf & vbCrLf & _
"Question 12: " & strQ12 & vbCrLf & vbCrLf & _
"Question 13: " & strQ13
On Error Resume Next
Mail.Send
Set Mail = Nothing
IF Err <> 0 THEN
Response.Write "There has been an error and your message could not be sent through email. " & Err.Description
END IF
%>

<P>
<%
Response.Write "<meta HTTP-EQUIV='refresh' content='8;URL=http://www.home.com/'>"
Response.Write "Thank You " & strName & ",<br>"
Response.Write "Your message has been successfully sent to Help Desk for Marking." & "<br>"
Response.Write "You will be redirected back to the Intranet Home Page Shortly."
%>,</P>

____


This way seems to be working for us, but it means we have to manually read through each email and accumulate what answers they choose. We need them to be automatically tallied! So we can see what percentage of people chose each answer.

Would LOVE any help on this matter!

P.S. I really hope I was articulate enough in explaning: Where I am, Where I want to be - with this problem.
 
why don't your create an access database and update it when the user submits a survey?
 
ok, do you mean parse/submit the email to a database OR setup a database so that when the user presses "submit" the results are sent to a database and from there can be collated when the survey ends?

If so, that's a little harder than I initially thought and my timeframe may not allow the learning of how to do that. :(
 
I think what briancostea means is that in order to calculate the average responses across serveys you need to keep a running total of all responses... and that an access database is one easy way to do that.

So the first time someone fills out the survey, they choose "Absolutely" and the responses are stored in the database.... the grand total looks like this:
a: 100% of people Chose "Absolutely"
b: 0% of people Chose "Most of the Time"
c: 0% of people Chose "Not Really"
d: 0% of people Chose "No way, they're absurd."


The next guy fills out the survey and he chooses "Most of the time" so now your grand total looks like this:
a: 50% of people Chose "Absolutely"
b: 50% of people Chose "Most of the Time"
c: 0% of people Chose "Not Really"
d: 0% of people Chose "No way, they're absurd."


A third guy chooses "Not Really" so you have:
a: 33% of people Chose "Absolutely"
b: 33% of people Chose "Most of the Time"
c: 33% of people Chose "Not Really"
d: 0% of people Chose "No way, they're absurd."


The fourth guy also picks "Most of the Time":
a: 25% of people Chose "Absolutely"
b: 50% of people Chose "Most of the Time"
c: 25% of people Chose "Not Really"
d: 0% of people Chose "No way, they're absurd."



So you need some sort of tally to calculate these things.

 
you're right...

This seem like a hard task to do? Or something that is quite plausible to do in a few hours?

Would LOVE a tutorial link that tackles this specific problem.

Thank you both for your replies.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top