## Sum of 4 answers as condition to proceed

##### Sum of 4 answers as condition to proceed
 Author Message dokemm posted Last Month ANSWER         Group: Forum Members Posts: 3, Visits: 15 Hi everyone, I am struggling with the following challenge.I have a survey page with four single textbox-questions where I ask participants to evaluate how much percent of their attention in the trial before was directed to four different categories. So, e.g., 20% to the task before, 70% to something else...I would like to check that participants can only proceed to the next survey page if the total amount of their shares of thoughts equals 100%. If it doesent, there shall be a warning message and particpiants need to adjust there answerts. My problem is, that I do not know how to implement this check. I need to add all the answers and check, whether the sum of the four answers = 100 percent. If so, the next surverypage should follow, if not participants would be encouraged to adapt their choice of values.I tried something like the following, but do not know how to proceed:/ontrialend = [if ((textbox.Seiteabbruch.response) + (textbox.komplettanderegedanken.response)+ (textbox.NBackGedanken.response)+ (textbox.NBackPerformanceGedanken.response)) == 100]I would be very happy about any help.This is the code./ caption = "... der Wohnungsaufgabe von davor? (in Prozent)"/ multiline = false/ required = true/ maxchars = 3/textboxsize = (3.5%,2.5%)slider ApartmentGedanken>/ caption = "... die Apartment-Aufgabe von davor nachgedacht?"/ subcaption = "        "/ labels = ("0%","10%", "20%", "30%", "40%", "50%","60%", "70%", "80&", "90%","100 %")/ range = (1%, 100%)/ slidersize = (50%, 5%)/required = false/ showtooltips = false/ increment = 1/ caption = "... etwas ganz anderem? (in Prozent)"/ multiline = false/ required = true/ maxchars = 3/textboxsize = (3.5%,2.5%)/ caption = "... der 3-Zurück-Aufgabe? (in Prozent)"/ multiline = false/ required = true/ maxchars = 3/textboxsize = (3.5%,2.5%)/caption ="XYZ."/ subcaption = "XYZ."/questions = [1 = ApartmentGedanken, KomplettAndereGedanken, NBackGedanken, NBackPerformanceGedanken]/showpagenumbers = false/showquestionnumbers = false/ errormessage = true(text.error, 3000)?????? Dave posted Last Month ANSWER         Group: Administrators Posts: 12K, Visits: 93K +x dokemm - 8/10/2023Hi everyone, I am struggling with the following challenge.I have a survey page with four single textbox-questions where I ask participants to evaluate how much percent of their attention in the trial before was directed to four different categories. So, e.g., 20% to the task before, 70% to something else...I would like to check that participants can only proceed to the next survey page if the total amount of their shares of thoughts equals 100%. If it doesent, there shall be a warning message and particpiants need to adjust there answerts. My problem is, that I do not know how to implement this check. I need to add all the answers and check, whether the sum of the four answers = 100 percent. If so, the next surverypage should follow, if not participants would be encouraged to adapt their choice of values.I tried something like the following, but do not know how to proceed:/ontrialend = [if ((textbox.Seiteabbruch.response) + (textbox.komplettanderegedanken.response)+ (textbox.NBackGedanken.response)+ (textbox.NBackPerformanceGedanken.response)) == 100]I would be very happy about any help.This is the code./ caption = "... der Wohnungsaufgabe von davor? (in Prozent)"/ multiline = false/ required = true/ maxchars = 3/textboxsize = (3.5%,2.5%)slider ApartmentGedanken>/ caption = "... die Apartment-Aufgabe von davor nachgedacht?"/ subcaption = "        "/ labels = ("0%","10%", "20%", "30%", "40%", "50%","60%", "70%", "80&", "90%","100 %")/ range = (1%, 100%)/ slidersize = (50%, 5%)/required = false/ showtooltips = false/ increment = 1/ caption = "... etwas ganz anderem? (in Prozent)"/ multiline = false/ required = true/ maxchars = 3/textboxsize = (3.5%,2.5%)/ caption = "... der 3-Zurück-Aufgabe? (in Prozent)"/ multiline = false/ required = true/ maxchars = 3/textboxsize = (3.5%,2.5%)/caption ="XYZ."/ subcaption = "XYZ."/questions = [1 = ApartmentGedanken, KomplettAndereGedanken, NBackGedanken, NBackPerformanceGedanken]/showpagenumbers = false/showquestionnumbers = false/ errormessage = true(text.error, 3000)??????/ caption = "... der Wohnungsaufgabe von davor? (in Prozent)"/ defaultresponse = values.resp1/ multiline = false/ required = true/ maxchars = 3/textboxsize = (3.5%,2.5%)/ caption = "... etwas ganz anderem? (in Prozent)"/ defaultresponse = values.resp2/ multiline = false/ required = true/ maxchars = 3/textboxsize = (3.5%,2.5%)/ caption = "... der 3-Zurück-Aufgabe? (in Prozent)"/ defaultresponse = values.resp3/ multiline = false/ required = true/ maxchars = 3/textboxsize = (3.5%,2.5%)/ caption = "... der 3-Zurück-Aufgabe? (in Prozent)"/ defaultresponse = values.resp4/ multiline = false/ required = true/ maxchars = 3/textboxsize = (3.5%,2.5%)/caption ="XYZ."/ subcaption = "XYZ."/questions = [1 = ApartmentGedanken, KomplettAndereGedanken, NBackGedanken, NBackPerformanceGedanken]/showpagenumbers = false/showquestionnumbers = false/ ontrialend = [    values.resp1 = textbox.ApartmentGedanken.response;    values.resp2 = textbox.KomplettAndereGedanken.response;    values.resp3 = textbox.NBackGedanken.response;    values.resp4 = textbox.NBackPerformanceGedanken.response;]/ branch = [    if (values.resp1 + values.resp2 + values.resp3 + values.resp4 != 100){        surveypage.tryagain;    };]/ resp1 = ""/ resp2 = ""/ resp3 = ""/ resp4 = ""/ caption = "The values need to add up to 100. Please try again."/ showpagenumbers = false/ branch = [    surveypage.Gedanken;]/ caption = "That's it."/ showpagenumbers = false/ trials = [1=surveypage.Gedanken; 2=surveypage.end] dokemm posted Last Month ANSWER         Group: Forum Members Posts: 3, Visits: 15 +x Dave - 8/10/2023+x dokemm - 8/10/2023Hi everyone, I am struggling with the following challenge.I have a survey page with four single textbox-questions where I ask participants to evaluate how much percent of their attention in the trial before was directed to four different categories. So, e.g., 20% to the task before, 70% to something else...I would like to check that participants can only proceed to the next survey page if the total amount of their shares of thoughts equals 100%. If it doesent, there shall be a warning message and particpiants need to adjust there answerts. My problem is, that I do not know how to implement this check. I need to add all the answers and check, whether the sum of the four answers = 100 percent. If so, the next surverypage should follow, if not participants would be encouraged to adapt their choice of values.I tried something like the following, but do not know how to proceed:/ontrialend = [if ((textbox.Seiteabbruch.response) + (textbox.komplettanderegedanken.response)+ (textbox.NBackGedanken.response)+ (textbox.NBackPerformanceGedanken.response)) == 100]I would be very happy about any help.This is the code./ caption = "... der Wohnungsaufgabe von davor? (in Prozent)"/ multiline = false/ required = true/ maxchars = 3/textboxsize = (3.5%,2.5%)slider ApartmentGedanken>/ caption = "... die Apartment-Aufgabe von davor nachgedacht?"/ subcaption = "        "/ labels = ("0%","10%", "20%", "30%", "40%", "50%","60%", "70%", "80&", "90%","100 %")/ range = (1%, 100%)/ slidersize = (50%, 5%)/required = false/ showtooltips = false/ increment = 1/ caption = "... etwas ganz anderem? (in Prozent)"/ multiline = false/ required = true/ maxchars = 3/textboxsize = (3.5%,2.5%)/ caption = "... der 3-Zurück-Aufgabe? (in Prozent)"/ multiline = false/ required = true/ maxchars = 3/textboxsize = (3.5%,2.5%)/caption ="XYZ."/ subcaption = "XYZ."/questions = [1 = ApartmentGedanken, KomplettAndereGedanken, NBackGedanken, NBackPerformanceGedanken]/showpagenumbers = false/showquestionnumbers = false/ errormessage = true(text.error, 3000)??????/ caption = "... der Wohnungsaufgabe von davor? (in Prozent)"/ defaultresponse = values.resp1/ multiline = false/ required = true/ maxchars = 3/textboxsize = (3.5%,2.5%)/ caption = "... etwas ganz anderem? (in Prozent)"/ defaultresponse = values.resp2/ multiline = false/ required = true/ maxchars = 3/textboxsize = (3.5%,2.5%)/ caption = "... der 3-Zurück-Aufgabe? (in Prozent)"/ defaultresponse = values.resp3/ multiline = false/ required = true/ maxchars = 3/textboxsize = (3.5%,2.5%)/ caption = "... der 3-Zurück-Aufgabe? (in Prozent)"/ defaultresponse = values.resp4/ multiline = false/ required = true/ maxchars = 3/textboxsize = (3.5%,2.5%)/caption ="XYZ."/ subcaption = "XYZ."/questions = [1 = ApartmentGedanken, KomplettAndereGedanken, NBackGedanken, NBackPerformanceGedanken]/showpagenumbers = false/showquestionnumbers = false/ ontrialend = [    values.resp1 = textbox.ApartmentGedanken.response;    values.resp2 = textbox.KomplettAndereGedanken.response;    values.resp3 = textbox.NBackGedanken.response;    values.resp4 = textbox.NBackPerformanceGedanken.response;]/ branch = [    if (values.resp1 + values.resp2 + values.resp3 + values.resp4 != 100){        surveypage.tryagain;    };]/ resp1 = ""/ resp2 = ""/ resp3 = ""/ resp4 = ""/ caption = "The values need to add up to 100. Please try again."/ showpagenumbers = false/ branch = [    surveypage.Gedanken;]/ caption = "That's it."/ showpagenumbers = false/ trials = [1=surveypage.Gedanken; 2=surveypage.end]Hallo Dave, I am so thankful. It works now. I did not know about the step to transfer the response to the values. Now it all makes sense. Thank you very much.

#### Merge Selected

Merge into selected topic...

Merge into merge target...

Merge into a specific topic ID...