Welcome, Guest
Username: Password: Remember me

TOPIC: Saving Assessment scores to survey database

Saving Assessment scores to survey database 2 years 7 months ago #73726

  • gsaha
  • gsaha's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 8
  • Karma: 0
I am on Version 1.91+ Build 12358

I have 20 survey questions. Each question is a radio list with 5 labels and each label has an assessment value.
I have no problem displaying the assessment data as Total assessment score to the user at the end of their survey.
However this data is not saved to the limesurvey database and hence no statistics can reported on this assessment data.

I have seen some examples of javascript, but not sure how to achieve saving assessment data to the limesurvey database for statistics reporting.
Any help would be so appreciated.
Attached is the format of each of my survey questions
thanks in advance
question_<a href='http://manual.limesurvey.org/Assessments'>assessment</a>.png
The administrator has disabled public write access.

Re: Saving Assessment scores to survey database 2 years 7 months ago #73749

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5325
  • Thank you received: 296
  • Karma: 249
Saving the assessment score to the database is not possible at version 1.91. You have to make use of one of the Javascript workarounds to store the total score in a hidden question which can then also be analysed using the internal statistics feature.

At version 1.92 you can use the Expression Manager to sum up all scores and store it at the database, see docs.limesurvey.org/Expression+Manager+H..._assessment_Examples

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: Saving Assessment scores to survey database 2 years 7 months ago #73773

  • gsaha
  • gsaha's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 8
  • Karma: 0
Thanks so much.
Could you point me to what kind of javascript I can create for a hidden question to calculate the sum of the assessments?
Thanks again so much
The administrator has disabled public write access.

Re: Saving Assessment scores to survey database 2 years 7 months ago #73814

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5325
  • Thank you received: 296
  • Karma: 249
gsaha wrote:
Thanks so much.
Could you point me to what kind of javascript I can create for a hidden question to calculate the sum of the assessments?
Thanks again so much
There should be some examples at manual -> workarounds -> javascript and at the forums as well.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: Saving Assessment scores to survey database 2 years 7 months ago #73832

  • Ben_V
  • Ben_V's Avatar
  • OFFLINE
  • Platinum Lime
  • Posts: 1099
  • Thank you received: 247
  • Karma: 78
HI,
1) Set your survey group by group or question by question
2) Set a numerical input type question (in a separate group in case of group by group navigation)
3) In the source of the question copy the following code and adapte the SurveyID_X_GroupID_X_QuestionID code
(look at the related attached image if you've got a problem)
<script type="text/javascript">
jQuery(document).ready(function() {
document.getElementById('answer89176X314X3005').value = "{assessment_CURRENT_TOTAL}";
 
// Avoid possibility to change the assess value if the question is not hidden 
$('#answer89176X314X3005').attr( "readonly","readonly" );
});
</script>
 
// Emule SUBMIT or NEXT button action
<script type="text/javascript">
jQuery(document).ready(function($) {
document.limesurvey.submit();});
</script>

assess.gif
Benoît

goo.gl/Bw5iM => Recherche GG dans le forum français (remplacer "exemple" dans la barre de recherche)
goo.gl/WX8PH => GG search for english forum (Replace "example" in the search bar)
goo.gl/IxiGu => Búsqueda en el foro en español (Cambiar "ejemplo" en la barra de...
The administrator has disabled public write access.

Re: Saving Assessment scores to survey database 2 years 7 months ago #73833

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4210
  • Thank you received: 792
  • Karma: 360
You can use the {assessment_CURRENT_TOTAL} placeholder to access the assesssment total from previous pages.

The following will load a short-text input with the {assessment_CURRENT_TOTAL} and hide it where:
11111 = survey ID
22 = group ID
33 = question ID
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function(){
 
		$('#answer11111X22X33').val('{assessment_CURRENT_TOTAL}');	
		$('#question33').hide();
	});
 
</script>
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: Saving Assessment scores to survey database 2 years 7 months ago #73851

  • gsaha
  • gsaha's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 8
  • Karma: 0
Thanks a million benitov and tpartner:) :) :) :)
I took both of your ideas and this works perfectly

<script>
jQuery(document).ready(function() {
document.getElementById('answer55972X9X311').value = "{assessment_CURRENT_TOTAL}";
document.getElementById('display311').style.display= "none";
document.getElementById('answer55972X9X311').style.display= "none";
});
</script><script>
$(document).ready(function()
{
$('#question311').hide();
});
</script>


I set the survey question by question.
Also I set filter HTML for XSS to NO

Thanks again so much
The administrator has disabled public write access.

Re: Saving Assessment scores to survey database 2 years 7 months ago #74068

  • giankuka
  • giankuka's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 28
  • Karma: 0
I have a equation question: if(CH1.valueNAOK, 0, sum(TA1.valueNAOK, TA2.valueNAOK) / 2); I set it as hidden. But I would like to have it in the results email and in the statistic. I tryed to use your script but It doesn't work,I'm not able :).
Someone can help me?
Thanks, Gianluca
The administrator has disabled public write access.

Re: Saving Assessment scores to survey database 2 years 7 months ago #74069

  • gsaha
  • gsaha's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 8
  • Karma: 0
Hi Giankuka,
I am not on 1.92
Still on 1.91
I used a numeric input question and made it hidden using the script below.
You will need to modify the numbers 55972x9x311 to your survey number, group number and question number.
Not sure about the result email.
But you will certainly get statistics like this:

Field summary for 0021:
Calculation Result
Count 30
Sum 463
Standard deviation 5.71
Average 15.43
Minimum 4
1st quartile (Q1) 12
2nd quartile (Median) 14.5
3rd quartile (Q3) 17.25
Maximum 30
The administrator has disabled public write access.

Re: Saving Assessment scores to survey database 2 years 7 months ago #74087

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5325
  • Thank you received: 296
  • Karma: 249
giankuka, the approaches for 1.91 and 1.92 work different. At 1.92 you can use the Expression Manager for this while at 1.91 you have to make use of the above workaround (which should also work for 1.92 when applied correctly.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.188 seconds
Donation Image