Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

How to present benchmark results?

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #198117 by DenisChenu
Replied by DenisChenu on topic How to present benchmark results?

holch wrote: Ok, sorry, then I am out of ideas. Maybe Denis has one. Let's see tomorrow.

Ideally we would be able to do all this from within Expression Manager/Script. I have seen an interesting line in the release notes of 4.2.0. It reads like it is what I am describing, but not sure. Need to test it:

+New feature #13175: Ability to show calculated values based on all users (Denis Chenu)

Yes,

No clean solution before this feature, getStatInSurey allow some javascript

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.
  • RudischerMC
  • RudischerMC's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 11 months ago - 3 years 11 months ago #198181 by RudischerMC
Replied by RudischerMC on topic How to present benchmark results?

No, an ajax call writes the result into variables (e.g. a question of type "short text"). These you may access by EM.


That sound encouraging, thanks Joffm. For someone new to all this, would manual.limesurvey.org/Workarounds:_Manip...ime_using_Javascript be the right place to start?

Chris
Last edit: 3 years 11 months ago by RudischerMC.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #198192 by Joffm
Replied by Joffm on topic How to present benchmark results?
Hi,
you see a really basic ajax call could be this:
In a question of type "short text"
Code:
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
 
  $.post('https://www.myServer.de/getMyValue.php' , { sid: "{SID}", gid: "{GID}", qid: "{QID}" } ,function(data) {
 
                   $('#question{QID} input[type="text"]').val(data);
 
  });
// Uncomment to hide the question
//                $('#question{QID}').hide();
});
</script>

You see, three values - SurveyID SID, GroupID GID and QuestionID QID are posted to the php script that does the work and returns something into the question.

And in the php you may use a direct access to the database or the LimeSurvey API to query the database and calculate your desired values

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: RudischerMC
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose