$def with (course,task,submission,to_display) $# $# This file is part of INGInious. See the LICENSE and the COPYRIGHTS files for $# more information about the licensing of this file. $# $ username = submission['username'][0] $ user_realname= user_manager.get_user_realname(username) $var title: $:task.get_name(user_manager.session_language()) - $:user_realname - $:course.get_name(user_manager.session_language()) $ is_admin = user_manager.has_admin_rights_on_course(course) $var Column: $:template_helper.call('course_admin_menu',course=course,current='students') $def NavbarF(): $var Navbar: $:NavbarF()

$:_("Submission {}").format(str(submission['_id'])[0:10]) - "$:task.get_name(user_manager.session_language())" - $user_realname ($username)

$:_("This page show what was shown to the student when (s)he made his/her submission.")
$if "result" in submission: $if is_admin:
$if is_admin:
$:task.get_context(user_manager.session_language())
$ visible_tags = [tag for tag in task.get_tags()[0] if tag.is_visible_for_student() or user_manager.has_staff_rights_on_course(course)] $ visible_misconception_tags = [tag for tag in task.get_tags()[1] if tag.is_visible_for_student() or user_manager.has_staff_rights_on_course(course)] $# Auto tags may appear for admins. So we force the h3 title even if there is not predefined tags $# We do not show the tag header for students if they can not get tags $if (len(visible_tags) > 0) or (len(visible_misconception_tags) > 0) or user_manager.has_staff_rights_on_course(course):

$:_("Tags")

$for tag in visible_tags: $:_(tag.get_name()) $for tag in visible_misconception_tags:
$ task_problems = {problem.get_id(): problem for problem in task.get_problems()} $for key, problem in enumerate(to_display):

Question ${key+1}: $problem["name"]

$if problem["id"] in task_problems: $:task_problems[problem["id"]].show_input(template_helper, user_manager.session_language(), username) $elif not problem["defined"]: $:_("This problem id is not defined in the task.") $else: $:_("This problem is not present in the submission.")