Skip to main content

Hemlock-Berlin

Hemlock-Berlin is a hemlock extension which allows you to add a Berlin numeracy test to hemlock projects.

Installation

With the hemlock-CLI (recommended):

$ hlk install hemlock-berlin

With pip:

$ pip install hemlock-berlin

Quickstart

This example shows how to add an adaptive Berlin numeracy test to your hemlock survey and display the participant's score to him/her.

In survey.py:

from flask_login import current_user
from hemlock import Branch, Page, Label, route
from hemlock_berlin import berlin

@route('/survey')
def start():
    return Branch(
        berlin(),
        Page(
            Label(compile=display_score), 
            terminal=True
        )
    )

def display_score(label):
    label.label = '<p>Berlin score: {}</p>'.format(
        current_user.g['BerlinScore']
    )

app.py is standard from the hemlock template.

Run the app with the hemlock command line interface:

hlk serve

or with python:

python app.py

Citation

@software{bowen2020hemlock-berlin,
  author = {Dillon Bowen},
  title = {Hemlock-Berlin},
  url = {https://dsbowen.github.io/hemlock-berlin/},
  date = {2020-10-05},
}

@article{cokely2012measuring,
  title={Measuring risk literacy: The Berlin numeracy test.},
  author={Cokely, Edward T and Galesic, Mirta and Schulz, Eric and Ghazal, Saima and Garcia-Retamero, Rocio},
  journal={Judgment and Decision making},
  year={2012},
  publisher={Society for Judgment and Decision Making}
}

License

Users must cite this package in any publications which use it.

It is licensed with the MIT License.

Metadata

Release files for hemlock-berlin 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hemlock-berlin 0.0.3
File Size Uploaded
hemlock-berlin-0.0.3.tar.gz 3.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hemlock-berlin 0.0.3
File Interpreter ABI Platform
hemlock_berlin-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 8.2 kB

Release files / hemlock-berlin-0.0.3.tar.gz

Download URL hemlock-berlin-0.0.3.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
593e1d2ce585e4c446664ba258f57eceee339bb454723019446952a54da110e3
BLAKE2b-256 checksum
How to use checksums
17be0831a19e1958bca44b6381688055575752c536f52dc37af834eee18f68f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5

Release files / hemlock_berlin-0.0.3-py3-none-any.whl

Download URL hemlock_berlin-0.0.3-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
87e50fb155dba64cf6d9ff5f5b1471c002fde0cf0af8faa189d2602716823557
BLAKE2b-256 checksum
How to use checksums
62b55cba305974c8631e8a4a129f01a9546c6a06c6c7a73224b53137ab939b7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page