Code Monkey home page Code Monkey logo

pathway's Introduction

Open Data Pathway

Open Data Pathway is a tool to help organisations carry out an assessment of their open data maturity (ODMAT).

The tool allows users to complete a series of short questionnaires to help calculate the maturity of a number of processes in the organisation, e.g. how data is released and governed.

After completing an assessment the tool will provide the organisation with a maturity score and will create a suggested action plan to help them improve their rating. The report will also include any notes and links to evidence provided during the assessment.

To help benchmark organisations, and to provide a sense of the maturity of the overall community of users, the tool also includes some anonymised statistics. These statistics are published as open data.

Summary of features

Open Data Pathway is a rails app that currently supports the following user features.

Follow the public feature roadmap for Open Data Pathway

Assessments

  • User can register with the site to create one or more assessments
  • Basic account management features, including profile editing, password management, etc.
  • User can link themselves to a data.gov.uk organisation to benchmark against their peer organisations
  • Assessment can be started and resumed at any point; user can tackle activity assessments in any order
  • Simple multiple choice questions with supporting help text; user can attach notes and add links to provide evidence of progression

Reports

  • Maturity assessments automatically calculated when assessment is finalised
  • Maturity scores available as high-level summary as well as a detailed breakdown for each activity
  • Maturity scores can be downloaded as a CSV file to allow scores to be used elsewhere
  • The user leading the assessment can share the report with colleagues using a signed link
  • The completed report includes the answers and evidence provided by the user, as well as suggestions for how to improve
  • Application retains archive of reports to allow for, e.g. annual assessments of progress
  • User can set targets scores for each activity, to indicate how they expect to improve between assessments

Statistics

  • Heatmap showing scores for all completed assessments in the system and those for all data.gov.uk organisations
  • A data.gov.uk organisation can compare itself against others in its department (e.g. Defra)
  • Statistics are published as open data for reuse by the community

Development

Build Status Dependency Status Code Climate Badges

Requirements

Ruby 2.4.1

Environment variables

The .env file in the application directory should contain:

MANDRILL_APIKEY=...
MANDRILL_USERNAME=...
GOOGLE_ANALYTICS_TRACKER=UA-XXXX-Y
ADMIN_EMAIL=...
ADMIN_PASSWORD=...
HEATMAP_THRESHOLD=1

The variables are:

  • MANDRILL_APIKEY and MANDRILL_USERNAME are for accessing mandrill API for sending emails
  • GOOGLE_ANALYTICS_TRACKER is the Google Analytics key, this can be defaulted in the dev environment
  • ADMIN_EMAIL and ADMIN_PASSWORD are read during rake db:seed to create a default admin user in the system with the given credentials
  • HEATMAP_THRESHOLD is the number of completed assessments that must be in the system before the statistics are shown to users. Helps to anonymise data when there are only a small number of completed assessments in the system or from a specific data.gov.uk organisation. Recommend to use 1 in development and 5 in production.

These environment variables should also be configured on Heroku - see below. The Mandrill ones (and those for Postgres which are not shown here) are handled when the addon is deployed for the app. The others needs to be manually added.

Development: Running the full application locally

Checkout the repository and run bundle in the checked out directory.

Intialise the database with

rake db:migrate
rake countries:import
rake questionnaire:import

To start the application run rails s in the checked out directory

Application should be available in a web browser at http://localhost:3000/

Tests

Open Data Pathway uses rspec and cucumber frameworks and requires an .env file with the variables stipulated above

To run unit tests execute bundle exec rspec

To run Cucumber features execute bundle exec cucumber

Rake Tasks

In addition to the default Rails tasks the application has a couple of extra rake tasks

  • questionnaire:import - import the questionnaire in survey/survey.xls into the database, used when seeding the app. Should have version number and optional notes parameters, e.g. rake questionnaire:import[1] imports the survey as version `.
  • questionnaire:update - updates a specified version of the questionnaire, using the questions from survey/survey.xls. Should have version number parameter, e.g. rake questionnaire:update[1] imports the survey as version `. Use this when changes have been made to the survey text.
  • organisations:import - imports the list of data.gov.uk organisations into the database
  • organisations:weekly_import - hack to run the above on a weekly basis in heroku
  • statistics:generate - generate the statistics for all completed assessments. Should be configured to run on heroku via the scheduler

Both the statistics generation and weekly organisation import should be configured to run regularly on heroku via the scheduler.

The questionnaire import is only used when seeding the database or when making enough modifications to the questionnaire that it warrants creating a new version (see below). If there have just been changes to the text for existing questions or help text then use the import task, specifying the right version.

The Survey Questionnaire

The questions for the assessment can be found in survey/survey.xls. A spreadsheet was used to try to make it easier to review and edit the question text separately from the application. The spreadsheet is read by the questionnaire:import and questionnaire:update tasks to populate and update the database.

NOTE: currently the application doesn't have a fully developed model for versioning the questionnaire. Care needs to be taken when creating entirely new versions, rather than updated. This is something that was planned to be improved at a later date. Currently the version number in the database is collected as a basic versioning mechanism, but this is not evident to the user and there is no way to stage releases: a newly added version will immediately become the default for users.

The spreadsheet consist of three worksheets:

  • activities - list of the dimensions and activities that define the framework for the questionnaire
  • questions - all questions, answers and help text
  • improvements - list of suggested improvements associated with specific answers

Activities

The activities worksheet has the following columns:

  • Dimension - name of dimension (from the open data maturity model), these are categories and have many activities
  • Activity - name of activity (from the open data maturity model)

Questions

The questions worksheet is structured as follows:

  • ID -- stable identifier for the question
  • Dimension -- the dimension of the maturity model to which the question relates. Should match an entry in the activities worksheet
  • Activity -- the activity to which the question relates. Should match an entry in the activities worksheeet
  • Question Text -- the text of the question
  • Question Notes -- any help text that should be displayed to the user alongside the question
  • Dependency -- indicates whether this question is dependent on whether the user has given a positive answer to a previous question
  • Answer ID -- stable identifier for the answer
  • Answer Text -- text for an answer to this question
  • Positive? -- indicates whether this is a positive or negative answer. Selecting a negative answer will mean the user is not asked any further questions. A positive answer may mean that the user has to answer some additional dependent questions
  • Maturity Score -- the score that the user receives for answering this question, any path through the questions for a specific activity should yield a single score
  • Internal Notes -- working notes for editors, not to be loaded into the database

Improvements

The improvements worksheet is structured as follows:

  • ID -- stable identifier for the improvement
  • Answer ID -- the answer to which the improvement relates. Should match an entry in the questions worksheet
  • Notes -- the text displayed to the user

An answer may have several improvements associated with it, e.g. a list of recommended tasks. These are displayed to the user based ordered by the ID in the spreadsheet.

Deployment

Deployment on Heroku

Currently there are two deployment: a live site and a test server. Both use the following add-ons:

  • Heroku Postgres
  • Mandrill
  • Heroku Scheduler - for running the data.gov.uk download and statistics generation

The Travis build is configured to automatically deploy successful builds of master to the odmat-staging application.

Releases to production have so far been done manually: the production heroku app is set up as a remote git repo and code is pushed to that (git push production master).

$ git remote -v
origin	[email protected]:theodi/ODMAT.git (fetch)
origin	[email protected]:theodi/ODMAT.git (push)
production	https://git.heroku.com/odmat.git (fetch)
production	https://git.heroku.com/odmat.git (push)

pathway's People

Contributors

dependabot[bot] avatar digitalwestie avatar floppy avatar langphil avatar ldodds avatar olivierthereaux avatar pezholio avatar quadrophobiac avatar sumikasan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pathway's Issues

On organisation taken error allow email contact between users

For MVP, we'll allow only a single user account for each d.g.u organisation. This can be a shared login if necessary.

If a user tries to register and associate themselves with an organisation, then they should get an error msg. Similarly when editing a profile.

Error should offer option to contact the existing user, e.g. system will send them an email.

extract organisation hierarchy from d.g.u

Create assessment model

Assessment:

  • id
  • user id
  • start date
  • completion date
  • title
  • notes
  • list of assessment answers

Assessment Answer

  • question id
  • answer id
  • notes
  • list of links

Link

  • assessment answer id
  • link
  • text

Improve the application layout

We need to finalise the basic header/footer navigation for the application and create the proper application layout and basic CSS.

What is there currently is just cobbled together from existing sources.

User can mark assessment as "completed"

An assessment is "in progress" until it is marked as "completed".

A user can only have one in-progress assessment at a time.

Can't be marked as completed if not all of the answers have been given

User can add notes to any answer

Any time the user is prompted to answer a question, it should be possible for them to add some notes.

These notes will be used to capture context, additional evidence and/or notes from the assessor that will help people viewing the results.

create about pages

Need to have these basic pages:

  • terms of use
  • privacy policy
  • cookie policy

Also some user guides covering:

  • introduction to using the tool, basic user guides
  • references to the maturity model docs
  • summary of history, noting ODI/defra collaboration, funding sources, where to get the code

A user can set targets when completing an assessment

Once a user has completed their first assessment, they can set targets for each of the activities.

By default the targets will be one level above their current rating, but can be altered. These targets will be stored against the assessment (add a column to the Score model?) and used when presenting results of future assessment. By making targets a property of the assessment then we can also potentially track targets over time.

The rationale behind setting targets after an assessment is that its best to take someone through an assessment first, then let them identify areas for improvement. This helps ensure they have accurate expectations from the outset.

Only one user per organisation

For MVP, we'll allow only a single user account for each d.g.u organisation. This can be a shared login if necessary.

If a user tries to register and associate themselves with an organisation, then they should get an error msg. Similarly when editing a profile.

Dependent on #45

User can compare their summary results with all other responses

User can request to see their results in context against the general population of other organisations completing assessments.

Imagine this as a tabular view of the results with a heatmap indicating where other organisations sit on the maturity model.

implement questionnaire model

Questionnaire

  • id
  • version number
  • list of questions

Question

  • questionnaire id
  • dimension - one of the five different dimensions in the model
  • activity - one of the 15 different activities
  • the question
  • list of answers

Answer

  • question id (which question is it an answer to)
  • text of answer (some will be just yes/no, others will be more descriptive)
  • scoring -- minimum maturity score if this answer is selected
  • list of suggested improvements

User can share authorised link to assessment results

User can request a "sharing link" that can be used to give an anonymous user access to view the summary and detailed responses to an assessment.

This allows them to share results more widely with their organisation. Or, if they choose, publicly.

User can view list of their assessments

The list of assessments should have:

  • date assessment was begun
  • date assessment was completed
  • link to results (both summary and details)
  • status

The list should have the current in-progress assessment first, then the others in reverse chronological order based on completion date.

user can associate themselves with an organisation

when registering a user can associate their account with an organisation. they should be offered a suggestion of using one of the organisations from data.gov.uk or adding via free-text entry.

The suggestions should use a type-ahead style as there are lots of orgs in data.gov.uk.

User can assess their maturity for a given activity

As a user, once I have started an assessment, I should be able to Begin assessing my maturity for an individual activity.

@jenthomson @sumikasan Note: we have a dependency here to make sure we know how the questionnaire will be structured, e.g. one question per page or questions displayed as required.

Regardless of UX, there's a few things that the application will need to be able to do, e.g:

  • identify next question that should be answered, if the user made a positive answer to this one
  • identify that the assessment is completed if the user made a negative answer to the current question

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.