Skip to content

Commit

Permalink
ENH: Disable correctAns ctrl for JoyButtons when it would not be used…
Browse files Browse the repository at this point in the history
… in boilerplate
  • Loading branch information
TEParsons committed May 12, 2022
1 parent f9ef1be commit 2e66dc1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions psychopy/experiment/components/joyButtons/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ def __init__(self, exp, parentName, name='button_resp',
hint=msg,
label=_localized['storeCorrect'])

self.depends += [ # allows params to turn each other off/on
{"dependsOn": "storeCorrect", # must be param name
"condition": "== True", # val to check for
"param": "correctAns", # param property to alter
"true": "enable", # what to do with param if condition is True
"false": "disable", # permitted: hide, show, enable, disable
}
]

msg = _translate(
"What is the 'correct' key? Might be helpful to add a "
"correctAns column and use $correctAns to compare to the key "
Expand Down

0 comments on commit 2e66dc1

Please sign in to comment.