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
  • shadowsheep's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 2 months ago #131280 by shadowsheep
It works like a charm!!!

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
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 2 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 .
I don't answer to private message.
The topic has been locked.
  • shadowsheep
  • shadowsheep's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 2 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!
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 2 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 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
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 2 months ago - 8 years 2 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 .
I don't answer to private message.
Last edit: 8 years 2 months ago by DenisChenu.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 2 months ago - 8 years 2 months ago #131371 by holch
It was in 2.06 and I wrote it into a equation like this:
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.

Lime-years ahead

Online-surveys for every purse and purpose