﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Millisecond Forums » Millisecond Forums » Inquisit 6  » using expressions to show a Tally for points</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Mon, 14 Sep 2026 15:29:55 GMT</lastBuildDate><ttl>20</ttl><item><title>using expressions to show a Tally for points</title><link>https://forums.millisecond.com/Topic29612.aspx</link><description>Hello,&amp;nbsp;&lt;br/&gt;&lt;br/&gt;In my script, particpants will be rewarded 5 cents if they are correct and lose 5 cents if they are incorrect. My goal is to show the particpants a tally of the total amount of money they have earned on each trial. &lt;br/&gt;&lt;br/&gt;With the code I have tried so far (shown below), the total monetary reward shows up and they gain 5 cents when they are correct, but instead of losing 5 cents when they are wrong, their amount stays the same.&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/score =1.00&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;**In trial**&lt;br/&gt;/ ontrialend = [values.score =  values.score + 0.50 *trial. DemBE_O.correct] &lt;br/&gt;**&lt;br/&gt;&lt;br/&gt;&amp;lt;item tally&amp;gt;&lt;br/&gt;/ 1 = "Total score: &amp;lt;% values.score%&amp;gt;"&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text tally&amp;gt;&lt;br/&gt;/ items = tally&lt;br/&gt;/ hposition = (80)&lt;br/&gt;/ vposition = (20)&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;I realize that in /ontrialend=, it make sense for them to not lose points because 0.50 is multiplied by 0.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;But if I wanted the tally of money to decrease by 5 cents, how would I do this? I am pretty sure I would have to use the expression element and maybe the if, else statments, but I am having trouble figuring out how to format it.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;I will also attach the full script for more context.&lt;br/&gt;&lt;br/&gt;Thank you in advance for your help!&lt;br/&gt;&lt;br/&gt;</description><pubDate>Tue, 25 Aug 2020 23:11:47 GMT</pubDate><dc:creator>uni-student92084</dc:creator></item><item><title>RE: using expressions to show a Tally for points</title><link>https://forums.millisecond.com/Topic29616.aspx</link><description>&lt;blockquote data-id="29615" class="if-quote-wrapper" unselectable="on" data-guid="1598397031875" id="if_insertedNode_1598397030906" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="29615" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="29615" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="29615" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;uni-student92084 - 8/25/2020&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-29615"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="29613" class="if-quote-wrapper" unselectable="on" data-guid="1598397031875" id="if_insertedNode_1598396004991" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="29613" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="29613" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="29613" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 8/25/2020&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-29613"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="29612" class="if-quote-wrapper" unselectable="on" data-guid="1598397031875" id="if_insertedNode_1598395773745" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="29612" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="29612" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="29612" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;uni-student92084 - 8/25/2020&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-29612"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Hello,&amp;nbsp;&lt;br/&gt;&lt;br/&gt;In my script, particpants will be rewarded 5 cents if they are correct and lose 5 cents if they are incorrect. My goal is to show the particpants a tally of the total amount of money they have earned on each trial. &lt;br/&gt;&lt;br/&gt;With the code I have tried so far (shown below), the total monetary reward shows up and they gain 5 cents when they are correct, but instead of losing 5 cents when they are wrong, their amount stays the same.&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/score =1.00&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;**In trial**&lt;br/&gt;/ ontrialend = [values.score =  values.score + 0.50 *trial. DemBE_O.correct] &lt;br/&gt;**&lt;br/&gt;&lt;br/&gt;&amp;lt;item tally&amp;gt;&lt;br/&gt;/ 1 = "Total score: &amp;lt;% values.score%&amp;gt;"&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text tally&amp;gt;&lt;br/&gt;/ items = tally&lt;br/&gt;/ hposition = (80)&lt;br/&gt;/ vposition = (20)&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;I realize that in /ontrialend=, it make sense for them to not lose points because 0.50 is multiplied by 0.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;But if I wanted the tally of money to decrease by 5 cents, how would I do this? I am pretty sure I would have to use the expression element and maybe the if, else statments, but I am having trouble figuring out how to format it.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;I will also attach the full script for more context.&lt;br/&gt;&lt;br/&gt;Thank you in advance for your help!&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="29612"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;You don't need the &amp;lt;expressions&amp;gt; element, all you need is a few simple if conditions in your /ontrialend logic.&lt;br/&gt;&lt;br/&gt;/ ontrialend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (trial.DemBI_P.correct) {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.score += 0.50;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} else if (trial.DemBI_P.error) {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.score -= 0.50;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br/&gt;]&lt;a class="if-quote-goto quote-link" href="#" data-id="29613"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;That makes sense, thank you Dave! &lt;br/&gt;One question, what do the symbols += and -= mean? I am guessing they mean add and subtract from value.score, right?&lt;a class="if-quote-goto quote-link" href="#" data-id="29615"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Correct.They're the increment and decrement operators: &lt;a href="https://www.millisecond.com/support/docs/v6/html/language/expressions/operators.htm"&gt;https://www.millisecond.com/support/docs/v6/html/language/expressions/operators.htm&lt;/a&gt;&lt;br/&gt;</description><pubDate>Tue, 25 Aug 2020 23:11:47 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: using expressions to show a Tally for points</title><link>https://forums.millisecond.com/Topic29615.aspx</link><description>&lt;blockquote data-id="29613" class="if-quote-wrapper" unselectable="on" data-guid="1598396005474" contenteditable="false" id="if_insertedNode_1598396004991"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="29613" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="29613" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="29613" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 8/25/2020&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-29613"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="29612" class="if-quote-wrapper" unselectable="on" data-guid="1598396005474" id="if_insertedNode_1598395773745" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="29612" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="29612" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="29612" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;uni-student92084 - 8/25/2020&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-29612"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Hello,&amp;nbsp;&lt;br/&gt;&lt;br/&gt;In my script, particpants will be rewarded 5 cents if they are correct and lose 5 cents if they are incorrect. My goal is to show the particpants a tally of the total amount of money they have earned on each trial. &lt;br/&gt;&lt;br/&gt;With the code I have tried so far (shown below), the total monetary reward shows up and they gain 5 cents when they are correct, but instead of losing 5 cents when they are wrong, their amount stays the same.&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/score =1.00&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;**In trial**&lt;br/&gt;/ ontrialend = [values.score =  values.score + 0.50 *trial. DemBE_O.correct] &lt;br/&gt;**&lt;br/&gt;&lt;br/&gt;&amp;lt;item tally&amp;gt;&lt;br/&gt;/ 1 = "Total score: &amp;lt;% values.score%&amp;gt;"&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text tally&amp;gt;&lt;br/&gt;/ items = tally&lt;br/&gt;/ hposition = (80)&lt;br/&gt;/ vposition = (20)&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;I realize that in /ontrialend=, it make sense for them to not lose points because 0.50 is multiplied by 0.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;But if I wanted the tally of money to decrease by 5 cents, how would I do this? I am pretty sure I would have to use the expression element and maybe the if, else statments, but I am having trouble figuring out how to format it.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;I will also attach the full script for more context.&lt;br/&gt;&lt;br/&gt;Thank you in advance for your help!&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="29612"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;You don't need the &amp;lt;expressions&amp;gt; element, all you need is a few simple if conditions in your /ontrialend logic.&lt;br/&gt;&lt;br/&gt;/ ontrialend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (trial.DemBI_P.correct) {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.score += 0.50;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} else if (trial.DemBI_P.error) {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.score -= 0.50;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br/&gt;]&lt;a class="if-quote-goto quote-link" href="#" data-id="29613"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;That makes sense, thank you Dave! &lt;br/&gt;One question, what do the symbols += and -= mean? I am guessing they mean add and subtract from value.score, right?</description><pubDate>Tue, 25 Aug 2020 23:03:16 GMT</pubDate><dc:creator>uni-student92084</dc:creator></item><item><title>RE: using expressions to show a Tally for points</title><link>https://forums.millisecond.com/Topic29613.aspx</link><description>&lt;blockquote data-id="29612" class="if-quote-wrapper" unselectable="on" data-guid="1598395774948" id="if_insertedNode_1598395773745" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="29612" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="29612" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="29612" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;uni-student92084 - 8/25/2020&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-29612"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Hello,&amp;nbsp;&lt;br/&gt;&lt;br/&gt;In my script, particpants will be rewarded 5 cents if they are correct and lose 5 cents if they are incorrect. My goal is to show the particpants a tally of the total amount of money they have earned on each trial. &lt;br/&gt;&lt;br/&gt;With the code I have tried so far (shown below), the total monetary reward shows up and they gain 5 cents when they are correct, but instead of losing 5 cents when they are wrong, their amount stays the same.&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/score =1.00&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;**In trial**&lt;br/&gt;/ ontrialend = [values.score =  values.score + 0.50 *trial. DemBE_O.correct] &lt;br/&gt;**&lt;br/&gt;&lt;br/&gt;&amp;lt;item tally&amp;gt;&lt;br/&gt;/ 1 = "Total score: &amp;lt;% values.score%&amp;gt;"&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text tally&amp;gt;&lt;br/&gt;/ items = tally&lt;br/&gt;/ hposition = (80)&lt;br/&gt;/ vposition = (20)&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;I realize that in /ontrialend=, it make sense for them to not lose points because 0.50 is multiplied by 0.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;But if I wanted the tally of money to decrease by 5 cents, how would I do this? I am pretty sure I would have to use the expression element and maybe the if, else statments, but I am having trouble figuring out how to format it.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;I will also attach the full script for more context.&lt;br/&gt;&lt;br/&gt;Thank you in advance for your help!&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="29612"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;You don't need the &amp;lt;expressions&amp;gt; element, all you need is a few simple if conditions in your /ontrialend logic.&lt;br/&gt;&lt;br/&gt;/ ontrialend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (trial.DemBI_P.correct) {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.score += 0.50;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} else if (trial.DemBI_P.error) {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.score -= 0.50;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br/&gt;]</description><pubDate>Tue, 25 Aug 2020 22:52:09 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>