research_client.atolc

Data structures for the AToL Questionnaire (RML).

Functions

alphabetise(dictionary)

Return a dict in alphabetised order.

arrange_data(data)

Orders data so that meta info is consistent with other tasks in the app.

arrange_order(dict, source)

Records order in which traits were presented for a given trial, then orders them alphabetically for write readability

atol_c_get_items(version)

Get label pairs for each AToL item depending on language selection.

atol_end(data)

Redirect participant in right sequence after AToL-C end screen.

fetch_location(source_file, version)

Finds which html page to load next.

get_id(dict)

Returns a participant ID

grab_atol_ratings(myData, source, ...)

Does the same as init_atol, but for ratings

init_atol(myData)

Retrieves initial info from index.html and prints to file & to terminal.

key_list(dic)

Return the keys of a dictionary.

randomize(dictionary)

Return a dict in randomized order.

Classes

Response

Class for representing the data of an LSBQ-RML questionnaire response.

class Response[source]

Bases: DataSchema

Class for representing the data of an LSBQ-RML questionnaire response.

__init__(id_=None)[source]

Instantiates a new LSBQ-RML response object.

Parameters:

id_ (Optional[int])

setmeta(data)[source]

Sets the metadata for the response.

Return type:

None

Parameters:

data (dict[str, Any])

__schema = {'id': {'constraint': (0, 9223372036854775807), 'type_': <class 'int'>, 'typedesc': 'LSBQ-RML Response ID'}, 'language1': {'ambiguous': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of ambiguous'}, 'appealing': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of appealing'}, 'ballsy': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of ballsy'}, 'beautiful': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of beautiful'}, 'elegant': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of elegant'}, 'flowing': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of flowing'}, 'fluent': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of fluent'}, 'graceful': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of graceful'}, 'logical': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of logical'}, 'pleasant': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of pleasant'}, 'precise': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of precise'}, 'round': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of round'}, 'smooth': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of smooth'}, 'soft': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of soft'}, 'structured': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of structured'}, 'systematic': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of systematic'}}, 'language2': {'ambiguous': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of ambiguous'}, 'appealing': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of appealing'}, 'ballsy': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of ballsy'}, 'beautiful': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of beautiful'}, 'elegant': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of elegant'}, 'flowing': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of flowing'}, 'fluent': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of fluent'}, 'graceful': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of graceful'}, 'logical': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of logical'}, 'pleasant': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of pleasant'}, 'precise': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of precise'}, 'round': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of round'}, 'smooth': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of smooth'}, 'soft': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of soft'}, 'structured': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of structured'}, 'systematic': {'constraint': (0, 100), 'type_': <class 'float'>, 'typedesc': 'rating of systematic'}}, 'meta': {'consent': {'constraint': ({'true', True, 'yes', '1', 'on'}, {False, 'false', 'off', 'no', '0'}), 'type_': typing.Union[tuple[typing.Iterable[typing.Any], typing.Iterable[typing.Any]], list[typing.Iterable[typing.Any]]], 'typedesc': 'consent confirmation'}, 'date': {'constraint': '[0-9]{1,4}\\-(0?[1-9]|1[0-2])\\-(0?[1-9]|[12][0-9]|3[01])', 'type_': <class 'str'>, 'typedesc': 'current date'}, 'participant_id': {'constraint': '[A-Za-z0-9]{3,10}', 'type_': <class 'str'>, 'typedesc': 'Participant ID'}, 'research_location': {'constraint': "[\\w,' \\(\\)\\.\\-]{1,50}", 'type_': <class 'str'>, 'typedesc': 'location name'}, 'researcher_id': {'constraint': '[A-Za-z0-9]{3,10}', 'type_': <class 'str'>, 'typedesc': 'Researcher ID'}, 'version': {'constraint': '\\w{13,17}', 'type_': <class 'str'>, 'typedesc': 'LSBQ-RML version identifier'}}}

Type:    dict

_atol_getversions()[source]

Retrieves the available versions of the AToL.

Return type:

dict[str, str]

alphabetise(dictionary)[source]

Return a dict in alphabetised order.

Return type:

dict[str, Any]

Parameters:

dictionary (dict[str, Any])

arrange_data(data)[source]

Orders data so that meta info is consistent with other tasks in the app.

arrange_order(dict, source)[source]

Records order in which traits were presented for a given trial, then orders them alphabetically for write readability

atol_c_get_items(version)[source]

Get label pairs for each AToL item depending on language selection.

Return type:

Optional[dict[str, tuple[str, str]]]

Parameters:

version (str)

atol_end(data)[source]

Redirect participant in right sequence after AToL-C end screen.

Return type:

str

Parameters:

data (dict[str, str])

fetch_location(source_file, version)[source]

Finds which html page to load next.

Return type:

Optional[str]

Parameters:
  • source_file (str)

  • version (str)

get_id(dict)[source]

Returns a participant ID

grab_atol_ratings(myData, source, version_id, partId, versN)[source]

Does the same as init_atol, but for ratings

Parameters:
  • myData (dict[Any, Any])

  • source (str)

  • version_id (str)

  • partId (str)

  • versN (str)

init_atol(myData)[source]

Retrieves initial info from index.html and prints to file & to terminal.

Return type:

None

Parameters:

myData (dict[str, str])

key_list(dic)[source]

Return the keys of a dictionary.

Return type:

Iterable[Any]

Parameters:

dic (dict[str, Any])

randomize(dictionary)[source]

Return a dict in randomized order.

Return type:

dict[str, Any]

Parameters:

dictionary (dict[str, Any])

Modules

research_client.atolc.patterns

Additional validation patterns for AToL-C.

research_client.atolc.testPyt

research_client.atolc.versions

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2).