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

TOPIC: prevent printing of the answer code

prevent printing of the answer code 2 years 6 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.

Re: prevent printing of the answer code 2 years 6 months ago #66498

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 5850
  • Thank you received: 716
  • Karma: 222
Hello,

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

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

Re: prevent printing of the answer code 2 years 6 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.

Re: prevent printing of the answer code 2 years 6 months ago #66604

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 5850
  • Thank you received: 716
  • Karma: 222
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.

Re: prevent printing of the answer code 2 years 6 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: 2 years 6 months ago by jferring.
The administrator has disabled public write access.

Re: prevent printing of the answer code 2 years 6 months ago #66609

  • Ben_V
  • Ben_V's Avatar
  • OFFLINE
  • Platinum Lime
  • Posts: 933
  • Thank you received: 193
  • Karma: 62
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)
nocode.gif

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

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 6 months ago by Ben_V.
The administrator has disabled public write access.

Re: prevent printing of the answer code 2 years 6 months ago #66613

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5279
  • Thank you received: 289
  • Karma: 246
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.

Re: prevent printing of the answer code 2 years 6 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: 2 years 6 months ago by jferring.
The administrator has disabled public write access.

Re: prevent printing of the answer code 2 years 6 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.

Re: prevent printing of the answer code 2 years 6 months ago #66633

  • Ben_V
  • Ben_V's Avatar
  • OFFLINE
  • Platinum Lime
  • Posts: 933
  • Thank you received: 193
  • Karma: 62
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

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...
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.300 seconds
Donation Image