Welcome, Guest
Username: Password: Remember me

TOPIC: prevent printing of the answer code

prevent printing of the answer code 4 years 4 months ago #66459

  • jferring
  • jferring's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 7
  • Karma: 0
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.
The administrator has disabled public write access.

prevent printing of the answer code 4 years 4 months ago #66498

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 8195
  • Thank you received: 1119
  • Karma: 331
Hello,

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

And put an idea in Feature requests :)
Last Edit: 4 years 4 months ago by DenisChenu. Reason: With the link
The administrator has disabled public write access.

prevent printing of the answer code 4 years 4 months ago #66602

  • jferring
  • jferring's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 7
  • Karma: 0
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.
The administrator has disabled public write access.

prevent printing of the answer code 4 years 4 months ago #66604

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 8195
  • Thank you received: 1119
  • Karma: 331
Oups,
i trye with Version 1.91+ Build 11026 and don't have the code,

What is your version ?
The administrator has disabled public write access.

prevent printing of the answer code 4 years 4 months ago #66608

  • jferring
  • jferring's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 7
  • Karma: 0
Hi,

the latest version,

Version 1.91+ Build 11026
Last Edit: 4 years 4 months ago by jferring.
The administrator has disabled public write access.

prevent printing of the answer code 4 years 4 months ago #66609

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1592
  • Thank you received: 391
  • Karma: 103
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
Last Edit: 4 years 4 months ago by Ben_V.
The administrator has disabled public write access.

prevent printing of the answer code 4 years 4 months ago #66613

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5839
  • Thank you received: 347
  • Karma: 261
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)limesurvey.org'"
The administrator has disabled public write access.

prevent printing of the answer code 4 years 4 months ago #66618

  • jferring
  • jferring's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 7
  • Karma: 0
Hello,

I took out this {$fname[1]} and it did not work.
Last Edit: 4 years 4 months ago by jferring.
The administrator has disabled public write access.

prevent printing of the answer code 4 years 4 months ago #66624

  • jferring
  • jferring's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 7
  • Karma: 0
Benitov's solution works, but I think that there should be a more elegant way to resolve this problem.
The administrator has disabled public write access.

prevent printing of the answer code 4 years 4 months ago #66633

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1592
  • Thank you received: 391
  • Karma: 103
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
The administrator has disabled public write access.

prevent printing of the answer code 4 years 4 months ago #66634

  • jferring
  • jferring's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 7
  • Karma: 0
can't wait.... :cheer:

Merci Benoît
The administrator has disabled public write access.

prevent printing of the answer code 4 years 4 months ago #66637

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5839
  • Thank you received: 347
  • Karma: 261
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)limesurvey.org'"
The administrator has disabled public write access.

prevent printing of the answer code 4 years 3 months ago #67310

  • jferring
  • jferring's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 7
  • Karma: 0
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.
The administrator has disabled public write access.

prevent printing of the answer code 4 years 3 months ago #67324

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5839
  • Thank you received: 347
  • Karma: 261
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)limesurvey.org'"
The administrator has disabled public write access.

prevent printing of the answer code 3 years 10 months ago #77105

  • sequoia
  • sequoia's Avatar
  • Offline
  • Junior Lime
  • Posts: 27
  • Karma: 0
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.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.361 seconds