-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1227 from facebookresearch/add-in-house-provider
Add a new "InHouse" provider for working with internal crowd
- Loading branch information
Showing
53 changed files
with
1,777 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
docs/web/docs/guides/how_to_use/review_app/enabling_responses_histogram.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
# Copyright (c) Meta Platforms and its affiliates. | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
sidebar_position: 4 | ||
--- | ||
|
||
# Enable Responses Histogram | ||
|
||
Some tasks can display simple histograms with response frequencies. | ||
To enable response frequency histograms, add a tag `form-composer` in the Task's YAML config under `mephisto.task.task_tags` section. | ||
|
||
**Note** that currently this feature is supported only by FormComposer-based Tasks. | ||
|
||
Example YAML config: | ||
|
||
```yaml | ||
mephisto: | ||
... | ||
task: | ||
task_name: "My form-based task" | ||
... | ||
task_tags: "my-tag-1,my-tag-2,form-composer" | ||
``` | ||
This is how histograms typically look like: | ||
![Task statistics](./screenshots/task_stats.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127 changes: 127 additions & 0 deletions
127
examples/form_composer_demo/data/simple/task_data_short.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
[ | ||
{ | ||
"form": { | ||
"title": "Form example", | ||
"instruction": "Please answer all questions to the best of your ability as part of our study.", | ||
"sections": [ | ||
{ | ||
"name": "section_about", | ||
"title": "About you", | ||
"instruction": "Please introduce yourself. We would like to know more about your background, personal information, etc.", | ||
"fieldsets": [ | ||
{ | ||
"title": "Personal information", | ||
"instruction": "", | ||
"rows": [ | ||
{ | ||
"fields": [ | ||
{ | ||
"help": "", | ||
"id": "id_name_first", | ||
"label": "First name", | ||
"name": "name_first", | ||
"placeholder": "Type first name", | ||
"tooltip": "Your first name", | ||
"type": "input", | ||
"validators": { | ||
"required": true, | ||
"minLength": 2, | ||
"maxLength": 20 | ||
}, | ||
"value": "" | ||
}, | ||
{ | ||
"help": "Optional", | ||
"id": "id_name_last", | ||
"label": "Last name", | ||
"name": "name_last", | ||
"placeholder": "Type last name", | ||
"tooltip": "Your last name", | ||
"type": "input", | ||
"validators": { "required": true }, | ||
"value": "" | ||
} | ||
], | ||
"help": "Please use your legal name" | ||
} | ||
] | ||
}, | ||
{ | ||
"title": "Cultural background", | ||
"instruction": "Please tell us about your cultural affiliations and values that you use in your daily life.", | ||
"rows": [ | ||
{ | ||
"fields": [ | ||
{ | ||
"help": "Select country of your residence", | ||
"id": "id_country", | ||
"label": "Country", | ||
"multiple": false, | ||
"name": "country", | ||
"options": [ | ||
{ | ||
"label": "---", | ||
"value": "" | ||
}, | ||
{ | ||
"label": "United States of America", | ||
"value": "USA" | ||
}, | ||
{ | ||
"label": "Canada", | ||
"value": "CAN" | ||
} | ||
], | ||
"placeholder": "", | ||
"tooltip": "Country", | ||
"type": "select", | ||
"validators": { "required": true }, | ||
"value": "" | ||
}, | ||
{ | ||
"help": "Select language spoken in your local community", | ||
"id": "id_language", | ||
"label": "Language", | ||
"multiple": true, | ||
"name": "language", | ||
"options": [ | ||
{ | ||
"label": "English", | ||
"value": "en" | ||
}, | ||
{ | ||
"label": "French", | ||
"value": "fr" | ||
}, | ||
{ | ||
"label": "Spanish", | ||
"value": "es" | ||
}, | ||
{ | ||
"label": "Chinese", | ||
"value": "ch" | ||
} | ||
], | ||
"placeholder": "", | ||
"tooltip": "Language", | ||
"type": "select", | ||
"validators": { | ||
"required": false | ||
}, | ||
"value": "" | ||
} | ||
] | ||
} | ||
], | ||
"help": "This information will help us compile study statistics" | ||
} | ||
] | ||
} | ||
], | ||
"submit_button": { | ||
"text": "Submit", | ||
"tooltip": "Submit form" | ||
} | ||
} | ||
} | ||
] |
28 changes: 28 additions & 0 deletions
28
examples/form_composer_demo/hydra_configs/conf/example_local_inhouse.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#@package _global_ | ||
|
||
# Copyright (c) Meta Platforms and its affiliates. | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
defaults: | ||
- /mephisto/blueprint: static_react_task | ||
- /mephisto/architect: local | ||
- /mephisto/provider: inhouse | ||
|
||
mephisto: | ||
blueprint: | ||
data_json: ${task_dir}/data/simple/task_data_short.json | ||
task_source: ${task_dir}/webapp/build/bundle.js | ||
task_source_review: ${task_dir}/webapp/build/bundle.review.js | ||
link_task_source: false | ||
extra_source_dir: ${task_dir}/webapp/src/static | ||
units_per_assignment: 2 | ||
provider: | ||
ui_base_url: "http://localhost:3001" | ||
task: | ||
task_name: "Sample Questionnaire" | ||
task_title: "Example how to easily create simple form-based Tasks" | ||
task_description: "In this Task, we use FormComposer feature." | ||
task_reward: 0 | ||
task_tags: "test,simple,form,form-composer,inhouse" | ||
force_rebuild: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Copyright (c) Meta Platforms and its affiliates. | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
from omegaconf import DictConfig | ||
|
||
from mephisto.operations.operator import Operator | ||
from mephisto.tools.building_react_apps import examples | ||
from mephisto.tools.scripts import task_script | ||
|
||
|
||
@task_script(default_config_file="example_local_inhouse") | ||
def main(operator: Operator, cfg: DictConfig) -> None: | ||
examples.build_form_composer_simple( | ||
force_rebuild=cfg.mephisto.task.force_rebuild, | ||
post_install_script=cfg.mephisto.task.post_install_script, | ||
) | ||
operator.launch_task_run(cfg.mephisto) | ||
operator.wait_for_runs_then_shutdown(skip_input=True, log_rate=30) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.