3.5.1 Core
On this page:
defstep
defstep/  study
defvar
defvar*
defvar/  instance
defvar*/  instance
defview
defstudy
-->
button
for/  study
with-bot
3.5.1.1 Local Testing
3.5.1 Core🔗

 (require conscript/base) package: conscript

The bindings provided by this module are also provided by #lang conscript.

syntax

(defstep ...)

Defines a step.

syntax

(defstep/study ...)

...

syntax

(defvar ...)

syntax

(defvar* ...)

Define a variable with some extra magic behind it. defvar and defvar* are both particiant scope; defvar* scope across parent/child studies. ...

syntax

(defvar/instance ...)

syntax

(defvar*/instance ...)

Like defvar and defvar*, but scoped to the current study instance that is, the stored value is shared by all participants in the study instance.

syntax

(defview ...)

...

syntax

(defstudy maybe-requires maybe-provides step-transition ...)

 
maybe-requires = 
  | #:requires (value-id-sym ...)
     
maybe-provides = 
  | #:provides (value-id-sym ...)
     
step-transition = [step --> step maybe-more-steps]
     
maybe-more-steps = 
  | --> step ...
 
  value-id-sym : symbol?
  step : step?
More to come...

Defines a study.

Any number of steps may be joined by transitions using -->.

procedure

(button [action-proc]    
  label    
  [#:id id    
  #:to-step-id to-step-id    
  #:up-target up-target    
  #:up-transition up-transition])  xexpr?
  action-proc : (-> any/c) = void
  label : string?
  id : string? = ""
  to-step-id : (or/c identifier? #f) = #f
  up-target : string? = ".step"
  up-transition : string? = "none"
Returns a representation of an HTML <a> element styled as a button that navigates to the next step in the study when clicked.

If action-proc is provided, it will be called when the button is clicked, just before the next step in the study is loaded.

The href attribute is dynamically set to the URL of a continuation that first calls action with no arguments, then returns the page provided by to-step-id (or that provided by the next step in the study if to-step-id is #f).

If #:id is provided, it sets the value of the data-widget-id attribute for the element.

syntax

(for/study ...)

See loops, definition of

syntax

(with-bot step-expr bot-expr)

Wraps step-expr so that its default bot is bot-expr.

Examples:
> (require conscript/base)
> (defstep (hello)
    (button "Continue..."))
> (defstudy s
    [[hello (with-bot hello bot:continuer)] --> ,(lambda () done)])

3.5.1.1 Local Testing🔗