Hi,

in the following simple interact function, the behavior I expect is:
1. user clicks on "New Question" and sees printed:
in new. question = 0  answer= 0
2. user types 100 (as an example) into the input_box, and right after
it clicks on "Check", and SHOULD see printed:
in check. question= 1  answer= 100

What I ACTUALLY get is:
1. user clicks on "New Question" and sees printed:
in new. question = 0  answer= 0
2. user types 100 (as an example) into the input_box, and right after
it clicks on "Check", and sees printed:
in new. question = 1  answer= 100

which seems to indicate that when a user types into the input_box, and
doesn't do anything before clicking on the "Check" selector button,
the "state" of the selector button doesn't change; only the state/
value of the input_box changes (i.e. one change at a time?).

I would expect that when I click on "Check", BOTH the value of the
input_box, AND the state of the selector would change or be recognized
by the system.

Isn't this a bug?

#-------------- the program: -------------
question = 0

@interact
def _setting(
    operation = ['Reset', 'New Question', 'Check'],
    user_answer = input_box(default = 0, label = 'Your answer:', width
= 25)
    ):

    global question

    if operation == 'New Question':
        print "in new. question =", question, " answer=", user_answer
        question = question + 1

    if operation == 'Check':
        print "in check. question=", question, " answer=", user_answer



Thanks for your help and clarification,

HMark.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to