Save assestment value to database "survey copy proof!"

More
3 years 7 months ago #131280 by shadowsheep
It works like a charm!!!

Thanks guy!!! (from here )
<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>

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
3 years 7 months ago #131321 by DenisChenu
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

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 .
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago #131332 by shadowsheep

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!

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago #131335 by holch
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?

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago - 3 years 7 months ago #131367 by DenisChenu

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?

1st question ;) : In 2.06 or 2.50 ?

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 .
An error happen ? Before make a new topic : remind the Debug mode .
Last edit: 3 years 7 months ago by DenisChenu.

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago - 3 years 7 months ago #131371 by holch
It was in 2.06 and I wrote it into a equation like this:
{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'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds
Last edit: 3 years 7 months ago by holch.

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!