assistants.sync_agent

File contains functions that update the resources and assignments in the database.

Module Contents

assistants.sync_agent.module_update_or_create(module)

Create new resource or update resource of a certain course.

Parameters

module (dict(str,int)) – Contains the necessary info of the new resource.

assistants.sync_agent.module_delete(module)

Delete certain resource from a certain course.

Parameters

module (dict) – Contains the necessary info of the to be deleted course.

assistants.sync_agent.course_update_or_create(course)

Create or update a course entry in the database.

Parameters

course (dict(str, str)) – Contains all necessary info for a creation or an update.

assistants.sync_agent.course_delete(course)

Delete a course entry in the database.

Parameters

course (dict(str, str)) – contains all necessary info for a deletion.

assistants.sync_agent.user_assigned(user)

Check if a user is assigned the editteacher or manager role and if so, add them to the database.

Parameters

user (dict(str, str)) – information about the user.

assistants.sync_agent.user_unassigned(user)

Relieves a user from its privileges to edit the course in Mofa.

Parameters

user (dict(str, str)) – information about the user to perform the database change with.

assistants.sync_agent.user_deleted(user)

Delete a user from Mofa when it is deleted from the LMS.

Parameters

user (dict(str, str)) – information about the user to perform the database change with.

assistants.sync_agent.user_updated(user)

Update a user from Mofa if it exists in the database.

Parameters

user (dict(str, str)) – New information about the new user to perform the database change with.

assistants.sync_agent.question_update_create(q_info)

Update or create a question from Moodle.

Parameters

q_info (dict(str, str)) – Information about the question.

assistants.sync_agent.build_sync_agents()

Build a sync_agent based on if it already present in the database or not.

assistants.sync_agent.create_course_sync_agent()

Create a course sync agent.

assistants.sync_agent.create_user_sync_agent()

Create a user sync agent.

assistants.sync_agent.create_question_sync_agent()

Create a question sync agent.

assistants.sync_agent.send_update_notification(course, message)

Send a message to all admin users linked to the course.

Parameters
  • course (Course) – Course in which a module has changed.

  • message (str) – The message that has to be sent.