Seamlessy combine different multiple choice questions

Mehr
4 Jahre 2 Monate her #95498 von Limer2001
Limer2001 erstellte das Thema Seamlessy combine different multiple choice questions
I have a multiple choice question but the display of certain answers depends on token attributes. I don't think it's possible to hide certain answeringoptions based on tokens. So I rather make a multiple choice question with only one answering option. Hide the question text and minimize the bordering so in the end it looks like one multiple choice question.


So i added the following code. But it doesn't work.. And I also don't know how to delete the borders and make the different the multiple choice questions look like one question. Any thoughts on this?
<script type="text/javascript" charset="utf-8">
	$(document).ready(function() {
 
		var qID = {QID};
 
                $('#question'+qID+' .questiontext {display:none;}
 
}
</script>

Bitte Anmelden um der Konversation beizutretten.

Mehr
4 Jahre 2 Monate her #95500 von KRav
KRav antwortete auf das Thema: Seamlessy combine different multiple choice questions
Hi,
the first step to make this working is the right syntax :-)

-> $('#question'+qID+' .questiontext').hide();

I'm not sure if the selector is the right one (depends on your theme). You should use the right chained selector.
Further more, if you want to make a decision on a token you must have an "if" in your script.

To manipulate the borders, you have to use the css() command.

Cheers Kai


research on BLOGS - Professional LimeSurvey support
Consultant - Templates - Training - JQuery magic - Support - Coding - Survey creation and more..

Contact
Professional LimeSurvey support
Diese E-Mail-Adresse ist vor Spambots geschützt! Zur Anzeige muss JavaScript eingeschaltet sein!

Bitte Anmelden um der Konversation beizutretten.

Mehr
4 Jahre 2 Monate her #95502 von Limer2001
Limer2001 antwortete auf das Thema: Seamlessy combine different multiple choice questions
Thanks for your quick response!

I can find this in my customtemplate :

.questiontext {
font-family: arial, verdana, sans-serif;
font-size: 12px;
font-weight: bold;
}

But the code you suggested doesn't work.


Greets,

Michel

Bitte Anmelden um der Konversation beizutretten.

Mehr
4 Jahre 2 Monate her #95523 von KRav
KRav antwortete auf das Thema: Seamlessy combine different multiple choice questions
Hi michel,

as I said, the selector depends on your theme. Watch out for JS errors and chain step by step (maybe from child to parent) the selectors to have success.

Cheers Kai


research on BLOGS - Professional LimeSurvey support
Consultant - Templates - Training - JQuery magic - Support - Coding - Survey creation and more..

Contact
Professional LimeSurvey support
Diese E-Mail-Adresse ist vor Spambots geschützt! Zur Anzeige muss JavaScript eingeschaltet sein!

Bitte Anmelden um der Konversation beizutretten.

Mehr
4 Jahre 2 Monate her #95533 von Limer2001
Limer2001 antwortete auf das Thema: Seamlessy combine different multiple choice questions
I have to figure out what chain selection is first I think.

On another note, to get rid of the padding of the answer table I tried adding:

<script type="text/javascript" charset="utf-8"><br />
$(document).ready(function() {
$("answer").css("padding":"0em");
}
</script>



But it didnt work. Any suggestions? td class="answer"

Bitte Anmelden um der Konversation beizutretten.

Mehr
4 Jahre 2 Monate her #95545 von tpartner
tpartner antwortete auf das Thema: Seamlessy combine different multiple choice questions
You forgot a dot in front of "answer":
$(".answer").css("padding":"0");

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

Bitte Anmelden um der Konversation beizutretten.

Mehr
4 Jahre 2 Monate her #95548 von Limer2001
Limer2001 antwortete auf das Thema: Seamlessy combine different multiple choice questions
Hm still not working. :pinch:

Bitte Anmelden um der Konversation beizutretten.

Mehr
4 Jahre 2 Monate her #95549 von tpartner
tpartner antwortete auf das Thema: Seamlessy combine different multiple choice questions
Unfortunately it's difficult to debug without knowing your template structure. Can you activate a sample survey wit those questions for us to see?

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

Bitte Anmelden um der Konversation beizutretten.

Mehr
4 Jahre 2 Monate her #95553 von Limer2001
Limer2001 antwortete auf das Thema: Seamlessy combine different multiple choice questions
Here you go:
http://ima.nl/onderzoek1/index.php/594693/lang-nl

Thanks for your help so far!

Bitte Anmelden um der Konversation beizutretten.

Mehr
4 Jahre 2 Monate her #95559 von tpartner
tpartner antwortete auf das Thema: Seamlessy combine different multiple choice questions

Hm still not working.

You have a <br /> tag inside your script which is breaking it.

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

Bitte Anmelden um der Konversation beizutretten.

Mehr
4 Jahre 2 Monate her #95565 von Limer2001
Limer2001 antwortete auf das Thema: Seamlessy combine different multiple choice questions
Hm sloppy, removed it but still not working.

Bitte Anmelden um der Konversation beizutretten.

Mehr
4 Jahre 2 Monate her #95615 von tpartner
tpartner antwortete auf das Thema: Seamlessy combine different multiple choice questions
You have a syntax error.

This line:
$(".answer").css("padding":"0");

Should be:
$(".answer").css("padding", "0");

Or:
$(".answer").css({
	"padding":"0"
});

The CSS required to make those two questions appear as one is:
#question436 table td {
  height: auto;
}
 
#question436 table.scs {
  border-bottom: 0 none;
}
 
#question436 .survey-question-help {
  display: none;
}
 
#question436 .subquestions-list {
  margin: 0;
}
 
#question436 .answer {
  padding: 0;
}
 
#question437 table.scs {
  border-top: 0 none;
}
 
#question437 td.be {
 display: none;
}
 
#question437 .survey-question-help {
  display: none;
}
 
#question437 .subquestions-list {
  margin: 0;
}
 
#question437 .answer {
  padding: 0;
}

So, to translate that into JavaScript, add this to the first question:
<script type="text/javascript" charset="utf-8">
	$(document).ready(function() {
 
		$(#question{QID} table td).css({ // Table cell heights
			'height': 'auto'
		});
 
		$(#question{QID} table.scs).css({ // Table border
			'border-bottom': '0 none'
		});
 
		$(#question{QID} .survey-question-help).css({ // Question help
			'display': 'none'
		});
 
		$(#question{QID} .subquestions-list).css({ // Margin around answers
			'margin': '0'
		});
 
		$(#question{QID} .answer).css({ // Padding around answers
			'padding': '0'
		});
	});
</script>

And add this to the second question:
<script type="text/javascript" charset="utf-8">
	$(document).ready(function() {
 
		$(#question{QID} table td).css({ // Table cell heights
			'height': 'auto'
		});
 
		$(#question{QID} table.scs).css({ // Table border
			'border-top': '0 none'
		});
 
		$(#question{QID} td.be).parent().css({ // Question text
		 'display': 'none'
		});
 
		$(#question{QID} .survey-question-help).css({ // Question help
			'display': 'none'
		});
 
		$(#question{QID} .subquestions-list).css({ // Margin around answers
			'margin': '0'
		});
 
		$(#question{QID} .answer).css({ // Padding around answers
			'padding': '0'
		});
	});
</script>



Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Anhang:

Bitte Anmelden um der Konversation beizutretten.

Haben Sie schon bei unserer Kundenumfrage mitgemacht?

Verpassen Sie nicht Ihre Chance auf tolle Preise.

Klicken sie hier um teilzunehmen:

Jetzt starten

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten