GithubHelp home page GithubHelp logo

mwater / mwater-forms Goto Github PK

View Code? Open in Web Editor NEW
3.0 9.0 5.0 7.9 MB

Forms controls for mWater

License: GNU Lesser General Public License v3.0

JavaScript 44.23% CSS 0.48% HTML 0.04% TypeScript 55.25%

mwater-forms's Introduction

mWater Forms

Mobile-friendly survey/form components, compiled from a XForms-inspired JSON schema.

Features

  • 12+ Question types
  • Conditions & validations
  • Full localization of surveys
  • Entity references

Response Lifecycle

See [Response Lifecycle](docs/Response Lifecycle.md)

Schema versioning

The schema is stored in _schema field of the form and is an integer.

The package exports schemaVersion which is the current (and maximum) version that it compiles. It also exports minSchemaVersion which is the earliest version supported

Schema versioning checklist

  • Change schema
  • Increment schema version in index.coffee
  • Add new version to acceptable _schema enum in schema
  • Publish with new major number
  • Increment version in mwater-form-designer
  • npm install new version of mwater-forms in mwater-form-designer
  • Publish mwater-form-designer
  • npm install new version of mwater-forms in mwater-server
  • Push new server
  • npm install new version of mwater-forms in mwater-app
  • Deploy new app
  • npm install new version of mwater-forms in mwater-portal
  • npm install new version of mwater-form-designer in mwater-portal
  • Deploy new portal

Entity support

Questions can be linked to entities to support a variety of scenarios:

  • Form creates an entity of a certain type with properties mapped to questions
  • Form creates an entity of a certain type with properties mapped to questions
  • Selecting an entity in an entity question pre-fills answers
  • Selecting an entity in an entity question causes other answers to be used to update the entity selected

mwater-forms's People

Contributors

autio avatar broncha avatar daxfohl avatar droopytersen avatar grassick avatar jsdelivrbot avatar mbriau avatar mistermathieu avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mwater-forms's Issues

Add Compact Dry Plate question with automatic count functionality

For native Android app, we should tie the compact dry count interface to a special question type. Perhaps we should make an Automated Water Test Analysis type so that we can add others later as we accommodate new tests.

This might be the time to consider implementing the automatic count on server for non-androids.

Explanation when mandatory question is not answered

When a user tries to move to the next section but has not answered a mandatory question, that question is highlighted in red but no written explanation or instructions are given. This could be confusing to some users.
Suggest adding a mandatory note, in red, stating that the user must answer all questions in red in order to proceed.

Custom date questions

For some surveys, the exact date is not important but only the year or the year and month (credit card expiration date is a good example of this from the consumer forms world). Would like an option for date questions that only asks:
-year
-month (where current year is assumed)
-month + year

The response could be saved using the midpoint of the month or year selected to facilitate future analysis of the data.

Add Mask feature for structured numeric and text entry fields

Some fields require data validation that involves specific ranges for each character. For example:
Program number must be in aaa-a###-## format.
A mask feature should define the number of characters and validation requirements for each character in a question response.

OrientationPublisher should unlisten for events

It currently listens to events forever, slowing down the app permanently. It should probably be an object with a destroy method that unlistens to events, or it should realize when no one is listening and unlisten to the window events. The object solution is probably cleaner and more testable. Singletons that produce events are problematic.

Nav menu improvements

The nav menu is really nice but a few small improvements would make it much more useful:

  • Sections are often long enough that the questions in the nav menu stretch below the bottom of the current window. This means that the nav menu is no longer usable for jumping quickly to another section, which is what I find to be the most useful feature. Would it be possible to only show a few questions around your current position, with ellipses, then the other sections? Is this is difficult, an alternative would be to switch to a section-only mode in the menu for more than X questions in a section. This might be equally good from a usability perspective.
  • A completely different alternative to the last point would be to make the nav menu always in section-only mode, but click to expand the section into individual questions.
  • When you click on a section title in the nav menu, you are brought to the first question of that section, but the section title itself is hidden above, off-screen.
  • Clicking on a question title in nav menu aligns the page with the answers to the question, but the question text itself is hidden above the current view.

Correct behavior of LocationView on weak signals

Temporarily Set Rough Location is ambiguous: Does that mean it set the location or that tapping it will set the location?

The original spec was:

When Set is pushed, if has no GPS signal, displays ugly red label "Waiting for GPS" that remains until success or failure.

If has bad signal (low accuracy), displays "Waiting for better GPS accuracy" in yellow label, with small button "Use Anyway" that uses bad accuracy position at which point green label "Location Set Successfully" appears below and fades out after a few seconds

Let's make sure that it doesn't set the location with a non-strong signal at all unless the override is clicked.

Also, the "Waiting for GPS..." when set location is clicked and there is no signal should be an ugly red notification, entirely separate from the smaller red warning on the right when it can't display relative location

Analyse success/failure of phones HTML5 compass

So far (using MDN demo page)

  • Galaxy S3 4.3 Chrome: Partial (flips between 180&360)
  • Galaxy S3 4.3 Stock: Yes
  • Techno P5 4.2.2 Chrome: Fail (no idea why)
  • Techno P5 4.2.2 Stock: Fail (no idea why)
  • Infuse 4G 2.3 Stock: Fail (no idea why)
  • Intel Yolo 4.0.4 Chrome: Fail to load (no idea why)
  • Intel Yolo 4.0.4 Stock: Partial (jitters a lot, incorrect when laying flat)

Add clicker question

Add a question where the user presses a button each time an event happens and a running tally is displayed. This is important in direct observation studies (like counting the number of people per hour who visit a water source). The physical analog for this would be the handheld clickers used to count people entering concerts or events. Here is an example:
clicker-11
If we take this as the analogy, there should be a prominent click button and a smaller reset button, that comes with a warning popup before erasing the count. Maybe also include in the question edit box an option to determine the number of digits displayed.

Add currency conversion feature for survey responses

Develop a set of standard currencies for a money question that could be converted to other currencies using public exchange rate databases. The response could then be viewed and exported in another currency using the exchange rate from that day.

Make code comments blend in

I know that this is a trivial and probably annoying request, but can you make code comments look like this:

# Some comment

instead of

#some comment

so that they blend in?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.