Check out the LimeSurvey source code on GitHub!

Allow user to return to assessment results and/or create pdf from results

More
5 years 2 months ago #70825 by mlyter
I have created a survey that can be taken without any registration/token,etc (basically anyone with the link). I have used javascript to give feedback according to group score throughout the survey, but have also turned on assessments to give additional information at the end of the survey. This additional information includes some links that we would like the user of the survey to have access to after the survey is completed.

We can print the assessment results but this does not allow the user easy access to the links. Is there a way to create a link using the ID of the survey in conjunction with the ID assigned to the user that would allow the user access to the assessment results at a later time?

If not, is there a way to allow the user to export the assessment results in a pdf?

Please Log in to join the conversation.

More
5 years 2 months ago #71047 by TMSWhite
In 1.92RC1, you can create tailored reports, like the feedback and links you are describing. Users could print out any desired page with that report information. Also, that same tailoring works in print_answers at the end - they'll see their raw answers, plus any tailored reports.

The first page of the Demo for 1.92RC1 shows a sample of such custom reports.

Please Log in to join the conversation.

More
5 years 2 months ago #71084 by mlyter
TMSWhite, thanks for your response.

I ended up passing the SAVEDID and SID in the end url and querying the mySQL database from a separate page.

Please Log in to join the conversation.

More
10 months 3 weeks ago #134069 by mattheoh

mlyter wrote: TMSWhite, thanks for your response.

I ended up passing the SAVEDID and SID in the end url and querying the mySQL database from a separate page.


Hi, I m trying to do the same thing you did, I mean :
- Save assessment (to permit users to consult it later)
- export assessment in a pdf file

Could you tell me more, about your solution ?
Thanks per advance.

Please Log in to join the conversation.

More
10 months 3 weeks ago #134185 by Mazi
Did you think about just displaying custom assessment results at the "thank you"-page using the Expression Manager and placeholders?

You could easily add a "Print assessment results" button there which calls the browser's print option, see www.javascriptkit.com/howto/newtech2.shtml
Most modern browsers support direct PDF printing of any website.


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

More
10 months 3 weeks ago #134189 by mattheoh

Mazi wrote: Did you think about just displaying custom assessment results at the "thank you"-page using the Expression Manager and placeholders?

You could easily add a "Print assessment results" button there which calls the browser's print option, see www.javascriptkit.com/howto/newtech2.shtml
Most modern browsers support direct PDF printing of any website.


HI thanks for your answer.
I already finished my assessment - it works well, but it's in HTML and not saved.
Add a PDF button could be a good solution... But I also need to assign / save the assessment (PDF or HTML version) to each survey completed (accessible in the result list).
The aim is the admin can go in the back office and look at the assesments of each survey completed...
(hope I m clear enough - that was exactly what mlyter wanted to do, but I didn't understand is solution with ID and SQL Queries)

Please Log in to join the conversation.

More
10 months 3 weeks ago #134190 by Mazi
I am not sure if mlyter finally created the PDF at all. The solution sounds like he only loads the details of the current data set into a custom script which is called at the end of the survey.


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

More
10 months 3 weeks ago #134192 by mattheoh
Indeed, I think he made a custom SQL request when the assessment is generated, to insert it in the database.
I don't need to go until there.
I will put a pdf button as you said...
But I need to find a solution to add / assign this pdf, to the survey result, to make it accessible in the back office...
I didn't find anything about that on forums.... not easy. :blink:

Please Log in to join the conversation.

More
10 months 3 weeks ago #134193 by Mazi
You are right, storing results as a PDF is pretty difficult and not that easy to automate with complex additional coding.

To assign a PDF to a certain survey is pretty easy, you can simply use survey ID (e.g. 12345) and data set ID (e.g. 333) as a file name when storing the file: "assessment_12345_33.pdf".
You could then e.g. send an email to the admin including such a dynamically created link to the PDF or provide users with a predefined link at which they just have to enter the data set (and survey) ID.


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

More
10 months 3 weeks ago - 10 months 3 weeks ago #134194 by mattheoh
seems a good idea to play with surveyr ID'S to generate the pDF name !
And maybe I could add an hidden equation question which the result would be : assessment_ID_DataID.pdf ...
In this way, I could directly access to the pdf file form the result list.
Do you think it would be possible ?
Last Edit: 10 months 3 weeks ago by mattheoh.

Please Log in to join the conversation.

More
10 months 3 weeks ago #134197 by Mazi
The equation question sounds like a good idea. You could even hard code the complete path + file name there so an admin can copy - paste that at his browser to call the later created PDF.


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

More
10 months 3 weeks ago #134199 by mattheoh
I m going to look forward into it.
I will let you know, if I can do something with all this stuff ! ;)
Thanks again for your help.

Please Log in to join the conversation.

More
10 months 1 week ago #134716 by mattheoh
Hi again !
I m working for a few days on my needs to generate a pdf of the assessment.
I made some few tests with jspdf library but I can t have a good result 'cause my pdf has several pages (and the page split option makes it blurry)
Anyway, I m testing html2pdf (php script) and I need to call a php file from my assessment.pstpl.

So I added an ajax script
<script type="text/javascript">
var contenu=$("#canvas").html();
var filename = "{INFO1}-{SAVEDID}";
$.ajax({
     url:"/upload/templates/bpf-cosmed/views/html2pdf.php",
     type:"post",
     data: { data: contenu, filename: filename },
     complete: function (xhr,result){
           var msg=xhr.responseText;
     }
});
</script>

Unfortunatel, I don't know why I have an error 500 when the server is trying to execute my php file. (the link is good, I checked it)
Is there a security parameter with linesurvey or my code is maybe not good ? (I disabled xss option)

Thanks for your help :)

Please Log in to join the conversation.

More
10 months 1 week ago - 10 months 1 week ago #134719 by mattheoh
I had an error in my php script that caused error 500... sorry for the noise !
I can continue to advance ;)

PS : Sorry for the double post, but I can't no mor edit my previous post... Time is out I guess ^^
Last Edit: 10 months 1 week ago by mattheoh.

Please Log in to join the conversation.

More
10 months 4 days ago #135120 by mattheoh
Just to let you know , I managed to generate automatically a PDF of the assessment, whicj is compiled when the assessment page is displayed. I used the library HTML2PDF.
Also added a button to send, the PDF by mail.
The name of the PDF is : INFOX-IDSURVEY.PDF which permits to add it an equation question to display it in the board.
if someone needs the script I can post it here.
Thanks again for the help.
The following user(s) said Thank You: mrli999

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form