question

roger.olier@gmail.com avatar image
roger.olier@gmail.com asked

Validate with cloud script

Hi!

I want to know how to implement that in the most efficient way with playfab, or know if we need to use an extra service:

-We are making a quiz and we need to validate if the user has answered the correct question. 

The validation must be done with cloudscript, but how we store the data? For example, I need to check if question id 653 has response B. it seems that i need to add that info on the custom data of a item, but GetCatalogItems returns ALL the items, and this can get very big (so searching on a cloud script doesn't look very efficient).

Thanks for your help.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

It depends upon your requirements, but it sounds like your best bet might be Title Internal Data (https://api.playfab.com/Documentation/Server/method/GetTitleInternalData), as that would allow you to have a secure location which the client cannot see to store information on the answers to the questions. A key point is making sure you're not querying for loads of Keys all at once, so depending on your use model, you may want to consider making logical groupings. The idea there would be to aggregate question/answer pairs in an embedded JSON which you then store as a Value. You would then be able to query these from Cloud Script, to verify whether the user's answer is correct.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

roger.olier@gmail.com avatar image
roger.olier@gmail.com answered

Thanks I will try this approach 

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.