Hemlock-CRT is a hemlock extension for adding a cognitive reflection test to hemlock projects.
Installation
With hemlock-CLI (recommended):
$ hlk install hemlock-crt
With pip:
$ pip install hemlock-crt
Quickstart
In this example, we add a CRT with the bat and ball, lily pads, widgets, and students problem. Then we display the results to the participant.
In survey.py:
from flask_login import current_user
from hemlock import Branch, Page, Label, route
from hemlock_crt import crt
@route('/survey')
def start():
return Branch(
*crt('bat_ball', 'lily_pads', 'widgets', 'students', page=True),
Page(
Label(compile=display_score),
terminal=True
)
)
def display_score(label):
label.label = '''
<p>You gave {} correct and {} intuitive answers out of {} CRT questions.
</p>
'''.format(
current_user.g['CRT_Correct'],
current_user.g['CRT_Intuitive'],
current_user.g['CRT_Total']
)
app.py is standard from the hemlock template.
Run with:
hlk serve
or
python app.py
Citations
@software{bowen2020hemlock-crt,
author = {Dillon Bowen},
title = {Hemlock-CRT},
url = {https://dsbowen.github.io/hemlock-crt/},
date = {2020-10-05},
}
@article{frederick2005cognitive,
title={Cognitive reflection and decision making},
author={Frederick, Shane},
journal={Journal of Economic perspectives},
volume={19},
number={4},
pages={25--42},
year={2005}
}
License
Users must cite this package in any publications which use it.
It is licensed with the MIT License.
Release files for hemlock-crt 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hemlock-crt-0.0.2.tar.gz | 5.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hemlock_crt-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.7 kB
Release files / hemlock-crt-0.0.2.tar.gz
| Download URL | hemlock-crt-0.0.2.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9e00e276992b909ce4dd49a1f55c0d9ce900e0ee90b49fea3a09a6d1da88d582
|
|
BLAKE2b-256 checksum How to use checksums |
6e9d13852b29e27150007cbd73fd02a620efda324f4f1233bf2549c6c8200d43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.8
|
Release files / hemlock_crt-0.0.2-py3-none-any.whl
| Download URL | hemlock_crt-0.0.2-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dc50b5fbaa17857566c4a3b383bf0b7882309ba535fac6dbdbe3e2cd28c299cd
|
|
BLAKE2b-256 checksum How to use checksums |
de91d9ac5e49fef0cb2c88e962ca300407030abdb006b159cb3bef0ad3577dd8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.8
|