Printing answers throughout the survey

Más
4 meses 4 semanas antes #187981 por 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.
Adjuntos:

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

LimeSurvey Partners
Más
4 meses 4 semanas antes #187982 por 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.

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Más
4 meses 4 semanas antes - 4 meses 4 semanas antes #188004 por 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 .
Última Edición: 4 meses 4 semanas antes por DenisChenu.

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Más
4 meses 3 semanas antes #188050 por 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

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

¡Comenzar ahora!

Simplemente cree una cuenta y comience a usar LimeSurvey hoy mismo.

Registrarse ahora
¡Únase a nuestro boletín informativo!

Iniciar sesión