salmon.triplets.manager.HTML
- pydantic settings salmon.triplets.manager.HTML
Stylistic settings to configure the HTML page.
The default configuration is specified completely below, which is rendered into a YAML file in an example.
Arbitrary keys are allowed in this class (which might allow for customization on the HTML page).
Show JSON schema
{ "title": "HTML", "description": "Stylistic settings to configure the HTML page.\n\nThe default configuration is specified completely below, which is rendered into a YAML file in `an example`_.\n\n.. _an example: https://github.com/stsievert/salmon/blob/master/examples/default.yaml\n\nArbitrary keys are allowed in this class\n(which might allow for customization on the HTML page).", "type": "object", "properties": { "title": { "title": "Title", "description": "The title of the HTML page (the text shown in the tab bar)", "default": "Similarity judgements", "env_names": "{'title'}", "type": "string" }, "instructions": { "title": "Instructions", "description": "The instructions the user sees above each query.", "default": "Please select the <i>comparison</i> item that is most similar to the <i>target</i> item.", "env_names": "{'instructions'}", "type": "string" }, "debrief": { "title": "Debrief", "description": "The message that the user sees after ``max_queries`` responses\n have been completed. The participant ID (``puid``) is shown below\n this message.", "default": "<b>Thanks!</b> Please use the participant ID below.", "env_names": "{'debrief'}", "type": "string" }, "skip_button": { "title": "Skip Button", "description": "Wheter to show a button to skip queries. Most\n useful when participants are instructed to skip queries only when the\n know nothing about any object.", "default": false, "env_names": "{'skip_button'}", "type": "boolean" }, "css": { "title": "Css", "description": "CSS to be included the in the query page. This CSS is\n inserted just before the ``</style>`` tag in the HTML head.", "default": "", "env_names": "{'css'}", "type": "string" }, "max_queries": { "title": "Max Queries", "description": "The number of queries that the user will answer before\n seeing the ``debrief`` message). Set ``max_queries=0`` or\n ``max_queries=-1`` to ask unlimited queries.", "default": 50, "env_names": "{'max_queries'}", "type": "integer" }, "arrow_keys": { "title": "Arrow Keys", "description": "Wheter to allow using the arrow keys as input. Specifying\n ``arrow_keys=True`` might allow bad input (though there is a delay of\n 200ms between queries).", "default": true, "env_names": "{'arrow_keys'}", "type": "boolean" }, "query_params": { "title": "Query Params", "description": "A list of flags to include in the params to /query.\n The default is ``query_params=['puid']``, which hits the endpoint\n ``/query?puid=foo`` if the participant's UID is ``foo``. Developers\n writing custom query pages might be interested in customizing this\n value.\n ", "default": [ "puid" ], "env_names": "{'query_params'}", "type": "array", "items": { "type": "string" } }, "js": { "title": "Js", "description": "JavaScript to include in standalone ``<script>`` tag", "default": "", "env_names": "{'js'}", "type": "string" }, "element_top": { "title": "Element Top", "description": "Custom HTML to include at top of page", "default": "", "env_names": "{'element_top'}", "type": "string" }, "element_middle": { "title": "Element Middle", "description": "Custom HTML to include in middle of page (between target and comparisons)", "default": "", "env_names": "{'element_middle'}", "type": "string" }, "element_bottom": { "title": "Element Bottom", "description": "Custom HTML to include at top of page (above footer)", "default": "", "env_names": "{'element_bottom'}", "type": "string" }, "element_standalone": { "title": "Element Standalone", "description": "Custom HTML to include as a standalone element, only\n encased in the ``head`` tag.\n ", "default": "", "env_names": "{'element_standalone'}", "type": "string" } } }
- Config
extra: str = allow
- Fields
- field arrow_keys: bool = True
Wheter to allow using the arrow keys as input. Specifying
arrow_keys=True
might allow bad input (though there is a delay of 200ms between queries).
- field css: str = ''
CSS to be included the in the query page. This CSS is inserted just before the
</style>
tag in the HTML head.
- field debrief: str = '<b>Thanks!</b> Please use the participant ID below.'
The message that the user sees after
max_queries
responses have been completed. The participant ID (puid
) is shown below this message.
- field element_bottom: str = ''
Custom HTML to include at top of page (above footer)
- field element_middle: str = ''
Custom HTML to include in middle of page (between target and comparisons)
- field element_standalone: str = ''
Custom HTML to include as a standalone element, only encased in the
head
tag.
- field element_top: str = ''
Custom HTML to include at top of page
- field instructions: str = 'Please select the <i>comparison</i> item that is most similar to the <i>target</i> item.'
The instructions the user sees above each query.
- field js: str = ''
JavaScript to include in standalone
<script>
tag
- field max_queries: int = 50
The number of queries that the user will answer before seeing the
debrief
message). Setmax_queries=0
ormax_queries=-1
to ask unlimited queries.
- field query_params: List[str] = ['puid']
A list of flags to include in the params to /query. The default is
query_params=['puid']
, which hits the endpoint/query?puid=foo
if the participant’s UID isfoo
. Developers writing custom query pages might be interested in customizing this value.
- field skip_button: bool = False
Wheter to show a button to skip queries. Most useful when participants are instructed to skip queries only when the know nothing about any object.
- field title: str = 'Similarity judgements'
The title of the HTML page (the text shown in the tab bar)