Hi Skellie
This is entirely doable in Aware.
I can do a demo for you but am a bit tied up at the moment. However, have a crack yourself first...... Here is my thinking.
BO: HighRiskSport
SportCode Text 5
SportName Text 40
Questions SportQuestion Multiple Allowed OwnedBy (HighRiskSport) Call matching Attribute in SportQuestion ... Sport
BO: SportQuestion
QuestionNumber Number (allow admin to change order)
Question Text 200
Sport HighRiskSport (will be created automatically when you create Questions in HighRiskSport)
Now in your Person BO or RegularUser BO
BO Person (Or RegularUser)
Name
Address
Blah, blah blah
Sports data type = HighRiskSports or type Peer and Multiple Allowed
SportAnswers PersonSportAnswers Multiple Allowed, OwnedBy Person. Matching Attribute is Person.
You can now set this Attribute on the Person for to be a Swap Select.
You do not need a Yes,No attribute to say if the person engages in High Risk Sports. That will be always true if the person selects any of the Sports - as we only have High Risk Sports.
Ok.... That is the first part.....
The complicated part comes from deciding how to deal with the questions for each sport if the user has selected it.
I would create a new BO called PersonSportAnswers.....something like....
Question SportQuestion
sc_Question ShortCut SportQuestion.Question
sc_SportCode ShortCut SportQuestion.Sport.SportCode
Answer text 200
Person Person
So..... what happens is that when the person selects their sports..... you call a process that creates a PersonSportAnswer for each SportQuestion or each HighRiskSport that the person has selected.
BO parameter for the Process is Person
FIND SportQuestion WHERE (SportQuestion.Sport IN Person.Sports)
CREATE PersonSportAnswers WITH PersonSportAnswers.Person=Person, PersonSportAnswers.Question=SportQuestion
Things to consider here are...
- First time they select... no problem... just create
FIND SportQuestion WHERE (SportQuestion.Sport IN Person.Sports)
CREATE PersonSportAnswers WITH PersonSportAnswers.Person=Person, PersonSportAnswers.Question=SportQuestion
- If modified later.... you need to delete the PersonSportAnswers for the persons HighRiskSports that are no longer selected AND
you need to create PersonSportAnswers for HighRiskSport that are now selected but were not selected before.
FIND PersonSportAnswers WHERE NOT(PersonSportAnswers.Sport IN Person.Sports)
DELETE PersonSportAnswers
FIND SportQuestion WHERE (SportQuestion.Sport IN Person.Sports AND NOT (SportQuestion IN PersonSportAnswers)
CREATE PersonSportAnswers WITH PersonSportAnswers.Person=Person, PersonSportAnswers.Question=SportQuestion
Then you need to work out how you want to progress through the answering of each question. Maybe a Navigation structure to the form or selecting each sport one at a time and then progressing through the answers for that Sport.
There are a range of ways to tackle this and really this is just some broad thinking off the top of my head. I am sure if I coded it up then it would most likely change but it could be a start for you. Generally, once you start then the thinking will become clearer as you see the results and what does and does not suit.
Clear as mud eh? 😉