Beispiel #1
0
def model_solutions_view(request, problem_instance_id):
    problem_instance = \
        get_object_or_404(ProblemInstance, id=problem_instance_id)
    if not can_admin_problem_instance(request, problem_instance):
        raise PermissionDenied
    context = generate_model_solutions_context(request, problem_instance)

    return TemplateResponse(request, 'programs/admin/model_solutions.html',
                            context)
Beispiel #2
0
def problem_site_settings(request, problem):
    show_add_button, administered_recent_contests = generate_add_to_contest_metadata(request)
    package = ProblemPackage.objects.filter(problem=problem).first()
    problem_instance = get_object_or_404(ProblemInstance, id=problem.main_problem_instance_id)
    model_solutions = generate_model_solutions_context(request, problem_instance)
    extra_actions = problem.controller.get_extra_problem_site_actions(problem)
    algorithm_tag_proposals = AlgorithmTagProposal.objects.all().filter(problem=problem).order_by('-pk')[:25]
    return TemplateResponse(request, 'problems/settings.html',
                            {'site_key': problem.problemsite.url_key,
                             'problem': problem, 'administered_recent_contests': administered_recent_contests,
                             'package': package if package and package.package_file else None,
                             'model_solutions': model_solutions,
                             'algorithm_tag_proposals': algorithm_tag_proposals,
                             'can_admin_problem': can_admin_problem(request, problem),
                             'extra_actions': extra_actions})
Beispiel #3
0
def problem_site_settings(request, problem):
    show_add_button, administered_recent_contests = generate_add_to_contest_metadata(
        request)
    package = ProblemPackage.objects.filter(problem=problem).first()
    model_solutions = generate_model_solutions_context(
        request, problem.main_problem_instance_id)
    extra_actions = problem.controller.get_extra_problem_site_actions(problem)
    return TemplateResponse(
        request, 'problems/settings.html', {
            'site_key': problem.problemsite.url_key,
            'problem': problem,
            'administered_recent_contests': administered_recent_contests,
            'package': package if package and package.package_file else None,
            'model_solutions': model_solutions,
            'can_admin_problem': can_admin_problem(request, problem),
            'extra_actions': extra_actions
        })
Beispiel #4
0
def model_solutions_view(request, problem_instance_id):
    context = generate_model_solutions_context(request, problem_instance_id)

    return TemplateResponse(request, 'programs/admin/model_solutions.html',
                            context)