Value#
- class alfred3.element.misc.Value(value: Union[str, int, float], name: str, description: str = '')[source]#
Bases:
alfred3.element.core.InputElement
Value elements can be used to save data without any display.
- Parameters
value – The value that you want to save.
name – Name of the element. This should be a unique identifier. It will be used to identify the corresponding data in the final data set.
Examples
Minimal example:
import alfred3 as al exp = al.Experiment() @exp.member class Demo(al.Page): name = "demo1" def on_exp_access(self): self += al.Value("test", name="myvalue")
Methods
Adds CSS to the element.
Adds Javascript to the element.
Tells the element that it was added to an experiment.
Tells the element that it was added to a page.
Hook for computations for preparing an element's web widget.
Renders the element template
element_template
.Sets the
input
data.Method for validation of input to the element.
Attributes
Base template for the element, which will be used to hold the rendered element template.
Label below of the main element widget.
Information about the element in dictionary form.
List of bootstrap column widths at different screen sizes.
Shortcut for accessing the element's corrective hints.
Returns the name the element container's CSS class.
Returns the name of the element's CSS class.
A list of tuples, which contain a priority and CSS code.
A list of tuples, which contain a priority and an url pointing to CSS code.
Dictionary of element data.
Boolean flag, indicating whether debug mode is enabled and default values should be set.
Value to be used as a default in debug mode.
Default value of this element.
Default hint if subject input is missing in force_entry elements.
Detailed description of this element to be added to the automatically generated codebook
A boolean flag, indicating whether the element is disabled A disabled input element is shown and displays its input value, but subjects cannot enter any data.
If True (default), the element will be displayed as usual on its own.
The element's specific, inner template.
Returns a string of column width definitions.
The experiment session to which this element belongs.
Alias for
exp
Font size
If True, subjects must fill this element to proceed.
A
MessageManager
, handling the corrective hints for this element.The value that you want to save.
A list of tuples, which contain a priority and Javascript.
A list of tuples, which contain a priority and an url pointing to JavaScript.
Returns the labels in a single, nicely formatted string.
Controls the allocation of horizontal space between the left and right label, as well as the main element.
Label to the left of the main element widget.
Unique identifier for the element.
Hint for subjects, if they left a force_input field empty.
The page to which this element belongs.
Position of the whole element on the page.
A string or element, serving as prefix.
Label to the right of the main element widget.
The direct parent section of this element's page.
String, giving the exact position in the experiment.
Boolean, indicating whether the element is meant to be shown.
Flag, indicating whether corrective hints regarding this element should be shown.
Conditions that have to be met for the element to be shown.
A string or element, serving as suffix.
Dictionary of data to be passed on to jinja templates.
Label above of the main element widget.
String, giving the exact position in the experiment.
The element's rendered html code for display on a page.
Element width