How do I store variable values to a retrievable file?

0 favourites
  • 4 posts
From the Asset Store
290 static tiles (32x32 in size) + 2 animations for use in your project!
  • Hello everyone!

    My first post as I am new to Construct and just started my first project.

    I'm doing a PhD in Psychological Test construction and am using construct to develop a web app for a basic math test for children (and for games if I happen to have time left )

    I have a very specific need and haven't found any solution through google or the forums here.

    As the test taker progresses, his answers are stored in global variables.

    For example: The subject chooses answer 1 on the first item, which is stored in the global variable Item1.

    On the next task, his answer will be stored in the variable Item2 and so forth.

    Now what I want is for the app to export the ItemX variables into a local file (CSV for example) for me to grab and save, so that i can analyze the results results without having to watch the test taker and manually note every answer he as clicked. I have tried the CSV plugin but cannot find out how to use it, and if I understood correctly it is not used in the way that i would like.

    I have almost no knowledge about web technologies and only a superficial grasp of programming which is why I am using Construct.

    Did anybody try to achieve something similiar? Do i need to take a different approach if i want to store "answers" of multiple choice questions externally? Or could i somehow make the app generate a html file at the end that contains a table with the variable names and last values and which I could copy paste to excell? What I want to achieve is storing the complete variable names with their value in some file that i can access, one way or another.

    I absolutely love this software but now after my first 2 days with it I'm finally stuck.

    Here is the most recent Version of my project if somebody wants to have a better idea of how it works.

    EDIT: As I'm new i cannot post URL's. add https

    Thank you very much for any help!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hi Angroid! Have you considered using arrays to store your answers? From what you've said, I think that's a better solution. Once you're using arrays, you can use the "Download" action to save it to a file (JSON), or do whatever else you want with the data.

  • Hello,

    Many thanks for pointing that out!

    After having a look at the manual page I think this is indeed the most forward way to accomplish what I want.

    Will keep the post updated after trying in case others have the same need.

  • Hello,

    I tried using an array and after some fiddling around it works. It lets you download a .json string that can be read by any text editor or browser. The data it contains can be converted to csv or excell using tools available online.

    What i noticed though is that most of these tools don't translate nested arrays correctly, only the first list is recognized and converted. In this case it contains the "size" part of the array. I got a perfect translation to csv by removing the size part of the string and let it start with the "data" part after the opening accolade.

    Hope that helps and many thanks for the hint!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)