Total score + branching


Author
Message
k.vanschie@tilburguniversi...
k.vanschie@tilburguniversity.edu
Associate Member (59 reputation)Associate Member (59 reputation)Associate Member (59 reputation)Associate Member (59 reputation)Associate Member (59 reputation)Associate Member (59 reputation)Associate Member (59 reputation)Associate Member (59 reputation)Associate Member (59 reputation)
Group: Forum Members
Posts: 10, Visits: 22
Hi all, 

I have a survey that consists of four pages. Each surveypage contains four items and each item is scored on a five point scale (1 to 5). I am trying to achieve two things.

  • First I want to create a total score over all 16 items (simply summing up all item score, no need for reversing item scores).
  • Second, I want to add branching. If the total score is 32 or less or 75 or more the experiment should simply continue as is (with the next block). If it is within those values then it should skip over a number of blocks.
I am trying to find out how I can calculate that total score but couldn't readily find it in the manuals. Also, I am unsure on what level I should calculate this; I assumed the survey level, but perhaps code needs to be added at each surveypage level as well. The same goes for the branching, how and where should I add this?

Thanks for all the help!
Kevin
k.vanschie@tilburguniversi...
k.vanschie@tilburguniversity.edu
Associate Member (59 reputation)Associate Member (59 reputation)Associate Member (59 reputation)Associate Member (59 reputation)Associate Member (59 reputation)Associate Member (59 reputation)Associate Member (59 reputation)Associate Member (59 reputation)Associate Member (59 reputation)
Group: Forum Members
Posts: 10, Visits: 22
Perhaps it's helpful to add what I thought I needed to do for Question 1.

I declared values at the experiment level

<values>
/ VVIQtotal = 0
</values>


At the survey level I added an 'onblockend' property to create the total score and then addd a summary data element:

### VVIQ SURVEY (BLOCK/SURVEY LEVEL)

<survey VVIQ>
/ pages = [1 = VVIQ_PAGE1; 2 = VVIQ_PAGE2; 3 = VVIQ_PAGE3; 4 = VVIQ_PAGE4]
/ showpagenumbers = false
/ showbackbutton = false
/ nextbuttonposition = (90, 90)
/ onblockend = [
      values.VVIQtotal =
   values.VVIQ1 + values.VVIQ2 + values.VVIQ3 + values.VVIQ4 +
   values.VVIQ5 + values.VVIQ6 + values.VVIQ7 + values.VVIQ8 +
   values.VVIQ9 + values.VVIQ10 + values.VVIQ11 + values.VVIQ12 +
   values.VVIQ13 + values.VVIQ14 + values.VVIQ15 + values.VVIQ16;
]
</survey>

<summarydata>
/ columns = (values.VVIQtotal)
</summarydata>

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 109K
Perhaps it's helpful to add what I thought I needed to do for Question 1.

I declared values at the experiment level

<values>
/ VVIQtotal = 0
</values>


At the survey level I added an 'onblockend' property to create the total score and then addd a summary data element:

### VVIQ SURVEY (BLOCK/SURVEY LEVEL)

<survey VVIQ>
/ pages = [1 = VVIQ_PAGE1; 2 = VVIQ_PAGE2; 3 = VVIQ_PAGE3; 4 = VVIQ_PAGE4]
/ showpagenumbers = false
/ showbackbutton = false
/ nextbuttonposition = (90, 90)
/ onblockend = [
      values.VVIQtotal =
   values.VVIQ1 + values.VVIQ2 + values.VVIQ3 + values.VVIQ4 +
   values.VVIQ5 + values.VVIQ6 + values.VVIQ7 + values.VVIQ8 +
   values.VVIQ9 + values.VVIQ10 + values.VVIQ11 + values.VVIQ12 +
   values.VVIQ13 + values.VVIQ14 + values.VVIQ15 + values.VVIQ16;
]
</survey>

<summarydata>
/ columns = (values.VVIQtotal)
</summarydata>

Values are just variables, they will not do anything unless you set them to something, here: the score for a given question. But that isn't even necessary. Define proper /optionvalues in your survey questions, sum up the responses in a single varaible /onvlockend, and then /skip whatever subsequent blocks you need on that basis. Simple example:

<expt myExpt>
/ blocks = [1=a; 2=b; 3=c]
</expt>

<values>
/ totalScore = 0
</values>

<block a>
/ onBlockEnd = [
    values.totalScore = (radiobuttons.q1.response + radiobuttons.q2.response + radiobuttons.q3.response + radiobuttons.q4.response)
]
/ trials = [1=pageOne; 2=pageTwo]
</block>

<surveypage pageOne>
/ questions = [1=q1; 2=q2]
/ showPageNumbers = false
/ showQuestionNumbers = false
</surveypage>

<surveypage pageTwo>
/ questions = [1=q3; 2=q4]
/ showPageNumbers = false
/ showQuestionNumbers = false
</surveypage>

<radiobuttons q1>
/ options = ("Option A", "Option B", "Option C", "Option D", "Option E")
/ optionValues = ("1", "2", "3", "4", "5")
</radiobuttons>

<radiobuttons q2>
/ options = ("Option A", "Option B", "Option C", "Option D", "Option E")
/ optionValues = ("1", "2", "3", "4", "5")
</radiobuttons>

<radiobuttons q3>
/ options = ("Option A", "Option B", "Option C", "Option D", "Option E")
/ optionValues = ("1", "2", "3", "4", "5")
</radiobuttons>

<radiobuttons q4>
/ options = ("Option A", "Option B", "Option C", "Option D", "Option E")
/ optionValues = ("1", "2", "3", "4", "5")
</radiobuttons>

<block b>
/ skip = [
    return (values.totalScore > 5 && values.totalScore < 15) // if score is between 5 and 15 (exclusive), block is skipped
]
/ trials = [1=bTrial]
</block>

<trial bTrial>
/ stimulusFrames = [1=bText]
/ validResponse = (" ")
</trial>

<text bText>
/ items = ("This is block B. Your survey score was <%values.totalScore%>.")
</text>

<block c>
/ trials = [1=cTrial]
</block>

<trial cTrial>
/ stimulusFrames = [1=cText]
/ validResponse = (" ")
</trial>

<text cText>
/ items = ("This is block C. Your survey score was <%values.totalScore%>.")
</text>


k.vanschie@tilburguniversi...
k.vanschie@tilburguniversity.edu
Associate Member (59 reputation)Associate Member (59 reputation)Associate Member (59 reputation)Associate Member (59 reputation)Associate Member (59 reputation)Associate Member (59 reputation)Associate Member (59 reputation)Associate Member (59 reputation)Associate Member (59 reputation)
Group: Forum Members
Posts: 10, Visits: 22
This makes sense! So every subsequent block that needs to be skipped based on the total score needs to contain this piece of code (i made adjustments so that it fits with my experiment):

/ skip =[
return (values.VVIQtotal > 32 && values.VVIQtotal < 75);
]


Because I have quite a few blocks I wondered if it's possible to jump forward to block X?

Also, is there a way to store the actual value (in values.VVIQtotal) in the survey file that is created?
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 109K
This makes sense! So every subsequent block that needs to be skipped based on the total score needs to contain this piece of code (i made adjustments so that it fits with my experiment):

/ skip =[
return (values.VVIQtotal > 32 && values.VVIQtotal < 75);
]


Because I have quite a few blocks I wondered if it's possible to jump forward to block X?

Also, is there a way to store the actual value (in values.VVIQtotal) in the survey file that is created?

> Because I have quite a few blocks I wondered if it's possible to jump forward to block X?

No, use /skip.

> Also, is there a way to store the actual value (in values.VVIQtotal) in the survey file that is created?

Not if you use <survey>, which produces a separate, wide-format (one row) data file. That data file's output cannot be customized.

Run your surveypages via a block, as in the example I gave you, and it all goes into a single long-format raw data file, which you can customize however you want.
k.vanschie@tilburguniversi...
k.vanschie@tilburguniversity.edu
Associate Member (59 reputation)Associate Member (59 reputation)Associate Member (59 reputation)Associate Member (59 reputation)Associate Member (59 reputation)Associate Member (59 reputation)Associate Member (59 reputation)Associate Member (59 reputation)Associate Member (59 reputation)
Group: Forum Members
Posts: 10, Visits: 22
Made the change to a block format. 

How can I store the total value in that format? In the raw data I know only see the individual responses to every item, but it would be convenient if I could immediately see the total score (per participant) in a column somewhere. Is that possible?
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 109K
Made the change to a block format. 

How can I store the total value in that format? In the raw data I know only see the individual responses to every item, but it would be convenient if I could immediately see the total score (per participant) in a column somewhere. Is that possible?

You need to define a <data> element, with its /columns speciying everything you want loggged. You can find all of this detailed in the documentation and Programmer's Manual.

https://www.millisecond.com/support/docs/v6/html/language/attributes/columns.htm
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search