regen_1_scoring
v0.1.0
Published
Script that will translate Regen 1's scoring criteria to be automatically applied to farmer data.
Maintainers
Readme
Regen1 Scoring
Resources
- Current Survey.
- Scoring Table
Getting all required inputs
Populate the .env file.
- Get a baserow token for our tables, store it under the BASEROW_TOKEN key.
Retrieve the baserow tables
- Use the node script
./scripts/getBaserowScoring.js. It will store the scoring table under./input_data/parsed_scoring_table.json.
Add the SurveyStack survey description
- You can download it from survey stack, if you click on the edit menu.
- The baserow tables are parsed starting from this definition, using another script,
parseSurveyDescriptionFile.js, which outputs data dictionaries that are the base for the Baserow Scoring tables. This is not required to apply scores, as the Baserow Scoring tables are an input. - It should be
./input_data/current_survey_definition.json.
How to test the Functions
Library tests
- You will find abundant, detailed and well structured examples in the
tests. - Some
functions_walktroughscripts also toy with different components and might help inspect and get acquainted if needed.
Example of how to use in a server
functions_walktrough/example_server_call.js.
Main Filosophy
First, you will obtain
parsers, by feeding the Scoring Table to adequate classes. There are functions provided by the library simplifying the process, and one that encompasses the whole process,parametrizeWholeScoringProcessthe only argument taken is the scoring table.Parsers have a
scoremethod, that will output a score and information explaining how it was assigned when fed with a survey submission.
Scoring Steps
- Questions search for adequate data, compare it with known values and also gather what's needed for modifications to the score, such as verification.
- Subsections are composed of many questions, they will evaluate their included questions, obtain partial scores, modify them and generate a subsection score.
- Sections are componsed of subsections.
- A
Scoringdescribes the whole process, and will score a full survey submission. - Every level will also provide data from the deeper ones.
