Email a survey

For general questions about Content Authoring

Moderator: Nav

Email a survey

Postby keisan » Wed Sep 26, 2012 7:20 am

We want to create a survey that a student will complete at the end of the course. We then want to email the results of the survey.

I am thinking that I can create a general survey that we can use for every course and make it a template. I have used the email object but am having trouble figuring out how to get the survey information into an email that they will then send. Suggestions anyone?
keisan
 
Posts: 12
Joined: Thu Apr 26, 2012 7:02 am

Re: Email a survey

Postby Nav » Wed Sep 26, 2012 3:38 pm

Hi,
So the way that the email object works is that it launches the learner's default email client and it populates fields in the email so that it can be sent from them. SmartBuilder by itself can't send emails, though it could pass the info to a server-side script that would be able to tell the server to send the email, cutting out dependence on the learner. But that requires some IT knowhow. Anyway, I just want you to be aware of this.

That being said, you should just be able to use the Email Object > setBody method to push whatever you want. You can try just creating a simple test and hard coding a word like "this is body text" to try it out. The hardest part should be collecting the survey data all in a Text Variable (we'll call it "surveyResultsVar". You'll be using the append and appendOnNewLine methods a whole bunch to collect all your data in the Variable. I highly recommend that you test this out and display the info in a text object so you can make sure it looks like you expect it to before trying to get the Email object involved.

Once you've got that, then you can just use Email Object > setBody > Function > Variables > Text > surveyResultsVar > getValue

Let me know if that helps, or if you need further clarification on anything.

- Nav
Nav
 
Posts: 866
Joined: Mon Nov 05, 2007 2:58 pm

Re: Email a survey

Postby keisan » Thu Oct 04, 2012 10:12 am

Nav,
I have gotten this to work but am having some trouble appending the selected answer value into the email without it looking like code. Below is what I am seeing in the email:

The course met my expections $SB3:array([1])
The course met the stated objectives and goals.$SB3:array([1])

The text is displaying correctly but the answer value ($SB3:array([1])) is not. Is this enough information for you to tell me what I am doing wrong?

Thanks,
Kathy
keisan
 
Posts: 12
Joined: Thu Apr 26, 2012 7:02 am

Re: Email a survey

Postby Nav » Thu Oct 04, 2012 12:32 pm

Hi Kathy,
What object are you using? A checkbox object? What method are you using to get that data from said object? getSelection?

I wouldn't use a CheckBox object, I'd use a RadioButton. If you're asking questions like "The course met my expectations", you don't want them to mark several answer choices.

Here's a quick breakdown of the differences - CheckBox and RadioButton Groups are almost identical.
CheckBox Groups can have 0, 1, or more selected choices.
RadioButton Groups typically have one and only one choice selected (but if you don't select anything, they might have none selected).

You can learn more about them here (there's a neat little video) - http://help.smartbuilder.com/node/157

There is no way to get a clean getSelection out of the CheckBox object (because it is most often used to store and retrieve data, and it need to be in this format).

So. I'd change the type of object that you're using. Use radio buttons. And then you can use getSelectedIndex, and it will provide you with a nice simple number.

If you later decide you do need CheckBoxes, um, that will be a little more work. Basically you have to start looking at if individual options have been selected. It's possible, but ...well, we'll cross that bridge if we get to it.

- Nav
Nav
 
Posts: 866
Joined: Mon Nov 05, 2007 2:58 pm


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Not able to open ./cache/data_global.php