Assignments

class AssignmentsApi(client, workspace=None)

Set of functions to access and manipulate Assignments.

get_list(questionnaire_id=None, questionnaire_version=None)

Get list of assignments

Parameters
  • questionnaire_id (Optional[str]) – Filter by specific questionnaire id

  • questionnaire_version (Optional[int]) – Filter by specific version number

Returns

list of Assignment objects

get_info(id)

Get single assignment details

Parameters

id (int) – Assignment Id

Returns

Assignment object

create(obj)

Create new assignment

Parameters

obj (Assignment) – Assignment object to be created

Returns

Newly created Assignment object

archive(id)

Archive assignment

Parameters

id (int) – Assignment Id

unarchive(id)

Unarchive assignment

Parameters

id (int) – Assignment Id

assign(id, responsible)

Assign new responsible person for assignment

Parameters
  • id (int) – Assignment Id

  • responsible (str) – Username of the new responsible

Returns

Modified Assignment object

get_quantity_settings(id)

Checi if quantity may be edited for the assignment

Parameters

id (int) – Assignment Id

Returns

True if quantity can be edited, False otherwise

update_quantity(id, quantity)

Change maximum quantity of interviews to be created

Parameters
  • id (int) – Assignment Id

  • quantity (int) – new quantity of interviews to be collected

Returns

Modified Assignment object

close(id)

Close assignment by setting Size to the number of collected interviews

Parameters

id (int) – Assignment Id

get_history(id)
get_recordaudio(id)

Get status of audio recording for the assignment

Parameters

id (int) – Assignment Id

Returns

True if audio recording is enabled, False otherwise

update_recordaudio(id, enabled)

Turn recording of audio for the assignment

Parameters
  • id (int) – Assignment Id

  • enabled (bool) – True to turn audio recording on, False to turn it off

get_calendar_event(id)

Get calendar event associated with the assignment

set_calendar_event(id, new_start, start_timezone, comment=None)

Add new calendar event to the assignment, or update the existing one

Parameters
  • id (int) – assignment id to update

  • new_start (str) – start date of the calendar event

  • start_timezone (str) – timezone string for the start date

  • comment (Optional[str]) – add comment to the calendar event

Returns

:class:`CalendarEvent’ object

delete_calendar_event(id)

Remove calendar event associated with the assignment

Assignment objects

class Assignment(responsible, quantity, questionnaire_id, identifying_data=None, email='', password='', webmode=False, audio_recording_enabled=False, comments='', protected_variables=None)

An assignment.

Parameters
  • responsible (str) – responsible username

  • quantity (int) – [description]

  • questionnaire_id – [description]

  • email (str) – [description], defaults to “”

  • password (str) – [description], defaults to “”

  • webmode (bool) – [description], defaults to False

  • audio_recording_enabled (bool) – [description], defaults to False

  • comments (str) – [description], defaults to “”