← Back to team overview

dhis2-users team mailing list archive

Re: Program Rule Expression Executing Before being Called

 

Hi there Oladiran!
I assume that the score is assigned client side to a "score" field, thus making it visible to the person entering the data. It sounds like you have used d2:hasValue('#{optionDataElementName}') to ensure that the assignment should not happen until the #{optionDataElementName} gets a value? If you have done this and it does not work, please register a bug in jira.dhis2.org and provide more details on the rules that fail.

Thanks for reporting!

Markus

> 12. jan. 2018 kl. 12.35 skrev Oladiran, Olakunle Francis <ooladira@xxxxxxxxx>:
> 
> Dear Experts,
> 
> I trust you are well. I defined a set of program rules for a tracker-based program stage whose data elements have option set coded between 0-3. Conditions were set for these option set to calculate scores using suggested syntax, however, the program stage is registering the scores before the user clicks the options. If the user clicks the correct answer the score remains the same but if wrong answer is chosen, the score reduces(which is accurate). The issue is how to make score register only on-click and not before.
> 
> Also, note that priority were set for the levels of scoring and the function d2:HasValue( '  ') has been used to solve this issue, but its all to no avail. Kindly suggest how best to solve this issue.
> 
> Thank you,
> Oladiran Olakunle
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-users <https://launchpad.net/~dhis2-users>
> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx <mailto:dhis2-users@xxxxxxxxxxxxxxxxxxx>
> Unsubscribe : https://launchpad.net/~dhis2-users <https://launchpad.net/~dhis2-users>
> More help   : https://help.launchpad.net/ListHelp <https://help.launchpad.net/ListHelp>


References