inginious.frontend.pages.course_admin package

Course administration

Submodules

inginious.frontend.pages.course_admin.audience_edit module

Pages that allow editing of tasks

class inginious.frontend.pages.course_admin.audience_edit.CourseEditAudience[source]

Bases: INGIniousAdminPage

Edit a task

GET_AUTH(courseid, audienceid)[source]

Edit a audience

POST_AUTH(courseid, audienceid='')[source]

Edit a audience

display_page(course, audienceid, msg='', error=False)[source]
get_user_lists(course, audienceid='')[source]

Get the available student and tutor lists for audience edition

methods: t.ClassVar[t.Collection[str] | None] = {'GET', 'POST'}

The methods this view is registered for. Uses the same default (["GET", "HEAD", "OPTIONS"]) as route and add_url_rule by default.

inginious.frontend.pages.course_admin.danger_zone module

class inginious.frontend.pages.course_admin.danger_zone.CourseDangerZonePage[source]

Bases: INGIniousAdminPage

Course administration page: list of audiences

GET_AUTH(courseid)[source]

GET request

POST_AUTH(courseid)[source]

POST request

delete_course(courseid)[source]

Erase all course data

dump_course(courseid)[source]

Create a zip file containing all information about a given course in database and then remove it from db

get_backup_list(course)[source]
methods: t.ClassVar[t.Collection[str] | None] = {'GET', 'POST'}

The methods this view is registered for. Uses the same default (["GET", "HEAD", "OPTIONS"]) as route and add_url_rule by default.

page(course, msg='', error=False)[source]

Get all data and display the page

restore_course(courseid, backup)[source]

Restores a course of given courseid to a date specified in backup (format : YYYYMMDD.HHMMSS)

wipe_course(courseid)[source]

inginious.frontend.pages.course_admin.settings module

class inginious.frontend.pages.course_admin.settings.CourseSettingsPage[source]

Bases: INGIniousAdminPage

Couse settings

GET_AUTH(courseid)[source]

GET request

POST_AUTH(courseid)[source]

POST request

define_course_user_settings(data)[source]

Course user settings definition method

define_tags(course, data, course_content)[source]
methods: t.ClassVar[t.Collection[str] | None] = {'GET', 'POST'}

The methods this view is registered for. Uses the same default (["GET", "HEAD", "OPTIONS"]) as route and add_url_rule by default.

page(course, errors=None, saved=False)[source]

Get all data and display the page

prepare_datas(data, prefix)[source]

inginious.frontend.pages.course_admin.student_list module

class inginious.frontend.pages.course_admin.student_list.CourseStudentListPage[source]

Bases: INGIniousAdminPage

Course administration page: list of registered students

GET_AUTH(courseid)[source]

GET request

POST_AUTH(courseid)[source]

POST request

get_audiences_params(course)[source]
get_requested_field_user_info(username, preferred_field)[source]
get_student_list_params(course)[source]
get_user_lists(course)[source]

Get the available student list for group edition

methods: t.ClassVar[t.Collection[str] | None] = {'GET', 'POST'}

The methods this view is registered for. Uses the same default (["GET", "HEAD", "OPTIONS"]) as route and add_url_rule by default.

page(course, active_tab='tab_students', msg=None, error=None)[source]

Get all data and display the page

post_audiences(course, data, active_tab, msg, error)[source]
post_groups(course, data, active_tab, msg, error)[source]
post_student_list(course, data)[source]
submission_url_generator_audience(audienceid)[source]

Generates a submission url

submission_url_generator_user(username)[source]

Generates a submission url

update_audience(course, audienceid, new_data)[source]

Update audience and returns a list of errored students

update_group(course, groupid, new_data, audience_students)[source]

Update group and returns a list of errored students

inginious.frontend.pages.course_admin.submission module

class inginious.frontend.pages.course_admin.submission.SubmissionPage[source]

Bases: INGIniousAdminPage

List information about a task done by a student

GET_AUTH(submissionid)[source]

GET request

POST_AUTH(submissionid)[source]
fetch_submission(submissionid)[source]
methods: t.ClassVar[t.Collection[str] | None] = {'GET', 'POST'}

The methods this view is registered for. Uses the same default (["GET", "HEAD", "OPTIONS"]) as route and add_url_rule by default.

page(course, task, submission)[source]

Get all data and display the page

inginious.frontend.pages.course_admin.task_edit module

inginious.frontend.pages.course_admin.task_edit_file module

inginious.frontend.pages.course_admin.task_list module

class inginious.frontend.pages.course_admin.task_list.CourseTaskListPage[source]

Bases: INGIniousAdminPage

List informations about all tasks

GET_AUTH(courseid)[source]

GET request

POST_AUTH(courseid)[source]

POST request

methods: t.ClassVar[t.Collection[str] | None] = {'GET', 'POST'}

The methods this view is registered for. Uses the same default (["GET", "HEAD", "OPTIONS"]) as route and add_url_rule by default.

page(course, errors=None, validated=False)[source]

Get all data and display the page

submission_url_generator(taskid)[source]

Generates a submission url

update_dispenser(course, dispenser_data)[source]

Update the task dispenser based on dispenser_data

wipe_task(courseid, taskid)[source]

Wipe the data associated to the taskid from DB

inginious.frontend.pages.course_admin.utils module

Utilities for administration pages

class inginious.frontend.pages.course_admin.utils.CourseRedirectPage[source]

Bases: INGIniousAdminPage

Redirect admins to /settings and tutors to /task

GET_AUTH(courseid)[source]

GET request

POST_AUTH(courseid)[source]

POST request

methods: t.ClassVar[t.Collection[str] | None] = {'GET', 'POST'}

The methods this view is registered for. Uses the same default (["GET", "HEAD", "OPTIONS"]) as route and add_url_rule by default.

class inginious.frontend.pages.course_admin.utils.INGIniousAdminPage[source]

Bases: INGIniousAuthPage

An improved version of INGIniousAuthPage that checks rights for the administration

get_course_and_check_rights(courseid, taskid=None)[source]

Returns the course with id courseid and the task with id taskid, and verify the rights of the user. Raise app.forbidden() when there is no such course of if the users has not enough rights. :type courseid: :param courseid: the course on which to check rights :type taskid: :param taskid: If not None, returns also the task with id taskid :returns (Course, Task)

methods: t.ClassVar[t.Collection[str] | None] = {'GET', 'POST'}

The methods this view is registered for. Uses the same default (["GET", "HEAD", "OPTIONS"]) as route and add_url_rule by default.

class inginious.frontend.pages.course_admin.utils.INGIniousSubmissionsAdminPage[source]

Bases: INGIniousAdminPage

An INGIniousAdminPage containing some common methods for querying submissions

get_course_params(course, params)[source]
get_input_params(user_input, course, limit=50)[source]
get_submissions_filter(course, only_tasks=None, only_tasks_with_categories=None, only_users=None, only_audiences=None, with_tags=None, grade_between=None, submit_time_between=None, keep_only_evaluation_submissions=False, keep_only_crashes=False)[source]

All the parameters (excluding course, sort_by and keep_only_evaluation_submissions) can be None. If that is the case, they are ignored.

Parameters:
  • course – the course

  • only_tasks – a list of task ids. Only submissions on these tasks will be loaded.

  • only_tasks_with_categories – keep only tasks that have a least one category in common with this list

  • only_users – a list of usernames. Only submissions from these users will be loaded.

  • only_audiences – a list of audience ids. Only submissions from users in these will be loaded

  • with_tags – a list of tags in the form [(tagid, present)], where present is a boolean indicating whether the tag MUST be present or MUST NOT be present. If you don’t mind if a tag is present or not, just do not put it in the list.

  • grade_between – a tuple of two floating point number or None ([0.0, None], [None, 0.0] or [None, None]) that indicates bounds on the grade of the retrieved submissions

  • submit_time_between – a tuple of two dates or None ([datetime, None], [None, datetime] or [None, None]) that indicates bounds on the submission time of the submission. Format: “%Y-%m-%d %H:%M:%S”

  • keep_only_evaluation_submissions – True to keep only submissions that are counting for the evaluation

  • keep_only_crashes – True to keep only submissions that timed out or crashed

  • sort_by – a tuple (sort_column, ascending) where sort_column is in [“submitted_on”, “username”, “grade”, “taskid”] and ascending is either True or False.

  • limit – an integer representing the maximum number of submission to list.

Returns:

the filter for the mongoDB search.

get_users(course)[source]
methods: t.ClassVar[t.Collection[str] | None] = {'GET', 'POST'}

The methods this view is registered for. Uses the same default (["GET", "HEAD", "OPTIONS"]) as route and add_url_rule by default.

class inginious.frontend.pages.course_admin.utils.UnicodeWriter(f, dialect=<class 'csv.excel'>, encoding='utf-8', **kwds)[source]

Bases: object

A CSV writer which will write rows to CSV file “f”, which is encoded in the given encoding.

writerow(row)[source]

Writes a row to the CSV file

writerows(rows)[source]

Writes multiple rows to the CSV file

inginious.frontend.pages.course_admin.utils.get_menu(course, current, renderer, plugin_manager, user_manager)[source]

Returns the HTML of the menu used in the administration. `current` is the current page of section

inginious.frontend.pages.course_admin.utils.make_csv(data)[source]

Returns the content of a CSV file with the data of the dict/list data