def solution_as_json(request, solution_id): return HttpResponse(logic.get_solution_as_json(logic.get_solution(solution_id)), content_type="application/json")
def vote_solution(request, problem_id, solution_id, vote=0): solution = logic.get_solution(solution_id) solution = logic.vote_on_solution(request, solution, vote) return HttpResponse(logic.get_solution_as_json(solution), content_type="application/json")