inginious.frontend.pages.course_admin package

Course administration

Submodules

inginious.frontend.pages.course_admin.aggregation_edit module

Pages that allow editing of tasks

class inginious.frontend.pages.course_admin.aggregation_edit.CourseEditAggregation[source]

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

Edit a task

GET_AUTH(courseid, aggregationid='')[source]

Edit a aggregation

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

Edit a aggregation

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

Get the available student and tutor lists for aggregation edition

update_aggregation(course, aggregationid, new_data)[source]

Update aggregation and returns a list of errored students

inginious.frontend.pages.course_admin.aggregation_info module

class inginious.frontend.pages.course_admin.aggregation_info.CourseAggregationInfoPage[source]

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

List information about a aggregation

GET_AUTH(courseid, aggregationid)[source]

GET request

page(course, aggregationid)[source]

Get all data and display the page

submission_url_generator(aggregationid, taskid)[source]

Generates a submission url

inginious.frontend.pages.course_admin.aggregation_list module

class inginious.frontend.pages.course_admin.aggregation_list.CourseAggregationListPage[source]

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

Course administration page: list of aggregations

GET_AUTH(courseid)[source]

GET request

POST_AUTH(courseid)[source]

POST request

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

Get all data and display the page

submission_url_generator(aggregationid)[source]

Generates a submission url

inginious.frontend.pages.course_admin.aggregation_task module

inginious.frontend.pages.course_admin.classroom_edit module

Pages that allow editing of tasks

class inginious.frontend.pages.course_admin.classroom_edit.CourseEditClassroom[source]

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

Edit a task

GET_AUTH(courseid, classroomid)[source]

Edit a classroom

POST_AUTH(courseid, classroomid)[source]

Edit a classroom

get_user_lists(course, classroomid)[source]

Get the available student and tutor lists for classroom edition

update_classroom(course, classroomid, new_data)[source]

Update classroom and returns a list of errored students

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 classrooms

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]
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.download module

class inginious.frontend.pages.course_admin.download.CourseDownloadSubmissions[source]

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

Batch operation management

GET_AUTH(courseid)[source]

GET request

POST_AUTH(courseid)[source]

GET request

valid_formats()[source]

inginious.frontend.pages.course_admin.settings module

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

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

Couse settings

GET_AUTH(courseid)[source]

GET request

POST_AUTH(courseid)[source]

POST request

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

Get all data and display the page

inginious.frontend.pages.course_admin.student_info module

class inginious.frontend.pages.course_admin.student_info.CourseStudentInfoPage[source]

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

List information about a student

GET_AUTH(courseid, username)[source]

GET request

page(course, username)[source]

Get all data and display the page

submission_url_generator(username, taskid)[source]

Generates a submission url

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

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

Get all data and display the page

submission_url_generator(username)[source]

Generates a submission url

inginious.frontend.pages.course_admin.student_task module

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]
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

classmethod dict_from_prefix(prefix, dictionary)[source]
>>> from collections import OrderedDict
>>> od = OrderedDict()
>>> od["problem[q0][a]"]=1
>>> od["problem[q0][b][c]"]=2
>>> od["problem[q1][first]"]=1
>>> od["problem[q1][second]"]=2
>>> AdminCourseEditTask.dict_from_prefix("problem",od)
OrderedDict([('q0', OrderedDict([('a', 1), ('b', OrderedDict([('c', 2)]))])), ('q1', OrderedDict([('first', 1), ('second', 2)]))])
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.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)

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_info module

class inginious.frontend.pages.course_admin.task_info.CourseTaskInfoPage[source]

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

List informations about a task

GET_AUTH(courseid, taskid)[source]

GET request

aggregation_submission_url_generator(task, aggregation)[source]

Generates a submission url

individual_submission_url_generator(task, task_data)[source]

Generates a submission url

page(course, task)[source]

Get all data and display the page

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

page(course)[source]

Get all data and display the page

submission_url_generator(taskid)[source]

Generates a submission url

inginious.frontend.pages.course_admin.utils module

Utilities for administration pages

class inginious.frontend.pages.course_admin.utils.CourseRedirect[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

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 web.notfound() when there is no such course of if the users has not enough rights.

Parameters:
  • courseid – the course on which to check rights
  • taskid – If not None, returns also the task with id taskid
  • allow_all_staff – allow admins AND tutors to see the page. If false, all only admins.

:returns (Course, Task)

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

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

An INGIniousAdminPage containing some common methods between download/replay pages

get_selected_submissions(course, filter_type, selected_tasks, users, aggregations, stype)[source]

Returns the submissions that have been selected by the admin :param course: course :param filter_type: users or aggregations :param selected_tasks: selected tasks id :param users: selected usernames :param aggregations: selected aggregations :param stype: single or all submissions :return:

show_page_params(course, user_input)[source]
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