Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

pdfReport HowTo

  • jparis
  • jparis's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
21 hours 3 minutes ago #268976 by jparis
pdfReport HowTo was created by jparis
Please help us help you and fill where relevant:
Your LimeSurvey version: 6.9.0+241218
Own server or LimeSurvey hosting: OWN (Debian 12)
Survey theme/template: Fruity TwentyThree
==================
Hi,

Using LimeSurvey from v3 and very happy with it. It's in use for several surveys in a school environment.
Now we want to go further and my colleagues request me a sort of test with several questions, each with 3 or 4 answers, only one is OK.
It's an easy request and had it done in minutes but now they want the students to see which questions they failed (or which were OK) at the end of the test.
I think I can't get this behaviour with LS, tried tha assessment system but it works as a global result of the test and can't make out of the answers so I thought about pdfReport could acomplish the task.
I installed and activated it but I need some guidance to generate the html text with the needed tags I could use to replace each question number (or text), and the same for the answers to be able to print if the question was correct or no...
I can't find any document about this, only that you can use the text of the upload question to generate the pdf and nothing about how to replace text from the "survey"
 

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
19 hours 41 minutes ago - 19 hours 38 minutes ago #268977 by Joffm
Replied by Joffm on topic pdfReport HowTo
Hi,

I think I can't get this behaviour with LS

Of course you can do that.
Use ExpressionScript in the end message.
Here a very small example.



And if I select "Bamako"


with this in the end message (all inline styling removed for more clarity)
Code:
Thank you for taking part in this survey!
 
Here are your results:
 
{Q1.question}
Your answer: {Q1}: {Q1.shown}
{if(Q1==2,'This answer is correct','This answer is wrong. The correct answer is "Bamako"')}


And you can use all properties
[url] www.limesurvey.org/manual/ExpressionScri...#Access_to_variables [/url]
and all implemented functions
[url] www.limesurvey.org/manual/ExpressionScri...mplemented_functions [/url]
of ExpressionScript.

Furthermore you can use all features of bootstrap to improve the appearance.

Here you only display the results at the end of the survey.

If you want to create a pdf report to send it to the participant you can start by entering exactly the same.
And have a look at the demo surveys that are included in the plugin zip file.
 

Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 19 hours 38 minutes ago by Joffm.

Please Log in to join the conversation.

  • jparis
  • jparis's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
16 hours 10 minutes ago - 16 hours 9 minutes ago #268978 by jparis
Replied by jparis on topic pdfReport HowTo
Hi Joffm, THANK YOU so much for the clear and nice answer.

I can do that and it solves 99% of my needs. I didn't know about ExpressionScript and it's great news for me!

One final question for you, I was reading all the info (I had to read the manual fully before starting this, sorry about that) about expressionScript but didn't find how to solve one thing.
You wrote:

{if(Q1==2,'This answer is correct','This answer is wrong. The correct answer is "Bamako"')}

I'll be not involved about typing the questions/answers, etc. and sure my folks will want to change them several times, etc. so...
Could I change the number "2" in you expression for the "right" answer number, knowing that the "right" answer is the one that have an assessment value of "1", that way the expression will remain always the same, no need to change something there, and my folks only need to "mark" the right answer with "1" in the field that is shown if you enable assessment mode? And, as a bonus, I will get the assessment system that could add a nice phrase at the end encouraging the students depending on their full test result, I could also do that with expressions now that I know them but, if it's there, let's use them.

I have to thank you again for your help!

Jose
 
Last edit: 16 hours 9 minutes ago by jparis.

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
8 hours 59 minutes ago #268983 by DenisChenu
Replied by DenisChenu on topic pdfReport HowTo
You ask to your folks to use 1 for assessment, and you use
Code:
{if(Q1.valueNAOK==2,'This answer is correct','This answer is wrong. The correct answer is "Bamako"')}

www.limesurvey.org/manual/Assessments

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 hours 52 minutes ago - 6 hours 51 minutes ago #268994 by Joffm
Replied by Joffm on topic pdfReport HowTo

And, as a bonus, I will get the assessment system

You should forget this "assessment system".
It is outdated since ExpressionScript was implemented (about 10 years ago)

But "assessment values" may be of importance.

Usually you only use the codes.
But incase you want to weight two or more answer options equal or use negative values you have to use assessment values.

Joffm

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 6 hours 51 minutes ago by Joffm.

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
36 minutes ago - 34 minutes ago #269018 by holch
Replied by holch on topic pdfReport HowTo

You ask to your folks to use 1 for assessment, and you use
Code:
{if(Q1.valueNAOK==2,'This answer is correct','This answer is wrong. The correct answer is "Bamako"')}

www.limesurvey.org/manual/Assessments
Shouldn't this be:
Code:
{if(Q1.valueNAOK==1,'This answer is correct','This answer is wrong. The correct answer is "Bamako"')}

Because he says the assessment value for the correct answer would be "1", not "2".

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
Last edit: 34 minutes ago by holch.

Please Log in to join the conversation.

Moderators: holchtpartner

Lime-years ahead

Online-surveys for every purse and purpose