Git Product home page Git Product logo

survey_display's Introduction

Survey Display Stories in Ready

Survey Display is a minimal flask and elm application hooked to a Postgres database to conduct surveys. Contrary to most survey apps, it can store responses in memory locally in the browser as responses are submitted, until the connection is recovered and all responses are submitted together to the remote server.

Installation

Clone the Github repository and follow the instructions on the wiki.

git clone https://github.com/erdl/survey_display.git

Usage

Create questions and responses on the database, and survey_display will serve them as different URLs. For a GUI interface to adding questions, and surveys, see survey_admin project.

Documentation

Please see the wiki for the project documentation.

Known Issues

Please see Issues for known bugs and new feature requests.

Contributing

A CONTRIBUTING.md will be updated soon. Currently, the project is maintained by ERDL. Feel free to open an issue if you are interested in contributing.

License

Please feel free to use this project code. Code dependencies are still being assessed to decide on a license.

survey_display's People

Contributors

carlosparadis avatar fourthetrees avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

survey_display's Issues

Elm Source in Survey_Display_Local does not match compiled Javascript of Survey_Display_Server

Some Background

For unknown reasons, Forrest created two projects originally: Occupant Query and Occupant Query Server. These projects have been labeled respectively to Survey Display Local and Survey Display Server, under the wrong assumption the Local was installed on the tablet. However, this was recently found to not be the case (see issue #1). As such, the true intent of the local code is unknown.

The survey_display_server, which handles everything follows more-or-less an MVC architecture (or more specifically a Model-Template-View). The View portion was done in Elm, which compiles to javascript. As such, if we want to edit the view portion of the surveys, we must have the elm code. The javascript compiled is not at all easy to edit.

The start of the problem

For unknown reasons, the Elm code is not available in the survey_display_server, only the compiled javascript. This means the website is functional, but the structure is non-editable. survey_display_local has elm files. Up to this point, we assumed the source elm in one project compiled to the javascript on the other.

Well, that assumption was incorrect. As such, it is impossible to edit the Views of survey_display_server. Just use them, which is clearly a dead end for maintaining it on the long-run.

Next Steps

We need to find the .elm associated to survey_display_server. There are a chance survey_display_local older commit versions may contain it. But as it is, there is no easy way to track it. Additional options look into the server where the development of the code was made if it still exists there.

Update folder names on the server to survey_display

This may look cosmetics but there is a deeper meaning to this: We need to get a better sense of what breaks if we rename/edit and what doesn't since we decided to move forward in maintaining this project.

I know some crawlers make assumptions on the original name the folder was created, and I wouldn't be surprised if Flask acts similarly.

This is also a good opportunity to create tests. The question, however, is how if at all possible. Minimally, we should at least have a document with things that need to be done before any major release on it-vm.

Change size of buttons so they are all the same

Jim would like the buttons on the kiosk to all be the same size, not dependent on the length of the word, stack the words on a button, get all buttons running across on one line if possible.

Display likert scale instead of "Strong Disagree - Strongly Agree" 5 point scale

This feature was requested by Jim to be shown on the 1-question kiosk version. The likert scale is discussed here. It looks like this right now:

screenshot 2017-09-08 21 55 10

Across all kiosk questionnaires.

I have some concerns with the likert scale. I understand there is a need to have the questions appeal to the users so they use it, but we need to be careful to not compromise the interpretation of the responses, something often criticized on this scale. Maybe we can discuss this at a later meeting.

On a side note, I found this article accidentally which contain nice illustrations in case we ever need it.

Next Steps

  1. Currently, only one button has the emoji. @ryantanaka was it discussed which other emojis were wanted to be used?

  2. I see the text is still being displayed. Is this the intent or removing the text and just leaving the emojis?

  3. I was going to ask about changing code directly on production, but I just remembered the change was actually done in the production database. This is still a bit concerning :') We may want to revisit this kind of "database production testing" at some point using the local server we have in ERDL lab..

Replace scrape-util cron job to collect survey data, and insert it directly into the database

@ryantanaka

I was considering giving this to Matt, but I think you will catch up on this before he would after that long issue.

Considering Matt finishes the Hobo, eGauge, and Webctrl scripts, to fully retire it we also need to replace the module that handles data acquisition of survey_display in a folder and stores into the database.

I am not sure why we have this intermediate step where .txt files are saved, and then a cron job stops by, instead of simply inserting into the database directly either.

If there is a reason for this, we can replace by a minimal python script on a cron job too.

Thoughts?

can't access forrest folder on machine in the lab

@ryantanaka I keep getting something about the folder being unmounted.

Can you try ssh into it and see if you can find for example the folder containing the code from survey_display? If so paste me the path where it is. Maybe I am looking at the wrong place.

Add dynamic color scheme to option buttons

  • need to be able to edit the color of the buttons via the database
  • HEX color column must be added to kiosk.options
  • HEX colors must be retrieved and embedded into the option buttons as a styling

Notes from Eileen & Jim on what they want:

new doc 2017-11-07 13 17 16_1 1

Notes for myself:

Elm test code to style buttons. Will look at how to work this into our existing code.

Currently working through Elm docs.

great video explaining Elm type aliases

Article explaining Maybe

Anonymous function explanation <- will need this to map options to buttons in Components.elm

elm_add_css

survey is not working offline on the tablet

This app continues to function normally if/when the hosting device loses internet connectivity; all data is held in-app until connectivity with the server is re-established.

To test this feature mentioned in the README, I ran the following scenario on the tablet:

  1. Successfully connect to test server, bringing up the survey page.
  2. Disconnect tablet from Wifi with survey page still open.
  3. Submit a few more surveys. (Pressing some of the response buttons, then seeing the "Thank You!" text popup several times) Page visibly functions properly.
  4. wait...

The survey page will timeout.

I will check the server to see if reconnecting after timeout actually sends those few responses that are logged while Wifi was unavailable. If that does work, then I will only need to fix the timeout issue. Currently not 100% sure how data is being held "in-app" client side when connection is lost.

Question on what determines the order of questions in the form

Hi, Guys.
I don't know if this is a display issue or survey admin issue. I'm looking at the order of the questions for a survey in survey admin http://csbcd01.soest.hawaii.edu/survey/74 Survey called IRB list2 deployed at testform1 http://csbcd01.soest.hawaii.edu/surveys/test1form and the order of the questions doesn't match. This is curious but not urgent since there is no immediate plan to deploy the form. Jim plans to deploy the kiosk.
Regards, Eileen
PS I see the table survey_question as a column called question_position and they are all zero. I'm assuming this needs to be incorporated into survey admin - to assign this number according to the order in which we select the questions.

Need to automate tablet refresh

@ryantanaka , when i change a question or survey on a URL, it does not show up on the tablet until the home button is pressed to refresh it. Can this be automated so it tries to refresh every few minutes? Thanks.

Allow certain text in survey question to be boldface, italic, etc

@carlosparadis,

I've got a feature request from Eileen. Right now survey questions display on the screen like this:
screenshot from 2018-07-23 10-50-15

She would like the ability to make specific text stand out more so that users don't miss key words in the questions. Reason being is that we've been testing survey_display on the tablet in the office (collecting data then running through the workflow on tableau). One day I changed the question, but we had gotten so used to the same question, Eileen didn't realize the question had been changed.

So, the above survey might look like this instead:
screenshot from 2018-07-23 11-10-51

I like the idea, and coding it up was fairly straightforward. In Elm, we create h2 html elements for questions. By changing this:

-- generate question text.
question_text : Txt -> Html Msg
question_text text =
Html.h2
[ Ha.classList [ ( "question-text", True ) ] ]
[ Html.text text ]

to this:

-- generate question text.
question_text : Txt -> Html Msg 
question_text text =
  Html.h2
    [ Ha.classList [("question-text", True)], (Ha.property  "innerHTML" <| string text)  ] []

we get the desired result.

In the database, the question text was changed from:

How acceptable is the air movement in the room?

to:

How acceptable is the <u>air movement</u> in the room?

The change in elm code basically means that it will "notice" html in the text and make an html element out of it. The only issue here is making a mistake when trying to underline or italicize something. For example, forgetting to close a <u> tag with </u> will mess things up. The good thing is that whoever makes this mistake will immediately see the question appear not as intended. Also Eileen is fine with writing those simple html elements.

Let me know what you think.

Need to enable the display of a "blank survey" during times which we want no one to submit surveys

Problem:

  • Kiosk Browser sleep scheduling allows for 1 sleep and 1 wake per day, therefore we don't have the ability to schedule multiple wakes and sleeps in one day.
  • When Kiosk Browser sleeps the tablet, it does not lock the screen.
  • In order to set up multiple scheduled times per day, we need to implement the back end logic such that for given time periods, a GET request to the site returns something like NO SURVEY AT THIS TIME, else it returns the survey.
    • the issue with this is that a page refresh needs to be done for the NO SURVEY AT THIS TIME to become visible... a forced page refresh will erase offline stored data in the event that wifi is down... a feature that we needed to be available

I've posted this question on the Kiosk Browser support site to see if we can address the second issue.

Needs to be solved and completed before January when we expect to deploy.

@carlosparadis , @eileenpeppard

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.