Ask coding questions

← Back to all posts
1
My (Dutch) questionnaire is stuck in a loop
erikasomers (0)

I'm programing a questionnaire for a team with 3 statements about trust.

Ppl have to answer by saying:
1 if the statement never happens
2 if it sometimes happens, and
3 if it happens often.
If the sum of their answers on those 3 statements <=5 then an open question about trust has to be printed

If not, then the questionnaire goes on with 3 new statements about conflict in their team.

My questionnaire is stuck in a loop.
It asks statement 1 about trust
Then you can answer
And after answering 1, 2, or 3, you click enter, and that same question prints.
It doesn't go to statement 2.

Can someone help me with that?
https://repl.it/@erikasomers/Vragenlijst

The code is in the 'asked on repl.it folder

Commentshotnewtop
1
1
malvoliothegood (83)

@erikasomers
Glad to be of help. Happy coding :)

1
erikasomers (0)

Thanks @malvoliothegood I managed to fix the loop thanks to you.

What I mean by sum is, if:
statement 1 the input given is 1
statement 2 the input given is 1
statement 3 the input given is 2

then the sum of those 3 statements = 4

the code I want to
sum statements = statement1 + statement2 + statement3
if sum statement <= 5:
print "additional question"

But I can't seem to get that code to work.
Can you help me with that?

1
malvoliothegood (83)

@erikasomers
Have a look at the program again as I have added more to it: https://repl.it/@malvoliothegood/trust

1
malvoliothegood (83)

I am afraid I can not read Dutch, and I don't fully understand what you want the program to do, but this code may be of help: https://repl.it/@malvoliothegood/trust