Printing answers throughout the survey

Plus d'informations
il y a 4 semaines 1 jour #187981 par BusyBonsai
Dear Limes,

I am using LS 3.8.0+180522, installed on our institutional servers.

So in the “Presentation” part of general settings, you can switch on and off “Participants may print answers”. When switched on, at the end of survey (after submitting) a text “print answers” is displayed and hyperlinked with/as something like ourLSdomain.eu/index.php/printanswers/view?surveyid=845228 . Screenshot of where that Button/Link leads to looks like is attached.

Our aim: presenting that Button on every page (not just the pager after pressing submit), so respondents can print their answers on any point throughout the survey.
As a service unit, we are beyond the point of questioning that need. We are also aware of possible workarounds, e.g. that build forms with that display the variables used in the survey to print out etc.
[We are also aware that printing answers pulls those from the server, and that answers are saved on the server first when the according page was submitted (by clicking “next” or “submit”).]

Status quo: We copied the following code, which we found in theme editor, “completed” screen, “submit.twig”:
{# Link to Print Answer Preview #}
{% if (aSurveyInfo.aCompleted.aPrintAnswers.show == true) %}
<!-- Link to Print Answer Preview -->
<div class="{{ aSurveyInfo.class.submitwrapperdiva }}" {{ aSurveyInfo.attr.submitwrapperdiv }}>
<a href="{{ aSurveyInfo.aCompleted.aPrintAnswers.sUrl }}" class="{{ aSurveyInfo.class.submitwrapperdivaa }}" {{ aSurveyInfo.attr.submitwrapperdivaa }}>
{{ gT("Print your answers.") }}
</a>
</div>
{% endif %}
And pasted it at the end of “main.twig” in the “question” screen while replacing “true” with “false”. The text/link shows up, however upon clicking it seems to loop back to the same page, pretty much like I’d press F5. So I guess “aSurveyInfo.aCompleted.aPrintAnswers.sUrl”(the href tag content) does only successfully translate to “ ourLSdomain.eu/index.php/printanswers/view?surveyid=845228 ” after the survey (answers) was(were) actually submitted. Deleting the “.aCompleted”-part didn’t help. In the copied and pasted code we then replaced “aSurveyInfo.aCompleted.aPrintAnswers.sUrl”(the href tag content) - being a variable - with “ ourLSdomain.eu/index.php/printanswers/view?surveyid=845228 ” – the value this variable would have for this survey. But since this feature might be useful for other surveys to come in the future we want to have the clean variable-based solution, not the quick and dirty value-based one.

Can any of you help us from here? I hope I could explain everything clear enough.
Pièces jointes :

Connexion ou Créer un compte pour participer à la conversation.

LimeSurvey Partners
Plus d'informations
il y a 4 semaines 1 jour #187982 par BusyBonsai
In case you are wondering (since I didn't mention it) - the screen "print answers" in the template editor is a blackbox to me yet.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 semaines 1 jour - il y a 4 semaines 1 jour #188004 par DenisChenu
I use it in some Survey,

But i set directly it in Group description
<a href="/index.php/printanswers/view?surveyid={SID}" target="_black">View you complete survey</a>

Not clean, but work.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
An error happen ? Before make a new topic : remind the Debug mode .
Dernière édition: il y a 4 semaines 1 jour par DenisChenu.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 3 semaines 5 jours #188050 par BusyBonsai
Dear Denis Chenu

Okay, that'll do. A bit embarassing that I didn't come up with this myself. Thank you really much!

Best
Adam

Connexion ou Créer un compte pour participer à la conversation.

Commencez dès maintenant !

Créez simplement un compte et commencez à utiliser LimeSurvey dès aujourd'hui.

Inscrivez-vous maintenant

Inscrivez-vous à notre Newsletter!