[MV] Is there a way to edit a .json file from in-game?

I make a lot of lessons for my middle school students on MV. One that I'm excited about using next year is a sorting hat style quiz that sorts the students into one of 4 different "Houses". Those are the teams that they will use for the rest of the year. I like collecting data on how many students get into each House so that I can fine tune the quiz to make the results a little more equal in distribution. When I used the game this year (I put the game on a server and have them play in-browser), I asked the students to fill out a google form with their results. I'd like to make this a little less messy.

My idea is to find a way for their input to effect a json file or something to keep a running count of how many users get each result. At the end, I could just go in and look to see what the breakdown was. Is that possible?

Thank you in advance for any help!
You can update and edit a .json file from in game with RPGMakerMV. If you load a JSON file into your game, you can parse it and get a JavaScript object. Once that happens, you can have them enter values into that object in some form, then write it back to the same JSON file on the disk.
You can update and edit a .json file from in game with RPGMakerMV. If you load a JSON file into your game, you can parse it and get a JavaScript object. Once that happens, you can have them enter values into that object in some form, then write it back to the same JSON file on the disk.
Perfect! Do you know where I might find a tutorial to learn how to do that? Or would you mind explaining it? I'm a bit of an amateur.

Thank you so much!
Okay, tell me exactly how you want to edit data and then we can come up with a format.
Thank you so much! Basically, I just want to be able to read the data. I was wondering if there was a way to set one of four variables to +1 every time a student gets one of the four possible results on the test. I might try to make it more complicated at a later date (dumping results into a spreadsheet), but for right now I just want to use it to count.
In that case you'll need to consider two things. A way to send that data to those keys in the object and saving that object.


Example
Code:
var voteObject = voteObject || {"cake": 0, "pizza": 0, "icecream": 0, "donuts": 0};

function voteCategory (key)
{
//key like icecream would be upvoted
  VoteObject[key]+=1;
}

SerializeVote (obj) {
//Turns into a string that you can save in a .json file
  return JSON.stringify(obj)
}

This is just the basic stuff; you would still have to save it somewhere.

I actually have a written tutorial for how to read and write files using Node.js; I'll link it today. If your MV is not web-based it should work for you. If it is I'll get the alternative, but it can be more difficult to understand.

Here this might help also: http://endlessillusoft.com/rpgmakermv-node-js-part-1-reading-and-writing-files/

Original thread: https://forums.rpgmakerweb.com/threads/mv-is-there-a-way-to-edit-a-json-file-from-in-game.78781/