6.1.4 Survey Tools
| (require conscript/survey-tools) | package: conscript |
The bindings in this module are also provided by conscript/base.
procedure
(refresh-every n-seconds) → xexpr?
n-seconds : exact-positive-integer?
> (define price 1.045) > (~$ price) "$1.04"
> (~euro price) "€1.04"
> (~pound price) "£1.04"
> (~$ 8) "$8.00"
procedure
(round-to-places num p) → real?
num : real? p : real?
If p is not an exact integer, it will be rounded to an exact integer to determine the number of decimal places for rounding. If p is zero, the result is the same as (round num). If it is less than zero, the result will be zero.
> (round-to-places 3.14159 2) 3.14
> (round-to-places 3.5 0) 4.0
> (round-to-places 4.5 0) 4.0
> (round-to-places 1.23 -1) 0.0
> (round-to-places 8 2) 8.0
procedure
(diceroll-js arg) → any/c
arg : any/c
syntax
(assigning-treatments arg)
arg : any/c
procedure
(make-multiple-checkboxes options [ #:n num-required #:exactly-n? exactly-n?] #:message message) → formular-field? options : (listof (cons/c symbol? string?)) num-required : exact-nonnegative-integer? = 0 exactly-n? : boolean? = #f message : (or/c #f string?)
See How to have a form input with multiple checkboxes for more examples of this function in use.
Returns a field containing multiple checkboxes defined by the options list. The num-required argument specifies the minimum number of checkboxes the user must check before they can submit the form. If message is not #f, it will be shown to the participant if they don’t check at least num-required boxes.
When #:exactly-n? is #t, the user is expected to check exactly n checkboxes, otherwise they get a validation error.
syntax
(make-sliders arg)
arg : any/c
syntax
(toggleable-xexpr arg)
arg : any/c