New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a survey strategy using the new methodology #753

Closed
pwalsh opened this Issue Jul 14, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@pwalsh
Member

pwalsh commented Jul 14, 2016

(Description and Tasks edited by @brew 2016-08-17)

Description

The broad scope of this ticket is to implement changes to the census entry process (survey), enabling questions, and dependencies between questions, to be displayed dynamically from data inputed by site admins into the current CMS (Google Spreadsheets).

The biggest conceptual change is that Questions will be associated with Datasets, through a QuestionSet. This contrasts with the current implementation where Questions are associated at the Site level and shared by all Datasets in the Site.

QuestionSets being associated with Datasets allows different Questions to be used by Datasets within the same Site (although this will likely not be necessary for the Global index, which will share the same QuestionSet across all Datasets in the Site).

Each QuestionSet will have a QuestionSetSchema property (json), which will define the relationship between each Question (see #752 (comment) for more details). The QuestionSetSchema will be used by the front-end to layout the entry form and determine which fields are required, and need to be displayed and enable, as the entry is completed by the user.

Tasks

  • Implement Question/QuestionSetSchema in (#776):
    • Front-end (Reactjs) for simplest Question types (Yes/No)
    • Structure Front-end code and bundle with webpack
    • Question position (and label?) determined by QuestionSetSchema
    • Simple backend controller with static Question/QuestionSetSchema data
    • Front-end tests
  • Question/QuestionSet data imported to db from CMS (#777)
    • Process data to db for changed Site > Dataset > QuestionSet > Questions structure
    • Backend controller to use dynamic Question/QuestionSetSchema data
    • Add QSSchema json schema to docs
  • Implement front-end design for entry form (#779)
    • Disabled styling
    • Sub-questions
    • Comment placeholder text from data
    • Instructions text from data
    • Instructions reveal javascript
    • is_godi site setting used by GODI only
  • Implement all Question types
    • Text (#783)
    • Yes/No (#779)
    • Likert scale (#787)
    • Multi-value (custom type for dataset URL) (#794)
    • Multi-choice [see note 1] below
      • Multi-select (characteristics) (#795)
      • Multi-select with Other (file format) (#797)
  • A context object accessible from the QuestionSet. e.g. The context object could be the associated Dataset, allowing access to dataset-specific properties within Questions, such as time intervals. (#795, #796)
  • Add 'time interval' column to datasets. Used to populate the question "Data should be updated every : Is the data up-to-date?" (#796)
  • Ensure new format Questions will work with translation framework (see #788)

There are a large number of tasks here, which may need to be broken up into separate issues/PRs. This ticket will be edited to include issue numbers where appropriate.

[1] The Format question is a scored question that needs to be evaluated against a known list of scorable formats. This may be deferred to the scoring work.

@pwalsh pwalsh modified the milestones: Current, Backlog Jul 14, 2016

@pwalsh pwalsh removed the ready label Jul 14, 2016

@pwalsh pwalsh added the ready label Jul 28, 2016

@pwalsh pwalsh modified the milestones: Current, Backlog Jul 28, 2016

brew added a commit that referenced this issue Aug 18, 2016

[#753] wip Reactjs based entry form
- `submitReact` controller with hardcoded data values for question schema
  and questions.
- Reactjs form with field properties updating dependent on values from
  other fields, based on the question schema.

brew added a commit that referenced this issue Aug 18, 2016

brew added a commit that referenced this issue Aug 18, 2016

[#753] Only update props if provider is enabled
Use the default properties if the provider is not enabled or not
visible, even if the provider value matches the dependency value.

brew added a commit that referenced this issue Aug 18, 2016

brew added a commit that referenced this issue Aug 19, 2016

[#753] QuestionField labels from position prop.
A QuestionForm `labelPrefix` can also be added as a prefix for each
label. e.g. labelPrefix={'B'} and a position of '1.1' would return a
label of 'B1.1'.

brew added a commit that referenced this issue Aug 19, 2016

[#753] QuestionField order determined by `position`
Order of QuestionField components in the QuestionForm is determined by
the `position` property of each question in the schema.

brew added a commit that referenced this issue Aug 19, 2016

[#753] Add front-end specific .eslintrc config.
Mainly so React scripts can be modules, and node can be scripts.

brew added a commit that referenced this issue Aug 24, 2016

[#753] Add `qsurl` property to dataset instances.
`qsurl` is populated during dataset loading either from a new
`QuestionSetUrl` column within the Dataset spreadsheet, or, if empty,
from the `question_set_url` key of the site settings, as defined in the
site config spreadsheet.

The idea is that the url defined in the site config can act as a catch
all question set url for the entire site if question set urls are not
provided for each dataset individually.

brew added a commit that referenced this issue Aug 30, 2016

[#753] Load QuestionSets instances
Loads QuestionSet instances from each questionset url associated with
datasets in the site. Associates the new QuestionSet instance with the
appropriate Datasets that use it.

brew added a commit that referenced this issue Aug 31, 2016

brew added a commit that referenced this issue Aug 31, 2016

[#753] Refactor loadConfig.
- flatten .then structures
- remove unnecessary new Promise declaration

brew added a commit that referenced this issue Aug 31, 2016

[#753] Refactor loadRegistry adn loadData.
- flatten .then structure
- use spreadsheetParsePromise

brew added a commit that referenced this issue Aug 31, 2016

[#753] Replace spreadsheetParse function.
Removes the old spreadsheetParse for one that properly uses .then and
.catch.

brew added a commit that referenced this issue Aug 31, 2016

brew added a commit that referenced this issue Sep 27, 2016

[#753] Fix CSS to work with new scale markup
React components need to be in a single root element, so the input/label
pairs for each scale option need to be in a single span tag. This commit
fixes the CSS to accommodate. Originally from
okfn/census-mockup@09c324f

brew added a commit that referenced this issue Sep 28, 2016

[#753] Add QuestionFieldSource question type
The QuestionFieldSource component has multiple url/description textfield
pairs, so the user can add several sources as an answer. A new empty
url/description pair will appear when a user has started to input text
into the previous existing one.

brew added a commit that referenced this issue Sep 29, 2016

brew added a commit that referenced this issue Sep 29, 2016

brew added a commit that referenced this issue Sep 29, 2016

brew added a commit that referenced this issue Sep 29, 2016

[#753] QuestionForm.canAssignProperties method
The conditional check to see whether a dependency should update its
visible properties based on the value of the provider's current state.

Conditions in the schema can be a simple value check; is the dependency
value the same as the provider value. Or a `isNotEmpty` check; where the
provider value must not be empty: string, array or object.

brew added a commit that referenced this issue Sep 29, 2016

[#753] Ensure array if no dataset selected.
Although there's no dataset selected, `qsSchema` should still be passed
as an empty array, rather than undefined. This prevents errors on the
rendered page.

brew added a commit that referenced this issue Sep 29, 2016

[#753] Pass a context object to the QuestionForm.
We want to be able to pass context data to the QuestionForm. In this
case, it will be data from the dataset we're interested in. First of
all, we'll want the dataset characteristics in the context object, so we
can render the (yet to be committed) multiple choice question type.

brew added a commit that referenced this issue Sep 30, 2016

[#753] Add QuestionFieldMultipleChoice component
Adds a multiple choice react component for the entry form. Options can
be defined in one of two ways:

A) An array on the `question.config.options` key
B) An array in the context object, the key for which is defined in
`question.config.optionsContextKey` (this is used to get a list of
characteristics from the dataset context object for the
'characteristics' question).

brew added a commit that referenced this issue Sep 30, 2016

[#753] Change var labels to be less specific
Change 'characteristics' wording, which is too specific, to 'options'.

brew added a commit that referenced this issue Oct 3, 2016

[#753] Add timeliness to entry form question.
Pre-render the question text against the datasetContext using nunjucks
to render questions that might include dataset specific content. In this
case the 'timeliness' question which requires a time interval in the
question text.

brew added a commit that referenced this issue Oct 4, 2016

[#753] 'Other' option for multiple choice field
An 'other' text input is available if `includeOther` is true in the
multi-choice field config.

brew added a commit that referenced this issue Oct 4, 2016

@brew

This comment has been minimized.

Show comment
Hide comment
@brew

brew Oct 28, 2016

Member

This is now complete (except for the translations work which now has its own issue). Happy for me to close this @pwalsh?

Member

brew commented Oct 28, 2016

This is now complete (except for the translations work which now has its own issue). Happy for me to close this @pwalsh?

@brew brew modified the milestones: Current, Survey 2016 Nov 28, 2016

@brew brew closed this Nov 29, 2016

@brew brew removed the ready label Nov 29, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment