Answer the question
In order to leave comments, you need to log in
How to come up with an algorithm for a project in the form of tests?
There is an idea to make a project where the user is offered a series of tests in which nothing needs to be filled out. These are more lazy, interactive and entertaining.
I want to get the test result from the api fb, but each test has its own data on which it generates the test result. For example, the question "How soon will you fly to travel?" api fb for example can take the age of the user and randomly give him time, or calculate the time of the last trip and average the time and give an answer.
Another question is "Who are your supermen friends?" - api fb collects a list of friends and randomly gives out one of them. And the other question, the answer is expected among only female or male friends. But then each test has its own algorithm.
How to implement such an approach through little bloodshed?
Answer the question
In order to leave comments, you need to log in
I see only this option:
1. For all tests, the user must log in to your site through Facebook. Since the Django tag hangs here, I recommend the allauth library for this .
2. For each specific test, requests are made from the server to the Facebook API for the data that is needed for this test. Again, I can advise you to use facebook-sdk .
3. When the data is received, it is processed already taking into account the logic of this test. The logic is different for each test, so it would be logical to separate each test into a separate class.
I also want to warn you that Facebook has quite a few restrictions on working with the API. For example, already with two tests from the example, there will be problems:
Vkontakte has fewer such restrictions, you can try with its API.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question