Jack Rodgers Posted February 26, 2008 Share Posted February 26, 2008 Sorry about that but it is a good lead in... It's an old programmer trick but this is the first time I've found a use for it. Background: I am creating a user training table where three graphics are shown and then the user clicks a checkbox if that feature is found in one or more of the three graphics. The record also has fields for characteristics. I wanted to create a self-checking test where I could compile the correct choices from the data fields. Naturally this leads to some complex calcs but that is where the fun comes in, isn't it. My first try I used two text fields and created a value list naming the choices. My idea was to compare user input to computer calc. It worked fine except for one thing, the P. Since I used one field for each answer to create a text string to match the value list item(s), I had to append a P to each line. If the last item was blank then the previous item had a P on the end which isn't in the value list. Thus the two fields would not be equal for that particular record. After messing about for a while, I remembered the 1, 2, 4, 8... idea. I created a value list for each item: One: 1 Two: 2 Four: 4 Eight: 8 etc. I then created a CB text field and applied the corresponding checkbox to it: CB_One: One CB_Two: Two CB_Three: Three etc. Next I created the calculated field for each condition and assigned it the appropriate value list and checkbox formatting. Field: True Value: Value List CF_One: 1: One CF_Two: 2 : Two CF_Three: 3 : Three I then created a Sum Calc for CB_Sum and CF_Sum and then a cal for Correct/Wrong If CB_Sum = CF_Sum; Correct ; Wrong Of course I had to create a labeling global which is a repeating field, one rep for each CB_field(s). I use this for the label so I can change language or text label easily. The real trick was setting the value lists for 1/0 or 2/0 or 4/0 or 8/0 and so on. Thus the checkbox sets the value on the manual entry field. Now I wonder if anyone can understand what I did from what I've written above. Link to comment Share on other sites More sharing options...
Maarten Witberg Posted February 26, 2008 Share Posted February 26, 2008 if anyone can understand what I did from what I've written above. I am not completely in the clear what you did with the calcs and stuff, but in my mind it is similar to playing with truth tables like this. Is it or am I completely misunderstanding. Then if you want to discuss it further, I'd like to see a sample. Link to comment Share on other sites More sharing options...
Recommended Posts