Check out the LimeSurvey source code on GitHub!

prevent printing of the answer code

More
5 years 4 months ago #66459 by jferring
Hello,

My participants have to print and/or export to pdf their answers at the end of the survey.

Unfortunately, I do not want them to know the answer code of the questions.

How do I prevent the showing/printing of the answer codes? Unfortunately I didn't find anything in the forum nor in the user manual.

I know that you can make a new template and use the {INSERTANS} feature, but I didn't find a field to insert automatically the text of the question. Is this possible?

Thank you for your help.

Please Log in to join the conversation.

More
5 years 4 months ago - 5 years 4 months ago #66498 by DenisChenu
Hello,

In printanswer.php, line 232, remove {$fname[0]} {$fname[1]} .

And put an idea in Feature requests :)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
Last Edit: 5 years 4 months ago by DenisChenu. Reason: With the link

Please Log in to join the conversation.

More
5 years 4 months ago #66602 by jferring
Hello,

This is line 232:

$printoutput .= "\t<tr class='printanswersquestion'><td>{$fname[0]} {$fname[1]}</td><td class='printanswersanswertext'>{$fname[2]}</td></tr>";

I tried several possibilities, but the answer code only disapeared when the whole answer disapeared, but I want to keep the regular text of the answer.

Please Log in to join the conversation.

More
5 years 4 months ago #66604 by DenisChenu
Oups,
i trye with Version 1.91+ Build 11026 and don't have the code,

What is your version ?

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).

Please Log in to join the conversation.

More
5 years 4 months ago - 5 years 4 months ago #66608 by jferring
Hi,

the latest version,

Version 1.91+ Build 11026
Last Edit: 5 years 4 months ago by jferring.

Please Log in to join the conversation.

More
5 years 4 months ago - 5 years 4 months ago #66609 by Ben_V
What you can do even it is not very W3C compliant :lol: :
1) Edit all your answer options ending it with something like:
<span class="nocode">
(it doesn't matter if this tag couldn't be closed, because the </td> will 'de facto' close all other tags included in the column)

2) Add to your template CSS files the rule:
.nocode{display:none}
or maybe better edit your printanswers.pstpl file
adding at the beginning:
<style type="text/css" media="all">
<!-- 
.nocode{display:none}
-->
</style>
The problem is if you have a lot of answer options....

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Attachments:
Last Edit: 5 years 4 months ago by Ben_V.

Please Log in to join the conversation.

More
5 years 4 months ago #66613 by Mazi

jferring wrote: I tried several possibilities, but the answer code only disapeared when the whole answer disapeared, but I want to keep the regular text of the answer.

Did you try to just remove the "$fname[1]" part?


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

More
5 years 4 months ago - 5 years 4 months ago #66618 by jferring
Hello,

I took out this {$fname[1]} and it did not work.
Last Edit: 5 years 4 months ago by jferring.

Please Log in to join the conversation.

More
5 years 4 months ago #66624 by jferring
Benitov's solution works, but I think that there should be a more elegant way to resolve this problem.

Please Log in to join the conversation.

More
5 years 4 months ago #66633 by Ben_V
I'm pretty sure (no risk at all...)
1) that such elegant solution is already included into LS 1.92 ...
2) you will get soon all related links to the dev branch ;)
Benoît

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)

Please Log in to join the conversation.

More
5 years 4 months ago #66634 by jferring
can't wait.... :cheer:

Merci Benoît

Please Log in to join the conversation.

More
5 years 4 months ago #66637 by Mazi
I had a look at the code and the problem is that you'd have to modify a core function ("aGetFullResponseTable()") to get rid of the values in [] brackets.
One solution might be to search for the first "[" in the string and then get the substring from 0 to the first occurrence of that char. It stil has to be coded though...


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

More
5 years 4 months ago #67310 by jferring
Hi,

it's not the answer option which should be hidden when printing, but the answer code.

Your non-wc3 solution works also on the answer code.

Thanks.

Please Log in to join the conversation.

More
5 years 4 months ago #67324 by Mazi
You're welcome!

If our hints have been helpful and you enjoy limesurvey please consider a donation to the team .
We do all this in our free time and you don't have to pay a penny for this software.

Without your help we can't keep this project alive.


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

More
4 years 11 months ago #77105 by sequoia
Just some input with my experience using Benitov's workaround using the span style solution, either be 'none' or the CSS 'nocode'.

Working with 1.92+, and noticing also back when using 1.91+ it does work with one exception. If using the IE browser the first answer appears after the question, and all following answer options to that question will be non-viewable. That is, they won't be there, just the first answer. Now that same survey in a Firefox or Chrome browser, no issue at all.

Basically in an IE browser you have a question, with one answer (the first listed) to choose from.

There was comments here of a resolution to this in version 1.92+. Does anyone know if that happened? If so where could I make adjustments to those settings :)

Thanks in advance for any input on this.

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form