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

TOPIC: Display assessment results before end of survey

Display assessment results before end of survey 2 years 11 months ago #69714

  • Jannet
  • Jannet's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 25
  • Karma: 0
I created a survey where companies can check the state of their HR performance. At the end of the survey they get a green, orange or red traffic light, symbolizing the over-all state. If they want to know more, we can make a detailed report based on their scores.
As it is now they get the result only after they fill out their contact information, as LS only lets you put in the Assessments results at the end of the survey. I have to let participants give their contact information before I can display the results of the assessment. However, I would like to display the assessment results first, and then give participants the option to fill out their contact information and save their survey.
Can I do this? Searching in the forum I suppose I could do this using javascript, but as I am not very familiar with JS, could someone explain this to me?

Oh, I am using LS 1.91
Last Edit: 2 years 11 months ago by Jannet.
The administrator has disabled public write access.

Re: Display assessment results before end of survey 2 years 11 months ago #69717

  • Ben_V
  • Ben_V's Avatar
  • OFFLINE
  • Platinum Lime
  • Posts: 1122
  • Thank you received: 255
  • Karma: 79
If you just want to display the points value, no need of js.

Just put the {assessment_CURRENT_TOTAL} placeholder in the source of a question or groupdescription...

If It's really an asssessment (using words) you need javascript
Benoît

goo.gl/Bw5iM => Recherche GG dans le forum français (remplacer "exemple" dans la barre de recherche)
goo.gl/WX8PH => GG search for english forum (Replace "example" in the search bar)
goo.gl/IxiGu => Búsqueda en el foro en español (Cambiar "ejemplo" en la barra de...
Last Edit: 2 years 11 months ago by Ben_V.
The administrator has disabled public write access.

Re: Display assessment results before end of survey 2 years 11 months ago #69738

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5333
  • Thank you received: 296
  • Karma: 249
Another alternative might be to ask for the contact information at a second survey and offer a link at the end of survey 1 to that second survey.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: Display assessment results before end of survey 2 years 11 months ago #69750

  • Jannet
  • Jannet's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 25
  • Karma: 0
@Benitov Thanks for your answer. If I want to use JS, can I put that in the same way, so in a groupdescription or source of a question?

@Mazi. I had been thinking about that too. The survey is anonymous, though, so how do I know which results in survey 1 belong to the contact information in survey 2?
The administrator has disabled public write access.

Re: Display assessment results before end of survey 2 years 11 months ago #69756

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4281
  • Thank you received: 807
  • Karma: 370
If I want to use JS, can I put that in the same way, so in a groupdescription or source of a question?
The JavaScript can be placed in the source of either - it just needs to be in an element that appears on the page. I prefer to put it in the group description or the help section of a question so it doesn't show in results.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: Display assessment results before end of survey 2 years 11 months ago #69757

  • Jannet
  • Jannet's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 25
  • Karma: 0
The group description seems to be right place for this one. Thanks.

@Mazi: still also interested in the way to do it with a second survey for the contact information.
Last Edit: 2 years 11 months ago by Jannet.
The administrator has disabled public write access.

Re: Display assessment results before end of survey 2 years 11 months ago #69760

  • Ben_V
  • Ben_V's Avatar
  • OFFLINE
  • Platinum Lime
  • Posts: 1122
  • Thank you received: 255
  • Karma: 79
If you want to show an assessmt. somewhere in your survey note that (in my opinion) you can't use LS original assessmt. functions for that.

So you have to work (quit hard) with js.
If your assessmt. structure is not too complicated, you can:

1) Create a group with just this hidden question (Q_score) and prefilled it with {assessment_CURRENT_TOTAL} placeholder
something like:
jQuery(document).ready(function() { 
	document.getElementById('answer1234X111X001').value = "{assessment_CURRENT_TOTAL}";
 	document.getElementById('display001').style.display= "none"; 
	document.getElementById('answer1234X111X001').style.display= "none";
 }
);

2) Create a 2nd group with just this hidden question (Q_assess) and set it with some js to prefilled it depending on the value of Q_score..
for my example I use a button radio question with the answers (=assessmt. messages) set as:

Q_assess.gif


..and the js is something like:
	$(document).ready(function() {
 
		var prev_ans = '{INSERTANS:answer1234X111X001}'; 
 
// Prefilled the assessmt messages
 
		if(prev_ans <= 0) {
 
			$('#answer1234X112X001black').attr('checked', true);  //= it's black
 
		}
 
 
 
		if((prev_ans > 0)&&(prev_ans < 5)) {
 
			$('#answer1234X112X001red').attr('checked', true);  //= it's red
 
		}
 
		if((prev_ans >= 5)&&(prev_ans < 100)) {
 
			$('#answer1234X112X001white').attr('checked', true);  //= it's white
 
		}
 
	});
 
3) to show the response of Q_assess as your assessmt. using its SGQA code

Obviously, set the display of the survey by groups and emule the submit button
jQuery(document).ready(function($) 
{
document.limesurvey.submit();
});
Benoît

goo.gl/Bw5iM => Recherche GG dans le forum français (remplacer "exemple" dans la barre de recherche)
goo.gl/WX8PH => GG search for english forum (Replace "example" in the search bar)
goo.gl/IxiGu => Búsqueda en el foro en español (Cambiar "ejemplo" en la barra de...
Last Edit: 2 years 11 months ago by Ben_V.
The administrator has disabled public write access.

Re: Display assessment results before end of survey 2 years 11 months ago #69761

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5333
  • Thank you received: 296
  • Karma: 249
Jannet wrote:
The group description seems to be right place for this one. Thanks.

@Mazi: still also interested in the way to do it with a second survey for the contact information.
It is a little tricky if your survey is anonymous. One solution is to use a hidden text question at survey A which is populated by a random number. The "answer" to this text question can be forwarded to survey B where it can be used to prefill another hidden text question from URL (see end URL: docs.limesurvey.org/Creating+a+new+surve...ation_amp_navigation).

Another alternative is to pass the data set ID to survey B by adding "...&userid={SAVEDID} to the end URL. This value can then be written into a hidden question as well by adjusting this URL e.g. ...&12345X22X333={SAVEDID}. You then know which data set of survey A belongs to a data set of survey B. That information is available at data export and you can merge results e.g. using Excel.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: Display assessment results before end of survey 2 years 11 months ago #69770

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4281
  • Thank you received: 807
  • Karma: 370
I think you can do this in one survey by adding one group.

1) Add a group before your contact info group with a single short-text question.

2) Add something like this as the source code of the short-text question:
<p class="msgRed assmtMsg">
	This is the "Red" assesssment message.
</p>
<p class="msgOrange assmtMsg">
	This is the "Orange" assesssment message.
</p>
<p class="msgGreen assmtMsg">
	This is the "Green" assesssment message.
</p>

3) Add the following script to the source code of the short-text question (modify the assesssment values as necessary). The script will:
- Hide the answer element of the short-text
- Load the current assesssment into the short-text (so you have it in the data)
- Show the appropriate assesssment message
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function() {
 
		// Hide all messages	
		$('.assmtMsg').hide();
 
		// Get the assesssment value
		var assmt = '{ASSESSMENT_CURRENT_TOTAL}';
 
		// Hide the question answer element (NOTE: this selector is for the default template)	
		$('.text-short td.answer').parent().hide();
 
		// Load the assesssment into the short-text	
		$('.text-short input.text').val(assmt);
 
		// Show the appropriate message
		if(assmt == 0) {
			$('.msgRed').show();
		}
		else if(assmt > 0 && assmt < 50) {
			$('.msgOrange').show();
		}
		else {
			$('.msgGreen').show();
		}
 
	});
</script>
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Last Edit: 2 years 11 months ago by tpartner.
The administrator has disabled public write access.
The following user(s) said Thank You: Jannet

Re: Display assessment results before end of survey 2 years 11 months ago #69773

  • Jannet
  • Jannet's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 25
  • Karma: 0
Thank you all for your contributions. Now I have several ways to work on this. With the step-by-step instructions and the code that tpartner sent, I should be able to do it.
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.295 seconds
Donation Image