- Posts: 8
- Thank you received: 2
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Save assestment value to database "survey copy proof!"
- shadowsheep
- Topic Author
- Offline
- New Member
Less
More
8 years 2 months ago #131280
by shadowsheep
Save assestment value to database "survey copy proof!" was created by shadowsheep
It works like a charm!!!
Thanks guy!!! (from here )
Thanks guy!!! (from here )
Code:
<script type="text/javascript"> jQuery(document).ready(function() { document.getElementById('answer{SID}X{GID}X{QID}').value = "{ASSESSMENT_CURRENT_TOTAL}"; //document.getElementById('answer{SID}X{GID}X{QID}').value = 6 // Avoid possibility to change the assess value if the question is not hidden $('#answer{SID}X{GID}X{QID}').attr( "readonly","readonly" ); }); </script>
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13642
- Thank you received: 2491
8 years 2 months ago #131321
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Save assestment value to database "survey copy proof!"
Hi ,
To save current assesment value to DB, without any hack you can
- Add a equation question type
- Set it hidden
- Set equation to {ASSESSMENT_CURRENT_TOTAL}*
See manual.limesurvey.org/Question_type_-_Equation
To save current assesment value to DB, without any hack you can
- Add a equation question type
- Set it hidden
- Set equation to {ASSESSMENT_CURRENT_TOTAL}*
See manual.limesurvey.org/Question_type_-_Equation
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- shadowsheep
- Topic Author
- Offline
- New Member
Less
More
- Posts: 8
- Thank you received: 2
8 years 2 months ago #131332
by shadowsheep
Even better!!! Thanks a lot!
Replied by shadowsheep on topic Save assestment value to database "survey copy proof!"
DenisChenu wrote: Hi ,
To save current assesment value to DB, without any hack you can
- Add a equation question type
- Set it hidden
- Set equation to {ASSESSMENT_CURRENT_TOTAL}*
See manual.limesurvey.org/Question_type_-_Equation
Even better!!! Thanks a lot!
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11655
- Thank you received: 2742
8 years 2 months ago #131335
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Save assestment value to database "survey copy proof!"
Hi Denis,
{assessment_CURRENT _TOTAL} didn't work for me yesterday in an equation. Could it be that it only works if the equation question is on a different page as the assessment questions?
{assessment_CURRENT _TOTAL} didn't work for me yesterday in an equation. Could it be that it only works if the equation question is on a different page as the assessment questions?
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13642
- Thank you received: 2491
8 years 2 months ago - 8 years 2 months ago #131367
by DenisChenu
It's not updated in JAVASCRIPOT, but when you go next : it must save actual value (each time you "save" the page with Equation : it save actual value)
If you want assesment only for the first time see the page (and don't update it if prev/next is used): put it in another group (next group) and
{if(is_empty(SELF),assessment_CURRENT _TOTAL,SELF)} I think it work.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Save assestment value to database "survey copy proof!"
1st question : In 2.06 or 2.50 ?holch wrote: Hi Denis,
{assessment_CURRENT _TOTAL} didn't work for me yesterday in an equation. Could it be that it only works if the equation question is on a different page as the assessment questions?
It's not updated in JAVASCRIPOT, but when you go next : it must save actual value (each time you "save" the page with Equation : it save actual value)
If you want assesment only for the first time see the page (and don't update it if prev/next is used): put it in another group (next group) and
{if(is_empty(SELF),assessment_CURRENT _TOTAL,SELF)} I think it work.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 8 years 2 months ago by DenisChenu.
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11655
- Thank you received: 2742
8 years 2 months ago - 8 years 2 months ago #131371
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Save assestment value to database "survey copy proof!"
It was in 2.06 and I wrote it into a equation like this:
while my other expressions in the equation question took effect when I answered questions on the same page (summing up points), the assessment current total stayed at zero.
But from your explanation I read that it only takes effect when the page is saved, which explains that I didn't see any immediate effect. I didn't test writing it to the database.
Code:
{assessment_CURRENT _TOTAL}
while my other expressions in the equation question took effect when I answered questions on the same page (summing up points), the assessment current total stayed at zero.
But from your explanation I read that it only takes effect when the page is saved, which explains that I didn't see any immediate effect. I didn't test writing it to the database.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Last edit: 8 years 2 months ago by holch.
The topic has been locked.