Just curious...if anybody has any good suggestions, I'm all ears 🙂 Simple stuff is just that - simple. But trying to work out the flow for multiple, usually inter-related conditions (and doing it correctly) can sometimes slow me to a crawl. A lot of times I can think of multiple ways to do it, but either A ) I'm not sure which way would be best or B ) *NONE* of them sound like a good solution 😛 So I thought I would post this to see how other, likely more experienced programmers approach such an issue. Maybe I can save some of the newer programmers, like myself, some headaches too.
The reason I bring this up is that I am working on what I though would be a simple 'class attendance'-type form. No such luck...the 'powers that be' have requested both a single 'all attended' checkbox, as well as the ability to set a 'never attended' flag or a 'last date of attendance' for each student. So:
There are a few other checks I can do, like having the 'last date' be valid only if it falls into the correct date range, but hopefully you get the general idea. This one still isn't too bad by any means, but it is what made me think to post this.
Nathan
The reason I bring this up is that I am working on what I though would be a simple 'class attendance'-type form. No such luck...the 'powers that be' have requested both a single 'all attended' checkbox, as well as the ability to set a 'never attended' flag or a 'last date of attendance' for each student. So:
(A) = 'all attended' flag
(B) = 'Never attended flag
(C) = 'Last Date Attended' box
- If (A) is set, (B) and (C) should be blank for all students
- If (A) is NOT set, either (B) -or- (C) must be set for at least 1 student
- (B) and (C) should never both be set
- Attendance records should only be updated if something has changed and the above rules have been followed.
There are a few other checks I can do, like having the 'last date' be valid only if it falls into the correct date range, but hopefully you get the general idea. This one still isn't too bad by any means, but it is what made me think to post this.
Nathan