0 votes
in SoSci Survey (English) by s054796 (115 points)

I checked out the "Suggesting Text Input" question type and find out that it is possible to get data from a database table.

I was planning to use it combined with a JSON API, to get data from https://www.igdb.com/api.
I was planning to connect to the API using cURL.
When I tested the PHP functions of my questionnaire with code example at https://weichie.com/blog/curl-api-calls-with-php/ and I get the following errors.


Warning: The function curl_init() is disabled for the questionnaire.
The PHP code contains invalid function calls or keywords. It was ignored.
Security limitations disallowed loading the PHP functions that have been defined for this questionnaire.
***

1) Is it possible to get cURL enabled? Or do you suggest any other method to connect to an external API?
2) Is there a way to get the JSON data or the JSON data decoded into an array, as options for "Suggesting Text Input" via PHP and Javascript.
3) The igdb.com database contains 136.000 records. If I can get this data, may I use "Options from Database" method for "Suggesting Text Input" on SosciSurvey?

1 Answer

+1 vote
by SoSci Survey (304k points)

1) Is it possible to get cURL enabled? Or do you suggest any other method to connect to an external API?

No, that will not be possible for security reasons. You could do some really nasty things with cURL.

However, If you use a local server, you can simply allow that function.

There is a function readAPI() that does currently not support many APIs, but we can extend that on demand.

The question is: Do you really need to adjust the questionnaire on a "live" base while it is online? Or would it be sufficient to get the information from the database in advance?

2) Is there a way to get the JSON data or the JSON data decoded into an array, as options for "Suggesting Text Input" via PHP and Javascript.

The databank feature would allow for that, although it's possibly not a good idea to import 136k entries there.

I strongly doubt that there is a research design that will benefit from having such a broad database. Would you mind to explain your idea a bit more in detail?

3) The igdb.com database contains 136.000 records. If I can get this data, may I use "Options from Database" method for "Suggesting Text Input" on SosciSurvey?

Sure. But, again ... this will not be very useful unless you have 500.000 respondents. You will probably not be able to work with records that rate (or whatever) a game, if no other record for that game is collected. So, assume you expect 500 respondents and a minimum of 5 records per game required. Then it will be sufficient to include games that have a market share of 1% within your target group. Maybe go down to 0.5% for safety, but that will still strongly reduce the dataset by one or two magnitudes.

by s054796 (115 points)
Thank you for your very quick response.

I was planning to collect long-term data for a player profiling study. However, 136.000 is really unnecessary.

I would consider to narrow down the games to a few hundred popular  titles. I think it would work in this way.

We may also consider to get a university license, but I am afraid I would not have time to manage the server to check out subscribers and all the ongoing research. In that case, would you let us to disable online subscriptions?

Besides, would you consider providing a license of SoSci Survey to an university in a non-EU country?
by SoSci Survey (304k points)
> would you let us to disable online subscriptions?

Usually, you limit self-subscription to users with a given email domain. And as these people are very likely members of the university, it is unlikely that there is much to take care of. But, of course, setting up a secure server and the necessary backups costs some time.

> Besides, would you consider providing a license of SoSci Survey to an university in a non-EU country?

The free licences are limited to public universities (i.e. financed by the state or country). But there is no general limitation to EU countries.

On the other side, it will be much easier to update the some hundred entries (e.g., by using the "database for contents" feature) every month or so. That will also be less prone to errors then connecting to a live API.
by s054796 (115 points)
Unfortunately, I am working in a privately funded university. I will keep that in mind if any of my friends who work in public universities require some survey engine.
by SoSci Survey (304k points)
Of course, it's also a good deal for the university to set up a local survey server based on SoSci Survey, using a paid licence. And it supports us in making SoSci Survey (even) better every day..

But independently from that, in my opinion API access - even though it looks elegant on the first glance - is not the optimal solution for your reserach goal. At least, if I understand your design correctly.

Willkommen im Online-Support von SoSci Survey.

Hier bekommen Sie schnelle und fundierte Antworten von anderen Projektleitern und direkt von SoSci Survey.

→ Eine Frage stellen


Welcome to the SoSci Survey online support.

Simply ask a question to quickly get answers from other professionals, and directly from SoSci Survey.

→ Ask a Question

...