API Assessement value

More
6 months 6 days ago #169759 by benjaminboldt
benjaminboldt created the topic: API Assessement value
Hello,

I was wondering which function of the LimeSurvey JSONRpc Api was able to give me the assessment value of a label set element ID.

I get the responses of a survey with `export_responses` but there's only the responses codes which is not really helpful. I tested a bunch of the API functions but can't find what I am looking for.

Thank you !

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

More
6 months 6 days ago #169776 by holch
holch replied the topic: API Assessement value
As the assessment values are not stored in the results database, I don't think you will be get them with the API.

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
6 months 6 days ago #169778 by benjaminboldt
benjaminboldt replied the topic: API Assessement value
Thanks for you answer.

So, from my understanding. There is no other way to weight answers than assessment values and there are not available with the API ? That's odd.

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

More
6 months 6 days ago - 6 months 6 days ago #169779 by holch
holch replied the topic: API Assessement value
Well, I don't know 100% if they are not available with the API. However, I know that the results of the assessments are not stored in the database (which I personally find odd, but it has always been like this and there seems no effort to do so, especially with the Expression Manager allowing so much more flexible 'assessments' and storing data in the database via equation question). Let's see if someone with more knowledge about the functionalities of the API will come by and sheds a light.

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: 6 months 6 days ago by holch.

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

More
6 months 6 days ago #169789 by tpartner
tpartner replied the topic: API Assessement value
Either load the assessment value into a hidden equation question or create your own "score" with Expression Manager.

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

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

More
6 months 6 days ago #169791 by benjaminboldt
benjaminboldt replied the topic: API Assessement value
Thanks for your replies.

Actually, I knew I could store the overall assessment value score of a survey inside an hidden field. But, I need to get the assessment value for each question answer. If I had to store each question answer assessment value inside an hidden field for each question, I would double the number of questions I have to create. Which is not really nice since I certainly have to make the creation process easy for my client.

Well, guess I'll have to create label sets for each group of answers and store assessment values into label code.

Thanks anyway for your help !

Still open for another way to do it, if anybody has an other idea. :)

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

More
6 months 6 days ago #169796 by holch
holch replied the topic: API Assessement value
Yes, if you need every single assessment value of every answer option, you would have a lot of additional hidden equation questions to store.

If each answer option has different assessment values using the label code is certainly a quick solution. Now if answer options in the same question can have the same assessment value, then you won't be able to use this approach, as the answer codes need to be unique.

No other idea, but of course this all depends what you are actually trying to do. Without knowing the whole story, I currently don't see any other approach.

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
6 months 6 days ago #169802 by DenisChenu
DenisChenu replied the topic: API Assessement value
You mean using : api.limesurvey.org/classes/remotecontrol..._question_properties ?
If yes : good idea to have it :).

Else : you can create your own API function : extensions.sondages.pro/development-and-...d-remotecontrol-api/ :)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

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

More
6 months 6 days ago #169809 by tpartner
tpartner replied the topic: API Assessement value
The get_question_properties() method does return the assessment values.

<?php
 
	require_once 'jsonRPCClient.php';
 
	define( 'LS_BASEURL', 'http://pathTo/limeSurvey');  
	define( 'LS_USER', 'admin' );
	define( 'LS_PASSWORD', 'password' );
 
	$iQuestionID = 123;
 
 
	if(ctype_alnum($iQuestionID)) { // Valid QID format
 
		// Instantiate a new RPC client
		$myJSONRPCClient = new jsonRPCClient( LS_BASEURL.'/index.php/admin/remotecontrol' );
 
		// Get a session key
		$sSessionKey= $myJSONRPCClient->get_session_key( LS_USER, LS_PASSWORD );
 
		if(is_array($sSessionKey)) { // Invalid session
			echo $sSessionKey['status'];
		}
		else if($sSessionKey) { // Valid session
 
			$questionProperties = $myJSONRPCClient->get_question_properties($sSessionKey,  $iQuestionID);
 
			foreach($questionProperties['answeroptions'] as $key => $value) {
				foreach($value as $key => $value) {
					echo $key . ' => ' . $value . '<br />';
				}
				echo '<br /><br />';
			}
		}
 
		// Release the session key
		$myJSONRPCClient->release_session_key( $sSessionKey );
	}
	else { // Invalid SID format
		die( 'Invalid format!' );
	}
 
?>


Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
The following user(s) said Thank You: DenisChenu, 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!