mirror of
https://github.com/wiosna-dev/limesurvey-api-client.git
synced 2026-03-12 10:11:49 +01:00
Compare commits
8 Commits
bugfix/UW-
...
feature/WZ
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a61c52fe1c | ||
|
|
06fcaf07a8 | ||
|
|
e025b71059 | ||
|
|
b658e04445 | ||
|
|
d4e74bc270 | ||
|
|
8127330642 | ||
|
|
f0c213fb53 | ||
|
|
81ea8e748f |
@@ -12,7 +12,7 @@
|
|||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.6",
|
"php": ">=5.6",
|
||||||
"fguillot/json-rpc": "^1.2",
|
"fguillot/json-rpc": "^1.2",
|
||||||
"wiosna-dev/common-library": "^0.1.0"
|
"wiosna-dev/common-library": "^0.1.9"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"friendsofphp/php-cs-fixer": "^2.6",
|
"friendsofphp/php-cs-fixer": "^2.6",
|
||||||
|
|||||||
@@ -57,9 +57,14 @@ class Result
|
|||||||
* class constants.
|
* class constants.
|
||||||
* @param array $rawData Raw data returned by the LimeSurvey's API
|
* @param array $rawData Raw data returned by the LimeSurvey's API
|
||||||
*/
|
*/
|
||||||
public function __construct($method, array $rawData)
|
public function __construct($method, $rawData)
|
||||||
{
|
{
|
||||||
$this->method = MethodType::getValidatedMethod($method);
|
$this->method = MethodType::getValidatedMethod($method);
|
||||||
|
|
||||||
|
if (true === is_string($rawData)) {
|
||||||
|
$rawData = base64_decode($rawData);
|
||||||
|
$rawData = json_decode($rawData, true);
|
||||||
|
}
|
||||||
$this->setRawDataAndStatus($rawData);
|
$this->setRawDataAndStatus($rawData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -458,4 +458,45 @@ class SurveyService
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getResponseIds($surveyId, $token)
|
||||||
|
{
|
||||||
|
$arguments = [
|
||||||
|
$surveyId,
|
||||||
|
$token,
|
||||||
|
];
|
||||||
|
|
||||||
|
return $this
|
||||||
|
->client
|
||||||
|
->run('get_response_ids', $arguments)
|
||||||
|
->getData(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function exportResponsesByToken($surveyId, $token)
|
||||||
|
{
|
||||||
|
$arguments = [
|
||||||
|
$surveyId,
|
||||||
|
'json',
|
||||||
|
$token,
|
||||||
|
];
|
||||||
|
|
||||||
|
return $this
|
||||||
|
->client
|
||||||
|
->run('export_responses_by_token', $arguments)
|
||||||
|
->getData(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function exportUploadedFilesByToken($surveyId, $token)
|
||||||
|
{
|
||||||
|
$arguments = [
|
||||||
|
$surveyId,
|
||||||
|
'json',
|
||||||
|
$token,
|
||||||
|
];
|
||||||
|
|
||||||
|
return $this
|
||||||
|
->client
|
||||||
|
->run('get_uploaded_files', $arguments)
|
||||||
|
->getData(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,6 +93,12 @@ class MethodType extends BaseType
|
|||||||
*/
|
*/
|
||||||
const LIST_USERS = 'list_users';
|
const LIST_USERS = 'list_users';
|
||||||
|
|
||||||
|
const EXPORT_RESPONSES_BY_TOKEN = 'export_responses_by_token';
|
||||||
|
|
||||||
|
const GET_RESPONSE_IDS = 'get_response_ids';
|
||||||
|
|
||||||
|
const EXPORT_UPLOADED_FILES_BY_TOKEN = 'get_uploaded_files';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns validated name of method to call or throws an exception (if method is incorrect)
|
* Returns validated name of method to call or throws an exception (if method is incorrect)
|
||||||
*
|
*
|
||||||
@@ -126,6 +132,9 @@ class MethodType extends BaseType
|
|||||||
static::LIST_QUESTIONS,
|
static::LIST_QUESTIONS,
|
||||||
static::LIST_SURVEYS,
|
static::LIST_SURVEYS,
|
||||||
static::LIST_USERS,
|
static::LIST_USERS,
|
||||||
|
static::EXPORT_RESPONSES_BY_TOKEN,
|
||||||
|
static::GET_RESPONSE_IDS,
|
||||||
|
static::EXPORT_UPLOADED_FILES_BY_TOKEN
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user