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
3 days 3 hours 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
3 days 1 hour ago - 3 days 1 hour 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: 3 days 1 hour ago by Joffm.

Please Log in to join the conversation.

  • jparis
  • jparis's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 days 22 hours ago - 2 days 22 hours 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: 2 days 22 hours 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
2 days 15 hours 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
2 days 12 hours ago - 2 days 12 hours 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: 2 days 12 hours ago by Joffm.

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 days 6 hours ago - 2 days 6 hours 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: 2 days 6 hours ago by holch.
The following user(s) said Thank You: DenisChenu

Please Log in to join the conversation.

  • jparis
  • jparis's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 days 2 hours ago #269030 by jparis
Replied by jparis on topic pdfReport HowTo
Thank you for the amend holch, I already supposed that.
Wow, I'm about to finish the prototype and really happy with the results.
Thank you all for your taking your time to help me.
Would it be possible to store the survey result (only the sum of all ok questions, taking into account that each of them equals to "1" when answered right) in order for the student to take the survey again, with the same token/password, after some weeks and have info about his former results?

Paris

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 days 2 hours ago #269031 by Joffm
Replied by Joffm on topic pdfReport HowTo
ExpressionScript:
countif("1",Q1.valueNAOK, Q2.valueNAOK,...) to count the correct answers.

Now: open survey or closed survey?

In a closed survey you can use the plugin "updateTokenByResponse" to store this result and display it in a next eave.

But you should explain your planned workflow.

Joffm 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 days 41 minutes ago #269032 by holch
Replied by holch on topic pdfReport HowTo
I agree with Joffm. I would be good to know what you exactly mean with this:

and have info about his former results?


Because I assume you don't want to show them what they had answered before, because this wouldn't make much sense, I guess?

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.

Please Log in to join the conversation.

  • jparis
  • jparis's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 day 7 hours ago #269049 by jparis
Replied by jparis on topic pdfReport HowTo
Hi guys,
Let me explain the matter. We're a public high school about audiovisual, leading to a Associate Degree (I think this is the correct translation) and we use LS from version 3. We're self hosted so can do anything needed in our LS server.
I'm the IT manager with high extertise in AV systems and not so high but good expertise in IT (today's AV technology is mostly digital so...), so I do as many of us usually... read only the 3 or 4 things you need to get a system up and ready and then the rest come alone with our expertise. But I have to recognise that I didn't read the LS manual at all, only the installation instructions, LS 3 was very, very, intuitive and that was enought for the simple surveys we have been doing from there (some of them using the internal logic for show that quiestion and do not show others, etc) without reading a simple word of the manual and, when facing a problem, read this excellent forum, and find the answer easy.
So, TBH, when my folks told me about doing this kind of tests I thought that they can't be done with LS and didn't read the manual to know if it was possible or not... my fault.
OK that's the situation. Now the needs:
  • We need to do several "test", not exactly surveys, with several questions with 3 or 4 answers, only one answer good.
  • Each test will have about 20 - 30 questions.
  • We'll import our student database and put them in the required tests, asigning each of them a token to access LS, so i understand it's a "closed" survey.
  • As there are several groups of students we need several groups of tests so I decided to group the same level and matter tests in a unique test with the first question about "which test do you want to do?" and have access to the test number needed using internal logic.
  • We need the students to be able to repeat the tests all the times they could need.
Then come the "extras" that discovered my need of reading the manuals:
  • First requeriment is solved, it was how to present the student the result of the test at the end of it. I tried your proposal in a short test to have an idea of how it'll look and feel and works like a champ.
  • Second requeriment (and hope the last one) is to record the result of the tests that each student do and present these historic results along with the result of the actual test. Don't need to present which questions were OK or NG, only the calification. IE: After showing all the questions, one by one and saying if they are OK or NG for the actual test, It's easy to calculate a result, if each OK answer equals to "1" and the rest are "0", the sum of all the questions, let's say 20 questions, is the calification. With the Assessment it's easy to do so and present the student a result at the end of the test or it can be done with ExpressionScript. What I'm required to do is to append a "historic result" of this student in this test, something like: "You did the test 5 times, and you got : 15, 12, 18, 19, 17" (I hope this won't scale to "we need the full thing, knowing the OK and NG answers of the historic tests)

Sorry for all the blah, blah, but you asked for it...

Again, need to THANK YOU ALL for your help, time and patience!

Paris

Please Log in to join the conversation.

  • tammo
  • tammo's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
1 day 7 hours ago #269050 by tammo
Replied by tammo on topic pdfReport HowTo
Please find a working example here:  Quiz or assessment? | Respondage

Tammo


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 day 5 hours ago - 1 day 5 hours ago #269053 by Joffm
Replied by Joffm on topic pdfReport HowTo
In my opinion the mentioned plugin "updateTokenByResponse" should do it.
At the start of the test read this "additional attribute", at the end add the actual result and "update the token"

Example:
After two tests the attribute contains "23,17".
At the start you store it in a question (ResOld) of type "short text", at the end you add the actual result (ResAct)
Join(Resold,",",ResAct)
Now the additional attribute may contain "23,17,12"

With some string functions you can split yhis to display an appealing overview.

​​​​Answered from my phone.
Link to the plugin later

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 day 5 hours ago by Joffm.

Please Log in to join the conversation.

Moderators: holchtpartner

Lime-years ahead

Online-surveys for every purse and purpose