quarree100 / qScope_infoscreen

0 stars 0 forks source link

questionnaire view #6

Closed dunland closed 2 years ago

dunland commented 2 years ago

As briefly outlined in here, there is a preliminary questionnaire mode preceding the general input mode. We will need a simple layout like this:

infoscreen-mockup_mindsetQuestions_2022-03-08

As example questions, we can take these:

  • "Die globale Erderwärmung wird durch von Menschen produzierte Emissionen verstärkt."
  • "Der Schutz der Umwelt ist ein Mittel zur Stärkung des Wirtschaftswachstums in Deutschland."
  • "Ich glaube, dass wir jedes Mal, wenn wir Kohle, Öl oder Gas verwenden, zum Klimawandel beitragen."
  • "Ich würde meinen Energieverbrauch reduzieren, wenn mein Haushalt mehr Energie verbraucht als ähnliche Haushalte."
  • "Wenn ein erneuerbarer Energietarif bei einem anderen Energieversorger verfügbar wäre, würde ich meinen Anbieter wechseln."

each to be answered with yes or no. Each answer directly leads to the next question, and the last question eventually starts the general input mode.

open questions

kazux2 commented 2 years ago

I pushed some commits on data-view branch (work in progress).

(Status) Now, the questionnaire view shows the default 6 questions randomly. Todo: Change with socket message is implemented but not tested with socket messaging

dunland commented 2 years ago

Great! I just tested switching the modes via frontend. It works! Some more TODOs:

UPDATE: whenever the slider is updated, it sends a json string via UDP:

{
    "year": 0,
    "foerderung": 0,
    "CO2-Preis": 0,
    "CO2-emissions": 0,
    "versorgung": 0,
    "investment": 0,
    "anschluss": 0,
    "connection_speed": 0,
    "mode": "questionnaire",
    "answer": "yes"
}

These are the values that can be accessed using the slider (as of today).

kazux2 commented 2 years ago

image hi David, I created the questionnaire (single user mode) as above. I haven't tested with socket messaging yet, but the function is implemented. I couldn't recreate the bug you mentioned as the first todo. Do you mean when you hit the space bar to toggle the view, the question becomes "the question was not provided" after the second time? (In my envronment, everytime I enter the questionnaire mode, a randomely selected question shows up)

dunland commented 2 years ago

socket communication works perfectly! ..except that after some playing around, it always says "question not provided" ‒ switching the modes via space bar works fine and even reloads the question, but using the socket communication it does not. Is there a difference between the two ways of switching?

I though it would be a good idea to transmit a message containing "question_number" to access the specific questions one after the other.

{"year": 0, "foerderung": 0, "CO2-Preis": 0, "connection_speedCO2-emissions": 0, "versorgung": 0, "investment": 0, "anschluss": 0, "answer": "yes", "mode": "questionnaire", "question_number": 0}
dunland commented 2 years ago

https://github.com/quarree100/qScope_frontend/commit/b520f47abd080bd66bc97ad9b5ed3dd9889e7e97: The questions are now sent to the infoscreen via socket message directly. e.g. "question": "Die globale Erderwärmung wird durch von Menschen produzierte Emissionen verstärkt."

kazux2 commented 2 years ago

all implemented in data-view branch