Members
(constant) ADMIN_LOGIN_REQUIRED
Error sent to an admin socket that is not logged in; admin pages then go to the login page.
- Source:
(constant) APP_HOOKS
App functions jtree calls.
- Source:
(constant) CLOSES
Elements an opening tag closes when one of them is the element open.
- Source:
(constant) STAGE_HOOKS
Stage functions jtree calls, with what they are given, in the order the editor lists them.
- Source:
(constant) compiled
Parsed programs, by their code.
- Source:
(constant) drawn
The screen last drawn for each player (without its number).
- Source:
(constant) tablesChangedTimers
Tells admins a session's z-Tree tables changed (at most every half second), to ask for them.
- Source:
Methods
addToClass()
A statement in a class: replaces its pass, or goes after the last of afterRanges (else at the class's end).
- Source:
allBoxes()
Every box of boxes, with its path ("1", "1.0" in a container) and the display conditions on it (its and its containers'): [box, path, conditions].
- Source:
appCSV()
One oTree app's data, as oTree exports it per app: a row per player and round.
- Source:
appFile()
The file an oTree app's folder is loaded from: its init.py (or older models.py).
- Source:
appFile()
A jtree app's file: one the jtree dialect reads (.jtt, .js).
- Source:
appInsertAt()
Where a new statement about the app goes: after the last app setting, or at the top.
- Source:
appRoots()
The folders apps are in, absolute.
- Source:
appTemplate()
A new app's init.py, as oTree Studio starts one.
- Source:
appToIR(app, fresh)
Describes a loaded jtree app as an IR. Programs are the source of its functions: one
that uses names from its app file other than app and Utils (a helper function defined
there, say) will not run from the IR.
Parameters:
| Name | Type | Description |
|---|---|---|
app |
App | |
fresh |
App | A new App for the same file, whose code has not run: what is the default. |
apply()
The source with op done. Ops:
- {op: 'setAppProp', name, value}, {op: 'removeAppProp', name}
- {op: 'addStage', name, after?}, {op: 'renameStage', name, to}, {op: 'deleteStage', name}
- {op: 'moveStage', name, to} (to: the stage's new index)
- {op: 'setStageProp', stage, name, value}, {op: 'removeStageProp', stage, name}
- {op: 'editScreen', stage?, name, edit}: a screen of the stage (of the app, with no stage),
changed by edit, as html.js's edit takes it; the rest of the screen stays as it was.
Values are as valueSource takes them.
- Source:
(async) apply()
The app's source with op done. Ops (code: Python source):
- {op: 'setConstant', name, code}, {op: 'removeConstant', name}
- {op: 'setField', model, name, field: {type, args: [{name, code}]}, to?}, {op: 'removeField', model, name}
- {op: 'setFunction', name, params, body}, {op: 'removeFunction', name}
- {op: 'addPage', name, kind: 'Page'|'WaitPage', after?}, {op: 'removePage', name}, {op: 'renamePage', name, to}
- {op: 'setPageSequence', names}
- {op: 'setPageAttr', page, name, code}, {op: 'removePageAttr', page, name}
- {op: 'setPageMethod', page, name, params, body}, {op: 'removePageMethod', page, name}
- Source:
applyIR()
Makes app (a new App, with any options given to it already set) the app ir describes.
Throws an Error listing ir's problems if it is not valid.
(async) applySettings()
The settings' source with op done:
- {op: 'setConfig', index, entries: [{key, code}]}, {op: 'addConfig', entries}, {op: 'removeConfig', index}
- {op: 'setSetting', name, code}, {op: 'removeSetting', name}
- Source:
arrayDeclarations()
The arrays a program declares (array X[n];), by table: {table: {name: [dimension expressions]}}.
- Source:
arrayDeclarations()
The arrays the treatment's programs declare, by table (see lang.js's arrayDeclarations).
- Source:
arrayIndex()
The position in arr of index i (rounded to its nearest, as z-Tree does).
- Source:
assignedVariables()
The variables a program sets, by table (its own table's, and do/new blocks' tables').
- Source:
attrSource()
An attribute as written, quoted with what it was quoted with, else ' (or " if the value has a ').
- Source:
boolValue()
true or false for text that says yes or no ('true', 'True', '1', 'yes', 'on', ...); else undefined.
botCases()
How many cases the bots of package pkg have (their PlayerBot's cases; 1 if none).
- Source:
boxOptions()
A box's placement flags, as ztt.js has them (options[1..7]; see render.js's place): whether
the box takes its part of the room from the left, right, top or bottom of what is left.
- Source:
chat()
A chat box: the table's entries that meet its condition, shown with its format; and an input.
- Source:
chatFor()
The session's chat with key: {messages, members (participant ids)}.
- Source:
check()
Checks root is a treatment jtree runs; throws, saying what is wrong, if not.
- Source:
checkField(field, raw, player)
Converts one submitted value of a declared field; returns {value} or {error}.
Parameters:
| Name | Type | Description |
|---|---|---|
field |
Object | Its declaration. |
raw |
* | What the form sent (a string, or undefined if nothing). |
player |
Player |
checkForm(stage, player, data) → {Object}
Checks and converts what a stage's form submitted.
Parameters:
| Name | Type | Description |
|---|---|---|
stage |
Stage | |
player |
Player | |
data |
Object | The form's values by field name ('player.x', ...). |
Returns:
The converted values by name, and if
anything is wrong, the messages by field name ('' for the form as a whole).
- Type
- Object
compileProgram(program, app, where)
Compiles program into a JS function, run with app and Utils in scope. Languages other
than JS come with their dialects.
Parameters:
| Name | Type | Description |
|---|---|---|
program |
Program | |
app |
App | |
where |
string | Names the program in errors, e.g. "stages.results.groupStart". |
context()
What the editors are given to work with: where files may go, and loading the apps again.
- Source:
contractList()
A contract list: the table's records that meet the box's condition, one a row, to choose from.
- Source:
(async) convertApp() → {Promise.<{name, level, report, files}>}
Converts the oTree app in appDir to a jtree app in outDir.
- Source:
Returns:
level: 'Converts' or 'Converts with TODOs';
report: [{part, status ('converted' or 'todo'), note, line}]; files: the paths written.
- Type
- Promise.<{name, level, report, files}>
convertTreatment()
app.jtt for treatment t, and the report: [{status, part, note}].
- Source:
(async) convertTreatmentFile()
Converts the treatment in file to a jtree app in outDir; {name, level, report, files}.
- Source:
copyDir()
Copies the files under dir (on disk) to target in Pyodide's file system (but folders skipDirs names).
- Source:
copyToPlayer()
The subject's variables as the player's fields (for jtree's data), and Profit as points.
- Source:
creatingSessionBeforeArrival()
The round's initial values and creating_session, for an app that groups players by arrival: in
oTree they are every participant's player's, which jtree makes only as they arrive
(Period#arrivalGroupId). So they go into players of their own, in groups in the participants'
order, and what they set there is given to the participants' players when they arrive
(period.arrivalFields).
- Source:
cut()
Takes out the statement at r, with its lines, and blank lines after it that would double up.
- Source:
decimals()
decimals for a resolution step (0.01 → 2).
- Source:
declared()
rec's array name, made if its table declares it (array X[n]; in any of its programs, even one
that does not run: z-Tree's declarations are its table's, as GIMS uses them), sized as its
declaration says, here.
- Source:
dedent()
Lines with the indentation they share taken out.
- Source:
describe()
Nodes as the editor is sent them: without what it does not need.
- Source:
describeValue()
A property's value as the editor shows it: its source, and for some kinds what it holds.
- Source:
dialectFor()
The dialect of the app at appPath, or null if no dialect reads it.
- Source:
edit()
html with edit made. Edits (path: the node's indexes, as parse gives them):
- {do: 'insert', path?, where: 'before' | 'after' | 'inside', html}: next to the node, or as
the last of its children (inside); with no path, at the end of the screen. - {do: 'remove', path}, {do: 'move', path, by: -1 | 1} (past the sibling before or after)
- {do: 'replace', path, html}: the node, as written, becomes html.
- {do: 'setContent', path, html}: what is between an element's tags.
- {do: 'setAttr', path, name, value?, remove?}: value null for an attribute without one.
- Source:
encode()
text in Windows-1252 (characters it does not have as ?).
- Source:
endSoon()
End player's (wait) stage, after what is running now.
- Source:
endSoon()
Ends player's stage after what is running now.
- Source:
errorPosition()
Where err happened in filename, as {file, line, column} (line and column as strings,
from 1), from its stack; null if the stack does not say.
- A SyntaxError's stack starts "
: ", then the line, then a caret under the column. - Other errors have a frame "
: : ".
- Source:
errorPosition()
Where in the app's files a Python error happened, from its traceback.
- Source:
exportTables()
The run's tables as text.
- Source:
exporter()
The exporter with id, if it is offered for session; else null.
- Source:
exportersFor()
The exporters offered for session: the ones above, and its apps' own (app.exporters(session)).
- Source:
expression()
code parsed as an expression, once.
- Source:
fail()
Throws an error whose message is for the editor's user (the server does not log it as a fault).
- Source:
file()
The file for request path rel of package pkg, or null: never outside its folders.
- Source:
fillValues()
A text with its <expr|layout> as their values; a value's text may have its own, filled in too.
- Source:
findBox()
The box at path ("2", "1.0" in a container) of a stage's active screen.
- Source:
finite()
A number arithmetic or a function gave: by jtree's rules, not a finite one is an error.
- Source:
formatText()
A label or text with z-Tree's formatting: "<>" starts text with variables, <var|layout>;
RTF ({\rtf ...}) is reduced to its text.
- Source:
formatValue()
v shown with a layout.
- Source:
fromDescription()
A treatment as jtree read it (dialects/ztree/ztt.js) as a text treatment's root node; notes: what it leaves out.
- Source:
getBridge()
The bridge to Python (python/jtree_otree.py); throws PythonStarting, and starts it, if it is not ready.
- Source:
grid()
A grid box: its items in columns of equal length (the first column holds the rows' labels).
- Source:
history()
The subject's records in the periods before this one, a row each.
- Source:
identifiers()
Every identifier in node that names a variable (not x in a.x or {x: 1}).
- Source:
inAppFolders()
p (absolute, or relative to the first app folder), if it is in an app folder; else throws.
- Source:
indent()
Code indented by one step (4 spaces), each line.
- Source:
indentBy()
Code with each line indented by indent (blank lines left blank).
- Source:
indentLines()
Lines after the first indented by indent, for HTML put where a line starts with it.
- Source:
insertAfter()
Inserts lines (no trailing newline) as statements after the line r ends on.
- Source:
isInteractive()
Whether a stage is interactive: its buttons send messages, run their programs and the stage
goes on (contract boxes, chat; a button that does not leave; buttons with different programs).
Otherwise its screen is a form, sent by its button, which ends the stage.
- Source:
isProject()
Whether settings.py at settingsPath is an oTree project's.
- Source:
isSessionsLastPage()
Whether player is on the last page of the session: its last app's last round and stage.
- Source:
isText()
Whether buf (a file's start) is a z-Tree text export: a treatment or questionnaires.
- Source:
isTextFile()
Whether the file at path is a z-Tree text export (its first bytes say so).
- Source:
isTextFile()
Whether the file is z-Tree's text format (else its binary one).
- Source:
itemCell()
An item: its label and its value, or its input.
- Source:
itemsTable()
Items as rows: label, and the value or an input. prefix names inputs (new: a new record's).
- Source:
jsonErrorPosition()
Where the mistake in text is, as {line, column} from 1, given the error JSON.parse threw.
Its message says so for some mistakes ("... (line 2 column 3)") but not for others
("Unexpected token ','"); then the mistake is found as the shortest start of the text that
fails before its end.
- Source:
lanAddress()
The first non-internal IPv4 address, so links given to participants work from other machines
on the network. Loopback aliases (e.g. 10.x addresses on lo0) count as internal.
- Source:
lastFirst()
The stage's statements, end of the source first (to cut them without moving the others).
- Source:
layoutEnd()
Where the layout starting at s[j] ends (its >), quoted texts and substitutions in it skipped; -1 if it does not.
- Source:
layoutParts()
A !kind: layout's parts, separated by ;: {key, text} for value = "text", {key} for the others
(a count). A text may hold <var|layout> with quotes of their own, and RTF with ; in it (as
GIMS's do): a quote inside <...> does not end it, nor a ; inside quotes.
- Source:
leaveIfAsked()
A subject whose LeaveStage a program set to 1 leaves their stage (z-Tree's LeaveStage); it is 0 again.
- Source:
leavesStage()
Whether a button leaves the stage (see Run#press).
- Source:
legacyValue()
A value submitted for a field nobody declared, converted as jtree always has.
lineIndent()
The indentation of the line pos is on.
- Source:
lines()
A statement's whole lines: from its line's start (if only spaces are before it) past its line end.
- Source:
loadPackagesFor()
If the app in dir imports modules Python does not have yet, loads the packages Pyodide has for
them (from its package repository; else pure Python ones from PyPI) and throws PythonStarting; whenReady's callbacks run when
they are in (as when Python starts). A module none has is tried once, then left to fail.
- Source:
measure()
A distance or size ("10%", "30p", "12"): a length, relative to whole; null if empty.
- Source:
memberAssignment()
object.property = value;: {object, property, value}.
- Source:
model()
The app in source, as the editor shows it:
- app: its settings and functions, [{name, kind, code, value?, ..., range, valueRange}]
- stages: [{name, varName, nameRange, declRange, props: [...], ranges: [...]}]
- other: the statements that are neither, [{code, range}]; otherStages: whether they make stages
- error: {message, line, column} if the source does not parse (and nothing else then).
- Source:
mountProject()
The project folder dir (on disk) in Python's file system: mounted the first time.
- Source:
newTreatment()
z-Tree's new treatment: the background with its tables, header box and waiting screen; no stages.
- Source:
nodeAt()
The node at path (indexes into children, from the top), or fails.
- Source:
normalizeCode()
Code as the binary file has it: the export's indentation (tabs to the block's depth) taken out.
- Source:
openUrl()
Opens a URL in the default browser.
- Source:
ownLine()
Whether range is alone on its line(s): only white space before it and after it there.
- Source:
owner()
The record (and its table) a variable is in, looking out from ctx; null if none.
- Source:
packageFor()
The Python package an app's folder is loaded as.
- Source:
pageTimesCSV()
When each participant finished each page of the session's oTree apps, as oTree's page times:
from the times jtree records (player.timeEnd_
- Source:
paramCell()
The parameter table's cell of subject i in period p; for subjects beyond the treatment's (a
session with more participants), the treatment's subjects' cells in turn.
- Source:
parse()
The text, as a tree of blocks: {kind, name, entries: {key: value}, blocks: [...], code (a do block's)}.
- Source:
parse()
The nodes of html, as above.
- Source:
parse()
The text (a treatment's or questionnaires' export) as its root node.
- Source:
parseExpr()
An expression (a condition, a timeout, a variable in a layout) parsed.
- Source:
parseLayout()
A layout: {kind: 'number', step} (a number's resolution: "1", "0.01", or a variable), or
{kind: 'text'|'radio'|'radioline'|'checkbox'|'slider'|'scrollbar'|'button', options: [[value,
label]], count}, from "!radio: 1 = "a"; 2 = "b"" and the like.
- Source:
parseQueueId()
If id is a session config's queue id, {settingsPath, name}; else null.
- Source:
place()
box's rectangle in the area {x0, y0, x1, y1}; and the area left for the boxes after it.
- Source:
plot()
A plot box: its items evaluated (graphs' for each of their table's records) to shapes in the
plot's coordinates, for participant/ztree.js to draw (as SVG, at the box's size): {range,
shapes, inputs}. A shape a subject can click or drag has the inputs it takes, and the records
it was drawn for (its graphs', innermost first).
- Source:
plotInput()
A plot input: its action NEW (0, a click makes a record), SELECT (1) or DRAG (2); a drag's start and end in dragsnap*.
- Source:
plotItemAt()
The plot item at path in a plot box ("1.0" in a graph; "2:0" the first input of item 2).
- Source:
prefixHtmlUrls()
Rewrites root-absolute URLs (src="/shared/...", href='/admin/...', action="/admin") in HTML
responses to sit under basePath, so pages written for the root work wherever jtree is served.
Applies to every HTML page: jtree's own, and experiment apps' stages.
- Source:
pressButton()
Player presses a button of their screen: data is {stage, box, button, values, others, record,
itemButton}, as their page sends it ('ztreeButton'). Returns {error} (the message z-Leaf would
show), {leave} (whether they leave the stage), or null if they are not playing that stage.
- Source:
program()
A program: its table, owner, condition, and code.
- Source:
programItems()
What z-Tree's binary format has that this does not write, as notes for whoever saves it.
- Source:
putApp()
Puts the app in the folder dir into Python as package pkg (its .py files, and its .html
templates for the renderer).
- Source:
putSettings()
The project's settings.py put in Python's file system; the folder it is in there.
- Source:
(async) py()
The studio's Python, once Python has started.
- Source:
queueId()
The queue id of session config name in the project of settingsPath.
- Source:
queueScript()
The script of the queue for a session config (see Queue#run): sets the session's config, then adds its apps.
- Source:
quote()
A text as z-Tree writes it: \ and " escaped; a line break (\n) as a line break, the next line
indented to depth; \r\n (which z-Tree writes escaped, as in a radio item's format) escaped.
- Source:
quotedEnd()
Where a quoted text starting after its " at s[j] ends (after its closing "), its substitutions taken whole.
- Source:
readGameHeader()
The treatment's settings before its tables: the texts shown to bankrupt subjects, ... (loosely).
- Source:
readQuestionnaires()
The questionnaires in a .ztq file: {version, questionnaires: [{name, title, items, buttons}]}.
- Source:
readScreen()
What a screen offers (player.ztreeHtml): its boxes by path, each with its buttons (indexes),
item buttons ({name, value}) and rows to choose (record ids); and its inputs, each with the
paths of the boxes it is in, innermost first.
- Source:
readTextQuestionnaires()
Questionnaires in a text export, as ztq.js reads them from a .ztq: {version, questionnaires: [{name, title, items, buttons}]}.
- Source:
readTextTreatment()
The treatment in a text export (a Buffer, Windows-1252, or a string).
- Source:
readTreatment()
Reads a z-Tree treatment (.ztt) from buf; returns its description (see the end of this function).
- Source:
(async) ready()
Resolves when Python has started and the packages apps asked for are loaded.
- Source:
(async) ready()
Loads acorn, once (it is an ES module).
- Source:
refresh()
Draws again the screen of each of app's players who is in it, and sends it if it changed.
- Source:
register()
Notes where the static files of the app in folder dir (package pkg) are.
- Source:
reload()
Loads the app catalogue again, and tells the admins.
- Source:
renderScreen(boxes, view)
The HTML of a screen (a stage's active or waiting boxes) for a subject.
Parameters:
| Name | Type | Description |
|---|---|---|
boxes |
Array.<Object> | |
view |
Object | {ctx (the subject's record's), stage (index), screen ('active' or |
- Source:
reportMarkdown()
CONVERSION.md: what was converted, and what needs work by hand.
- Source:
reportMarkdown()
CONVERSION.md.
- Source:
rooms()
The project's ROOMS, as jtree rooms describe them: {id, displayName, labels} (labels from
participant_label_file, one a line; none: anyone may join, by any label).
- Source:
router()
The router for /api/editor.
- Source:
rtfToText()
RTF's text: its paragraphs as lines, its control words and groups taken out, its 'xx characters (Windows-1252).
- Source:
run()
Runs a parsed program in ctx ({rt, table, rec, outer}).
- Source:
runAppCode(code, filename, scope)
Runs the code of a jtree app (a .jtt or .js file), or of one of a folder app's stage files.
The code is compiled as the body of a function whose parameters are the names in scope
(app, and stage for a stage file), plus Utils, fs, path and require, which apps have
always been able to use. Compiling it with its file's name puts that name and the line in
every error from it, now or later from the functions it defines (playerStart, ...).
An error thrown while compiling or running the code gets jtreePosition: {file, line,
column} of where it happened, in this file or in a stage file the code added.
Parameters:
| Name | Type | Description |
|---|---|---|
code |
string | |
filename |
string | The file the code is from. |
scope |
Object | Names the code can use, e.g. {app}; |
- Source:
(async) runBots(session, optsopt)
Plays session with its apps' bots until every participant has finished it. Rejects on the
first problem: a bot expecting another page than its player's, a form refused (or accepted,
for SubmissionMustFail), an app without bots, or an error in a bot (e.g. a failed expect).
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
session |
Session | A started session. |
|||||||||||||||||||||||||||||||
opts |
Object |
<optional> |
Properties
|
- Source:
runOf()
The treatment's run in app (a session's app): made when it starts.
- Source:
(async) runZtreeBots(optsopt)
Plays session's z-Tree treatments to their end, every participant by the generic bot.
Resolves to what the bots did: {pressed, refused, timedOut} (counts).
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
object |
<optional> |
Properties
|
- Source:
scan()
The projects (folders with an oTree settings.py) and apps in the app folders.
- Source:
screen()
A stage's (or the background's) screen: its boxes.
- Source:
sessionConfigs()
The project's session configs, read by Python (throws PythonStarting while it starts).
- Source:
settleBoxes()
Contract boxes' table, condition and sorting, from the strings after their last item (where
z-Tree keeps them): [table, condition, sorting].
- Source:
stageDeclaration()
let x = app.newStage('name'), or the call alone: {name, varName, nameNode, call}.
- Source:
stageMeaning()
What a stage's option bytes mean, checked against z-Tree 5's text exports of the examples, and
against treatments z-Tree 5 saved with each setting:
- version 16 (z-Tree 3): options[0] bit 0, it starts as each subject gets there ("Start if
possible", not "Wait for all"); bit 2, it is left after its timeout always (an auction),
not only if there is no input; options[6], it shows the background's boxes (usesbg); - from version 18 (z-Tree 3.5, 5): options[0] is 1 if it waits for all, options[7] 1 if it is
an auction, options[11] usesbg.
- Source:
stageVariable()
A variable name for a stage, from its name, not one of taken.
- Source:
start()
Starts Python, once; resolves when it is ready.
- Source:
statementRange()
A statement's stretch, with the comments just above it and the rest of its last line.
- Source:
str()
An entry's text: a string's, or the raw value's (as it is written), '' if missing.
- Source:
subjectIndex()
The subject index of player (their participant's place in the session).
- Source:
submitGeneric()
The generic bot's submission of the page player is on: a valid value for each of its form's
fields (their declarations, app.fields: a choice, a number from min to max, yes or no, a word);
if the page refuses (its error_message, say), other values, up to 30 times.
- Source:
substitutionAt()
z-Tree's <expr|layout> in a text: the expression runs to the |, and may hold > (<if(\N>1,1,0)|1>);
the layout runs to its >, its quoted texts and the <expr|layout> in them taken whole, so it may
hold its own (GIMS: <\Language|!text: 1="<\N|1> orders";>). substitutionAt(s, i): where the
one starting at s[i] ends (after its >), with its parts; null if there is none there.
- Source:
syntaxErrors()
What Treatment → Check finds in a treatment (as jtree reads it): each program and expression
that does not parse, as {where, message}.
- Source:
tableRecords()
The records of a table named in a program (OLDsubjects: the period before's).
- Source:
template()
A new app's source.
- Source:
template()
A page's template as the editor shows it: its title and content blocks, if it has them as oTree's do.
- Source:
templateLiteral()
Text as a template literal's source.
- Source:
templates()
The page templates in an app's folder, by page name.
- Source:
text()
z-Tree writes \r\n in texts; the binary file has \r\n too, which the readers keep as \n.
- Source:
textParts()
A "<>" text's parts: {text}, and {expr, layout} for each <expr|layout>.
- Source:
toTreatment()
The questionnaires as a treatment (as ztt.js describes one): a stage for each, its items in a
standard box: texts, and questions as a line of choices from min to max (labelled at its ends)
or a number field; and its button, or OK.
- Source:
tokenize()
The file's objects, in order: {cls, start (of its class name), body (where its fields start),
end (where the next object starts)}.
- Source:
topInsert()
Where top-level code of a kind goes: functions before the pages, pages before the page sequence.
- Source:
treatmentFile()
A treatment file's place: one the z-Tree dialect reads.
- Source:
unindent()
A do block's body as code: the lines without the depth's tabs the export puts before each.
- Source:
urlFor()
The URL static file paths of package pkg are under, for jtree served at basePath.
- Source:
validate()
The problems with ir, as messages naming where they are; empty if there are none.
value()
The value of expression code in ctx; on an error, null (and the error noted in ctx.errors).
- Source:
valueFor()
A value for input, as a participant might enter it; attempt > 0: after one was refused.
- Source:
valueFor()
value, or what it gives for player if it is a function.
valueKind()
What a value is, for the editor to show it in a field of the right kind.
- Source:
valueSource()
A value's source from what the editor sends: {kind, value} for number, boolean, string, text
(a template literal, for screens), {kind: 'function', params, body}, or {kind: 'code', code}.
- Source:
variables()
The variables of each table: built in, set by the treatment's programs, or by inputs.
- Source:
whenReady()
Calls fn once Python is ready (now, if it is).
- Source:
wideCSV()
The session's "all apps, wide" CSV, with oTree 5's columns (otree/export.py): the participant's,
its PARTICIPANT_FIELDS, the session's, its config's (name, participation_fee,
real_world_currency_per_point if the project uses points, and the config's own keys), its
SESSION_FIELDS; then the apps'.
- Source:
withBlocks()
A template with its title and content set: in the blocks it has, else a new oTree template.
- Source:
withStatics()
text with its static files ({{ static 'x' }}) as data: URLs, which work wherever the app is.
- Source:
write()
Writes text to file, making its folder if need be.
- Source:
write()
The node as z-Tree's text format (\r\n line ends, a tab a level, as z-Tree writes it).
- Source:
zTreeRules()
Whether ctx runs by z-Tree's rules where they differ from jtree's (the session's mode is
'ztree'): an index out of range is its array's first or last element, and arithmetic gives
infinities and NaN (1/0, sqrt(-1)) as z-Tree 5 does, with no error. By jtree's (and oTree's,
which has none of its own for z-Tree's language), these are errors.
- Source: