Ejemplo n.º 1
0
def quiz_methods(quiz_name):
    if request.method == 'GET':
        return api.get_questions(quiz_name)
    elif request.method == 'POST':
        answers = request.get_json()
        return api.get_grade(quiz_name, answers)
    else:
        return "The Quiz API only supports GET and POST requests"
Ejemplo n.º 2
0
def quiz_methods(quiz_name):
    if request.method == 'GET':
        return api.get_questions(quiz_name)
    elif request.method == 'POST':
        answers = request.get_json()
        return api.get_grade(quiz_name, answers)
    else:
        return "La API solo soporta GET y POST"