Ask the account holder the studio's questions when they are a student too
CI / Tests (PHP 8.2) (pull_request) Successful in 43s
CI / Tests (PHP 8.1) (pull_request) Successful in 52s
CI / No Debug Code (pull_request) Successful in 2s
CI / PHPStan (pull_request) Successful in 2m50s
CI / Coding Standards (pull_request) Successful in 3m19s
CI / Tests (PHP 8.3) (pull_request) Successful in 2m47s
CI / Build Plugin Zip (pull_request) Skipped
CI / Tests (PHP 8.2) (pull_request) Successful in 43s
CI / Tests (PHP 8.1) (pull_request) Successful in 52s
CI / No Debug Code (pull_request) Successful in 2s
CI / PHPStan (pull_request) Successful in 2m50s
CI / Coding Standards (pull_request) Successful in 3m19s
CI / Tests (PHP 8.3) (pull_request) Successful in 2m47s
CI / Build Plugin Zip (pull_request) Skipped
Under "both" the questions were collected per student only, so someone registering themselves alongside their children was never asked their own instrument, level or anything else — despite being able to book lessons. The account-scope questions describe a student, and under "both" the account holder is one. Their answers are recorded against their own user id, not shared with a child's, and recorded after the children so a rollback that deletes the account cannot leave answers pointing at a user that no longer exists. A pure guardian is unchanged: they are not a student, so anything posted for them is still ignored. Validation became two passes rather than one so the message can say whose answers are missing — with one pass, "both" had to blame "each student" for the account holder's own blank field. In the form, the two questions turn out to be independent: whether student blocks are in play, and whether the account holder answers for themselves. "Both" is the case that needs its own answer to each, so sync() now tracks them separately, and step two comes back into play under "both". Verified in a headless browser: 21 checks across all three choices, now including that "both" enables the account holder's own question panel and offers Next rather than the early submit. Closes #146 Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
@@ -144,11 +144,22 @@ A **"Who are you registering?"** choice on the existing `[us_student_register]`
|
||||
form (all three signup paths — personal invite, group link, self-approval), as
|
||||
three radios:
|
||||
|
||||
| Choice | `us_registering_for` | Student blocks | Account holder is a student |
|
||||
|---|---|---|---|
|
||||
| Just myself | `self` | no | yes |
|
||||
| On behalf of one or more students | `students` | yes | **no** |
|
||||
| Both — myself and one or more students | `both` | yes | yes |
|
||||
| Choice | `us_registering_for` | Student blocks | Account holder is a student | Answers the studio's questions |
|
||||
|---|---|---|---|---|
|
||||
| Just myself | `self` | no | yes | for themselves |
|
||||
| On behalf of one or more students | `students` | yes | **no** | per student only |
|
||||
| Both — myself and one or more students | `both` | yes | yes | **per student *and* for themselves** |
|
||||
|
||||
The last column follows from the third, and is the whole of it: the
|
||||
account-scope questions describe a *student* — instrument, level, school — so
|
||||
they are asked of everyone being registered as one. Under `both` that is each
|
||||
student **and** the account holder, whose answers are stored against their own
|
||||
user id, not shared with anyone. Under `students` the account holder is not a
|
||||
student, so anything posted for them is ignored outright.
|
||||
|
||||
Required answers are checked in two passes rather than one, so the error can say
|
||||
whose are missing: `both` would otherwise have to blame "each student" for the
|
||||
account holder's own blank field.
|
||||
|
||||
Radios rather than checkboxes because the three answers are mutually exclusive:
|
||||
"both" only means anything as a third choice alongside the other two. Either
|
||||
|
||||
Reference in New Issue
Block a user