block_number


Author
Message
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
ebroggin - Friday, November 11, 2016
Dave - Thursday, November 10, 2016
ebroggin - Thursday, November 10, 2016
Hello,

I am trying to add the number of the block (block_number) as value so after the block 9 and 18 the trial branch with another trial.

The counter goes back to 0 so I cannot trigger the trial that I wanted at the end of the blocks.

Any help?

Thank you so much,

Elena

> The counter goes back to 0 so I cannot trigger the trial that I wanted at the end of the blocks.

What makes you think the counter goes back to zero? I see nothing in the script that would reset values.block_number back to zero.

I do, however, see mistakes in your /branch attributes:

/ branch = [if (values.block_number = 18 ...) ...]

will not work because you are using the wrong operator. If you want to know whether the statement "values.block_number is equal to 18" is *true*, you need to use "==", the logical operator. "=" is the *assignment* operator, i.e., "the variable block_number shall now represent the number X". Thus:

/ branch = [if (values.block_number == 18 ...) ...]

is the correct syntax.

Also, code like this

/ branch = [if (...) {trial.stocksold_win_pt2; trial.end_pt2_win}]

does not make sense. You cannot /branch to *two* trials at once. You need to /branch to trial.stocksold_win_pt2. Then, *from* <trial stocksold_win_pt2> you need to /branch to trial.end_pt2_win.

Hope this helps.


Hi Dave,

Thank you for your big help as usual. 

Now I have another problem...I cannot branch at the end of block_num == 9 the trials: end_pt1_win or end_pt1_loss) after the relative trial (I have tried to branched in the script but with no results), and at the end of block_num == 18 the trials: end_pt2_win or end_pt2_loss.

Any suggestion?

Many thanks,

Elena

You need to be more specific here. In your description, please give the respective trial's names exactly as they are given in the script. Also, please describe *precisely* the flow of branches, etc. you intend to implement.

The fact that I cannot run the code -- because you included neither the images, nor the files required by the <include> elements -- doesn't help either.

Perhaps you can produce a stripped down version that does not require any of these.

Finally, I have no idea what you intend the /stop attribute in your <block>s to do

/ stop = [response == "Next_Stock"]

Apart from the fact that its syntax is not functional, if you stop a block, it won't run anymore trials.

Thanks.

tecnika
tecnika
Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)
Group: Forum Members
Posts: 156, Visits: 790
Dave - Thursday, November 10, 2016
ebroggin - Thursday, November 10, 2016
Hello,

I am trying to add the number of the block (block_number) as value so after the block 9 and 18 the trial branch with another trial.

The counter goes back to 0 so I cannot trigger the trial that I wanted at the end of the blocks.

Any help?

Thank you so much,

Elena

> The counter goes back to 0 so I cannot trigger the trial that I wanted at the end of the blocks.

What makes you think the counter goes back to zero? I see nothing in the script that would reset values.block_number back to zero.

I do, however, see mistakes in your /branch attributes:

/ branch = [if (values.block_number = 18 ...) ...]

will not work because you are using the wrong operator. If you want to know whether the statement "values.block_number is equal to 18" is *true*, you need to use "==", the logical operator. "=" is the *assignment* operator, i.e., "the variable block_number shall now represent the number X". Thus:

/ branch = [if (values.block_number == 18 ...) ...]

is the correct syntax.

Also, code like this

/ branch = [if (...) {trial.stocksold_win_pt2; trial.end_pt2_win}]

does not make sense. You cannot /branch to *two* trials at once. You need to /branch to trial.stocksold_win_pt2. Then, *from* <trial stocksold_win_pt2> you need to /branch to trial.end_pt2_win.

Hope this helps.


Hi Dave,

Thank you for your big help as usual. 

Now I have another problem...I cannot branch at the end of block_num == 9 the trials: end_pt1_win or end_pt1_loss) after the relative trial (I have tried to branched in the script but with no results), and at the end of block_num == 18 the trials: end_pt2_win or end_pt2_loss.

Any suggestion?

Many thanks,

Elena
Attachments
Hold_Sale_Task_revised.iqx (659 views, 29.00 KB)
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
ebroggin - Thursday, November 10, 2016
Hello,

I am trying to add the number of the block (block_number) as value so after the block 9 and 18 the trial branch with another trial.

The counter goes back to 0 so I cannot trigger the trial that I wanted at the end of the blocks.

Any help?

Thank you so much,

Elena

> The counter goes back to 0 so I cannot trigger the trial that I wanted at the end of the blocks.

What makes you think the counter goes back to zero? I see nothing in the script that would reset values.block_number back to zero.

I do, however, see mistakes in your /branch attributes:

/ branch = [if (values.block_number = 18 ...) ...]

will not work because you are using the wrong operator. If you want to know whether the statement "values.block_number is equal to 18" is *true*, you need to use "==", the logical operator. "=" is the *assignment* operator, i.e., "the variable block_number shall now represent the number X". Thus:

/ branch = [if (values.block_number == 18 ...) ...]

is the correct syntax.

Also, code like this

/ branch = [if (...) {trial.stocksold_win_pt2; trial.end_pt2_win}]

does not make sense. You cannot /branch to *two* trials at once. You need to /branch to trial.stocksold_win_pt2. Then, *from* <trial stocksold_win_pt2> you need to /branch to trial.end_pt2_win.

Hope this helps.


tecnika
tecnika
Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)
Group: Forum Members
Posts: 156, Visits: 790
Hello,

I am trying to add the number of the block (block_number) as value so after the block 9 and 18 the trial branch with another trial.

The counter goes back to 0 so I cannot trigger the trial that I wanted at the end of the blocks.

Any help?

Thank you so much,

Elena
Attachments
Hold_Sale_Task.iqx (641 views, 30.00 KB)
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search