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: inginious.frontend.pages.course_admin.utils.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: ClassVar[Optional[Collection[str]]] = {'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: inginious.frontend.pages.course_admin.utils.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: ClassVar[Optional[Collection[str]]] = {'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: inginious.frontend.pages.course_admin.utils.INGIniousAdminPage

Couse settings

GET_AUTH(courseid)[source]

GET request

POST_AUTH(courseid)[source]

POST request

methods: ClassVar[Optional[Collection[str]]] = {'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

inginious.frontend.pages.course_admin.student_list module

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

Bases: inginious.frontend.pages.course_admin.utils.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_student_list_params(course)[source]
get_user_lists(course)[source]

Get the available student list for group edition

methods: ClassVar[Optional[Collection[str]]] = {'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: inginious.frontend.pages.course_admin.utils.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: ClassVar[Optional[Collection[str]]] = {'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

Pages that allow editing of tasks

class inginious.frontend.pages.course_admin.task_edit.CourseEditTask[source]

Bases: inginious.frontend.pages.course_admin.utils.INGIniousAdminPage

Edit a task

GET_AUTH(courseid, taskid)[source]

Edit a task

POST_AUTH(courseid, taskid)[source]

Edit a task

classmethod contains_is_html(data)[source]

Detect if the problem has at least one “xyzIsHTML” key

methods: ClassVar[Optional[Collection[str]]] = {'GET', 'POST'}

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

parse_problem(problem_content)[source]

Parses a problem, modifying some data

wipe_task(courseid, taskid)[source]

Wipe the data associated to the taskid from DB

inginious.frontend.pages.course_admin.task_edit_file module

Allow to create/edit/delete/move/download files associated to tasks

class inginious.frontend.pages.course_admin.task_edit_file.CourseTaskFileUpload[source]

Bases: inginious.frontend.pages.course_admin.task_edit_file.CourseTaskFiles

POST_AUTH(courseid, taskid)[source]

Upload or modify a file

methods: ClassVar[Optional[Collection[str]]] = {'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.task_edit_file.CourseTaskFiles[source]

Bases: inginious.frontend.pages.course_admin.utils.INGIniousAdminPage

Edit a task

GET_AUTH(courseid, taskid)[source]

Edit a task

POST_AUTH(courseid, taskid)[source]

Upload or modify a file

action_create(courseid, taskid, path)[source]

Delete a file or a directory

action_delete(courseid, taskid, path)[source]

Delete a file or a directory

action_download(courseid, taskid, path)[source]

Download a file or a directory

action_edit(courseid, taskid, path)[source]

Edit a file

action_edit_save(courseid, taskid, path, content)[source]

Save an edited file

action_rename(courseid, taskid, path, new_path)[source]

Delete a file or a directory

action_upload(courseid, taskid, path, fileobj)[source]

Upload a file

classmethod get_task_filelist(task_factory, courseid, taskid)[source]

Returns a flattened version of all the files inside the task directory, excluding the files task.* and hidden files. It returns a list of tuples, of the type (Integer Level, Boolean IsDirectory, String Name, String CompleteName)

methods: ClassVar[Optional[Collection[str]]] = {'GET', 'POST'}

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

show_tab_file(courseid, taskid, error=None)[source]

Return the file tab

verify_path(courseid, taskid, path, new_path=False)[source]

Return the real wanted path (relative to the INGInious root) or None if the path is not valid/allowed

inginious.frontend.pages.course_admin.task_list module

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

Bases: inginious.frontend.pages.course_admin.utils.INGIniousAdminPage

List informations about all tasks

GET_AUTH(courseid)[source]

GET request

POST_AUTH(courseid)[source]

POST request

methods: ClassVar[Optional[Collection[str]]] = {'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

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: inginious.frontend.pages.course_admin.utils.INGIniousAdminPage

Redirect admins to /settings and tutors to /task

GET_AUTH(courseid)[source]

GET request

POST_AUTH(courseid)[source]

POST request

methods: ClassVar[Optional[Collection[str]]] = {'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: inginious.frontend.pages.utils.INGIniousAuthPage

An improved version of INGIniousAuthPage that checks rights for the administration

get_course_and_check_rights(courseid, taskid=None, allow_all_staff=True)[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. :param courseid: the course on which to check rights :param taskid: If not None, returns also the task with id taskid :param allow_all_staff: allow admins AND tutors to see the page. If false, all only admins. :returns (Course, Task)

methods: ClassVar[Optional[Collection[str]]] = {'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: inginious.frontend.pages.course_admin.utils.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: ClassVar[Optional[Collection[str]]] = {'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