Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: custom URL with SurveyID, ResponseID and some token?

custom URL with SurveyID, ResponseID and some token? 2 years 8 months ago #74632

  • tacman1123
  • tacman1123's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 125
  • Karma: 1
When a survey is complete, I'd like to go to a custom URL that includes key information like the survey ID and respond ID, as well as maybe some sort of token for security.

For example, let's say the survey asks some health questions, and depending on the responses the last page want to offer some suggestions for further research. My idea is to go to a page with the security id and response id, look up the data with my own database routines, and then give a customized response.

I know you can set a custom URL to jump to after the survey, but how do you add things like the response id?

Thx,

Tac
The administrator has disabled public write access.

Re: custom URL with SurveyID, ResponseID and some token? 2 years 8 months ago #74634

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 82
  • Karma: 36
tacman1123-

Depending upon the complexity of the customized health questions, you can use EM-based relevance and tailoring to generate personalized messages rather than needing to do you own database routines. I do that all the time for mental health related diagnostic surveys that provide tailored treatment recommendations.

Basically, as long as you can compute what you want to say based upon the responses you have, you can take this approach. If you need to compare responses to population statistics, or use more complicated algorithms, you can't currently do that within LimeSurvey. However, EM is designed to be easily extensible, so that you could do an AJAX or custom call to an external routine, passing it variables from your survey.

/Tom
The administrator has disabled public write access.

Re: custom URL with SurveyID, ResponseID and some token? 2 years 8 months ago #74635

  • tacman1123
  • tacman1123's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 125
  • Karma: 1
Thanks, Tom. Where would that be done? In the "Print Results" template? Or ...?

Do you have any online examples of what you've done? Have you done this in conjunction with Assessments? I coded up the standardized depression test once to test that, but forget how the output was handled.

I'm pretty sure EM would work, I think it's just a series of AND's and OR's in sequence to figure out what the user needs to know.

Tac
The administrator has disabled public write access.

Re: custom URL with SurveyID, ResponseID and some token? 2 years 8 months ago #74637

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 82
  • Karma: 36
tacman-

I have some examples in a different survey platform, but the EM syntax is similar. I've done things as complicated as the entire SCID (structured combined interview for DSM-IV), and 3 hour epidemiological interviews; plus simpler things like many of the regular depression scales, plus some ones I helped develop for seasonal affective disorder. So, EM should work for your needs.

/Tom
The administrator has disabled public write access.

Re: custom URL with SurveyID, ResponseID and some token? 2 years 8 months ago #74638

  • tacman1123
  • tacman1123's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 125
  • Karma: 1
What file do you edit to produce that outcome? If it's the template file, then you'd have to have a different template for each survey, right? So is there another place to edit, using EM, to create a custom output page?
The administrator has disabled public write access.

Re: custom URL with SurveyID, ResponseID and some token? 2 years 8 months ago #74639

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 82
  • Karma: 36
Tac-

You don't need to edit your templates. Rather, all of the tailoring is done within questions or groups of questions.

See some of the examples here. Also, try loading the ls2_*.lss sample surveys in /docs/demosurveys.

If you have lots of different messages, only some of which should appear, you can either:
(a) create separate text display questions for each, and use relevance to control which appear.
(b) create separate equations for each, also using relevance, so that only the relevant ones will generate the messages you want; then use a text display question and the list() function to create a paragraph (or list) of the messages you want to convey to the user.

You can also use the if() function to conditionally tailor individual questions. You can do nested if() statements, but if the nesting gets deep, it gets hard to read, so it is often easier to create several hidden equation questions and then process them as described above.

The main documentation for EM is here.

/Tom
The administrator has disabled public write access.

Re: custom URL with SurveyID, ResponseID and some token? 2 years 8 months ago #74640

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 82
  • Karma: 36
Tac-

One more note. I tend to create tailored messages near the the end of the survey, and insert a print button so that they can print out that page.

The tailoring is also done on the print your answers page, so that is another option.

The only risk I've found with letting people print out reports before the end of the survey is that some don't click the final submit button; so when I'm assessing responses rates, I base completion on whether they get to the report page.

/Tom
The administrator has disabled public write access.

Re: custom URL with SurveyID, ResponseID and some token? 2 years 8 months ago #74642

  • tacman1123
  • tacman1123's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 125
  • Karma: 1
I see -- so the final "report" is really a section and hidden questions, got it.

On the wish list -- in the same way emails can be customized on the survey level, it would be nice to have a final page that was defined with the survey, using Expression Manager.

Thanks for your suggestions on how to solve this.

Tac
The administrator has disabled public write access.

Re: custom URL with SurveyID, ResponseID and some token? 2 years 8 months ago #74644

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 82
  • Karma: 36
Tac-

It should not be hard to add an email() function. I've resisted a bit since we try to have functions that work for both PHP and JavaScript.

However, if an email() function is added, then you can use EM to tailor the message you want to send to the subject and then use the email() function to send it do them.

/Tom
The administrator has disabled public write access.

Re: custom URL with SurveyID, ResponseID and some token? 2 years 8 months ago #74645

  • tacman1123
  • tacman1123's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 125
  • Karma: 1
Actually, I wasn't suggesting an email (although in fact I would like one), I was saying that I'd like a "Final Page" option in the General Survey settings that can be used instead of the default Final Report. That way, both Assessments and EM logic could be presented into a single page.

The reason I'd like it separated is that otherwise to see the "final report" you have to go into the survey and take it, but something someone might want to click on a link and see "See My Results", without having the option of changing them.

Having it in General Settings would be more flexible than in a template.

Tac
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.120 seconds
Donation Image