This translation is older than the original page and might be outdated. See what has changed.
Translations of this page:
 

This is an old revision of the document!


answersPrint()

A whole range of questions that are asked in the questionnaire can be displayed with the help of the answersPrint() function. This means the participant can be shown a print view of their own questionnaire.

Mithilfe der Funktion answersPrint() kann eine ganze Reihe von Fragen, die im Fragebogen abgefragt wurden, dargestellt werden. So kann man dem Teilnehmer eine Druckansicht des eigenen Fragebogens zeigen.

Use the option() function to define a section of the questionnaire (see example).

Verwenden Sie die Funktion option(), um einen Abschnitt des Fragebogens zu definieren (s. Beispiel).

void answersPrint(string section)

Tips

The answersPrint() function calls up answers repeatedly. Therefore, information for answers() also applies fully for answersPrint().

Die Funktion answersPrint() ruft mehrfach answers() auf. Hinweise für answers() gelten daher uneingeschränkt auch für answersPrint().

Example 1

In the following example, the participant should get a print view of all questions in the questionnaire.

Im folgenden Beispiel soll der Teilnehmer eine Druckansicht aller Fragen im Fragebogen bekommen.

In Compose Questionnaire, insert a PHP code element on the first page with the following content:

Fügen Sie dafür unter Fragebogen zusammenstellen zunächst auf der ersten Seite ganz oben ein Element PHP-Code mit folgendem Inhalt ein:

option('part', 'all');

This command informs SoSci Survey that a section begins with the all ID right from the start.

Dieser Befehl teilt SoSci Survey mit, dass gleich zu Beginn ein Abschnitt mit der Kennung all beginnt.

Following this, insert a new page at the end of the questionnaire – with a PHP code element and a text element.

Anschließend fügen Sie am Ende des Fragebogens eine neue Seite ein – und zwar mit einem PHP-Code Element und einem Textbaustein.

answersPrint('all');
text('printButton');

The “printButton” text element has the following content.

Der Textbaustein “printButton” hat dabei folgenden Inhalt.

<div>
  <button type="button" onclick="window.print();">Print</button>
</div>

Example 2

The questionnaire consists if two parts: after

Der Fragebogen enthält zwei Teile: Nach einigen Fragen zu den Stammdaten (Seiten 1 und 2) kommt ein Teil zum Unternehmen des Befragten (Seiten 3 bis 5) und dann ein Teil zur Beschäftigungssituation (Seiten 7 und 8). Der Befragte soll beide Teile getrennt als Druckansicht bekommen, die Seite 6 soll in keiner Druckansicht auftauchen.

Dafür wird auf Seite 3 ganz oben zunächst ein PHP-Code Element mit folgendem Inhalt eingefügt:

option('part', 'company');

Auf Seite 6 wird folgender PHP-Code eingefügt.

option('part', false);

Und auf Seite 7 folgender PHP-Code.

option('part', 'job');

Am Ende des Fragebogens werden zwei Seiten eingefügt, die folgenden Inhalt haben.

answersPrint('company');
answersPrint('job');

Optional kann unter dem PHP-Code jeweils noch der Textbaustein “buttonPrint” aus dem obigen Beispiel eingebunden werden.

en/create/functions/answersprint.1427145342.txt.gz · Last modified: 23.03.2015 22:15 by alexander.ritter
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki