Use this formula as the default value for your AllOk field:
substring("FAILEDOK", not(/my:myFields/my:MachineList/my:Machine[my:MachineOk != 1]) * 6 + 1, 6)
You might need to change the path if it doesn't quite match what's in your data source.
What this does is evaluate to a different part of the string "FAILEDOK" depending on whether there is a MachineOk checkbox that is unchecked. If there is one, then not(/my:myFields/my:MachineList/my:Machine[my:MachineOk != 1]) will evaluate to false (0), and what you will have is:
substring("FAILEDOK", 0 * 6 + 1, 6) -> substring("FAILEDOK", 1, 6) -> FAILED
If all of the MachineOk boxes are checked, then not(/my:myFields/my:MachineList/my:Machine[my:MachineOk != 1]) will evaluate to true (1) and you will have
substring("FAILEDOK", 1 * 6 + 1, 6) -> substring("FAILEDOK", 7, 6) -> OK