Welcome, Guest
Username: Password: Remember me

TOPIC: Preselected Answers in dual Array Questions

Preselected Answers in dual Array Questions 2 years 6 months ago #73173

  • bluesky
  • bluesky's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 25
  • Karma: 0
Thx first of all for this great tool! This question is a copy of a question in the german forum, but the admin told me to post it here, to get some advise.

My Installation:
LimeSurvey Version + Build: Version 1.91+ Build 11804
Installation: Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1/MySQL-Client-Version: mysqlnd 5.0.8-dev - 20102224 - $Revision: 310735
Firefox 9.0.1

My Questions regarding to the atttached Survey for Project Selection of our NGO, targeting disabled in Vietnam.

1) I need to design the query in a way that each project is answered by each user. So one query should be saved for each user and each project. Of course I can simply have one query for each project instead of integrating this step in one survey (thats what I am planning to do right now, so if there is no solution within limesurvey to easily solve this, its fine with me. According to Mazi (German Forum) thats how it is ;)
What still would be very helpfull, if I just could check if there exits already a saved survey for the selected project, maybe this is easier and doable, so maybe any solution for this....


2) Most of my questions are Dual Array - dual scale, to enable comments. Additionally this questions are mandatory, but I would like to have the questions in the second array already preselected, meaning that in the design the option "no comment" is the default already entered, so it needs not to be selected by the user for each question. Is there a way to do this?

Thats it for now, the survey is attached. Thx for any help,

Dominik
Attachments:
cheers, Dominik
Last Edit: 2 years 6 months ago by bluesky.
The administrator has disabled public write access.

Re: Preselected Answers in dual Array Questions 2 years 6 months ago #73175

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4071
  • Thank you received: 748
  • Karma: 341
Regarding #2, you can use JavaScript to preselect the last option of the second scale of an dual-scale-array.

Do you want this behaviour for all dual-scale-arrays in the survey or only selected questions.

Do you use a custom template?
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: Preselected Answers in dual Array Questions 2 years 6 months ago #73176

  • bluesky
  • bluesky's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 25
  • Karma: 0
I would need it for all questions in the array, but I am not sure on using Java Script in Limesurvey. Right now I am using the basic template, I still have to work on a final template selection.
cheers, Dominik
Last Edit: 2 years 6 months ago by bluesky.
The administrator has disabled public write access.

Re: Preselected Answers in dual Array Questions 2 years 6 months ago #73178

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4071
  • Thank you received: 748
  • Karma: 341
To preselect the last option of the second scale of all dual-scale-arrays in the survey, add the following to your template.js file (you will need to copy a template for your survey):
$(document).ready(function() {
 
	preselectLast ();
 
	function preselectLast () {
 
		// Add some scale-specific classes to the answer cells
		$('.array-flexible-duel-scale tbody[id^="javatbd"] td').each(function(i){
			var scale = $(this).attr('class').substr(12,1);
			$(this).addClass('scale-'+scale);
		});
 
		// Preselect the last option of scale 2 (if nothing is already selected)
		$('.array-flexible-duel-scale tbody[id^="javatbd"]').each(function(i){
 
			if($('.scale-2 input.radio:checked', this).length == 0) {
				$('.scale-2 input.radio:last', this).attr('checked', true);
			}
		});
 
	}
 
});
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: Preselected Answers in dual Array Questions 2 years 6 months ago #73181

  • bluesky
  • bluesky's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 25
  • Karma: 0
Great, just implemented it and works... thx a lot, that makes the survey a lot more user-friendly.
cheers, Dominik
The administrator has disabled public write access.

Re: Preselected Answers in dual Array Questions 2 years 6 months ago #73209

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5302
  • Thank you received: 291
  • Karma: 247
you're welcome

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.
Moderators: ITEd
Time to create page: 0.135 seconds
Donation Image