$def with (user_info, course, task, submissions, students, eval_submission, user_task, previous_taskid, next_taskid, webterm_link, input_random_list=[]) $# $# This file is part of INGInious. See the LICENSE and the COPYRIGHTS files for $# more information about the licensing of this file. $# $var title: $:task.get_name(user_manager.session_language()) - $:course.get_name(user_manager.session_language()) $ registered = user_manager.course_is_user_registered(course) $ staff = user_manager.has_staff_rights_on_course(course) $# Left column content $def ColumnF():

$:_("Information")

$if task.get_authors(user_manager.session_language()): $if not is_lti(): $if registered or staff: $if not is_lti(): $ tags = "" $for tag in task.get_tags()[2]: $if tag.is_visible_for_student() or user_manager.has_staff_rights_on_course(course): $ tags += (_(tag.get_name()) + ", ") $ tags = tags[:-2] $if tags != "":
$:_("Author(s)") $task.get_authors(user_manager.session_language())
$:_("Deadline") $task.get_deadline()
$:_("Status") $if not eval_submission and len(submissions) == 0: $:_("Not yet attempted") $elif eval_submission is not None and eval_submission["status"] == "done" and eval_submission["result"] == "success": $:_("Succeeded") $else: $ waiting=False $for submission in submissions: $if submission["status"] == "waiting": $ waiting=True $break $if waiting: $:_("Waiting for verification") $else: $:_("Failed")
$:_("Grade") $user_task.get('grade', 0)%
$:_("Grading weight") $task.get_grading_weight()
$:_("Attempts") $(user_task.get('tried', 0))
$:_("Submission limit") $ submission_limit = task.get_submission_limit() $if submission_limit == {"amount":-1, "period":-1}: $:_("No limitation") $else: $if submission_limit["period"] > 0: $:_("{nb_submissions} submissions
every {nb_hours} hour(s)").format(nb_submissions=submission_limit["amount"], nb_hours=submission_limit["period"]) $else: $:_("{nb_submissions} submissions").format(nb_submissions=submission_limit["amount"])
Category Tags $tags
$ 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:

$:_("Tags")

$for tag in visible_tags: $:_(tag.get_name()) $for tag in visible_misconception_tags:
$if not is_lti() and staff:

$:_("Administration")

$if not course.is_open_to_non_staff(): $if not task.get_accessible_time().after_start():
  $:_("View submissions") $if user_manager.has_admin_rights_on_course(course):   $:_("Edit task")   $:_("Debug information")
$elif not is_lti() and registered:

$:_("Submitting as")

$if task.is_group_task():   $(_('Group') if course.use_classrooms() else _('Team')) $else:   $user_manager.session_realname()
  $ myaggregation = user_manager.get_course_user_aggregation(course) $if course.use_classrooms(): $:_("Classroom : {}").format(myaggregation["description"]) $elif len(myaggregation['groups']) > 0 and user_manager.session_username() in myaggregation['groups'][0]['students']: $:_("Team : {}").format(myaggregation['description']) $else: $:_("Teams management")
$:template_helper.call('task_menu', course=course, task=task, template_helper=template_helper) $if registered:

$:_("For evaluation")

$if task.get_evaluate() == "last": $:_("Last submission") $elif task.get_evaluate() == "best": $:_("Best submission") $else: $:_("Selected submission")
$if eval_submission: $eval_submission["submitted_on"].strftime("%d/%m/%Y %H:%M:%S") - $eval_submission.get("grade",0.0)% $else:
$:_("No submission")
$if len([method for key, method in user_manager.get_auth_methods().items() if method.allow_share()]): $:_("Share my result")

$:_("Submission history")

$elif not user_manager.session_logged_in(): $:include.signin_button() $elif course.is_registration_possible(user_info): $:include.register_button(course) $var Column: $:ColumnF() $def NavbarF(): $var Navbar: $:NavbarF() $# Start content

$task.get_name(user_manager.session_language())
$if not is_lti():
$if previous_taskid: $if next_taskid:

$# Input random $# set up some useful variable that may be used by task author $# variable "input" has to be accessible to the eventual javascript present in the context of the task. $:task.get_context(user_manager.session_language())
$if user_manager.has_admin_rights_on_course(course): $if is_lti(): $ action = "/lti/task" $else: $ action = "/course/" + course.get_id() + "/" + task.get_id()
$# Hide input random in form $ i = 0 $for elem in input_random_list: $ i = i+1 $for key, problem in enumerate(task.get_problems()):
$if len(task.get_problems()) != 1 or problem.get_name(user_manager.session_language()) != "":

$if len(task.get_problems()) != 1: $:_("Question {}").format(str(key+1)): $problem.get_name(user_manager.session_language())

$:problem.show_input(template_helper, user_manager.session_language(), user_manager.session_username())
$# no need to check with lti=True/False here as it was already checked by the calling python script. $ groups_ok = user_manager.task_can_user_submit(task, user_manager.session_username(), 'groups') $ tokens_ok = user_manager.task_can_user_submit(task, user_manager.session_username(), 'tokens') $if not registered: $elif groups_ok and tokens_ok: $if user_manager.has_admin_rights_on_course(course):
$else: $elif not task.get_accessible_time().is_open(): $elif task.is_group_task() and not groups_ok: $(_('Please register in a group') if course.use_classrooms() else _('Please register in a team')) $elif not tokens_ok: $else:
$ auth_methods = user_manager.get_auth_methods()