This isn't a multi party computation problem. It's a physical security problem. If the exam paper will be published after the fact there's no need for complex multi party computation. Release a signed answer key.
The idea of the test taking organization "changing" their public key after the exam is silly in my opinion. What are they going to do, change all the printed and digital records of that published key? Same thing with the answer key. If they release two different signed answer keys it'll be pretty obvious. If you're concerned they'll do that to one specific person and hire thugs to steal and destroy it, have additional unnafiliated third parties vouch that that answer key is the canonical known answer key. (EG:put it in a blockchain)
- Examinees take their testing booklet home.
This is doing most of the work. If the test must remain secret, participants take their test to the trusted scantron machine and it spits out a score while verifying the test booklet is valid. Note that questions could be re-ordered or have answers re-ordered. If the machine is trusted, it can perform arbitrary checks on the exam paper after the fact. If participants don't trust the hardware they don't have any record of what happened to show that they were cheated. Any cryptographic data they are given can be garbage since they could just print off an "invalid" test paper they created themselves after the fact. There's no way to tell between such a crazy person and one with a legitimate grievance against the exam proctors.
So given that the booklet is going home with the participant, they can just use their phone as trusted hardware to verify the booklet and get their grade.
Cheating is still a problem. Test takers need to be separated from any electronic devices. Do something like a "coat check" but for phones. Then run participants through a NLJD archway, which is like a metal detector but for electronics, to make sure. Alternately you do the traditional thing with proctors walking around trying to catch participants covertly using electronic devices.
So participants:
- coat check all their electronics
- take the test while unable to use electronic devices to cheat
- get back their device and "grade" their own paper using an open source app.
Just before grading, the proctors publish a signed answer key on the internet somewhere that can be used to verify and grade test papers.
The app can return three possible results:
- valid exam paper:grade=%grade%
- invalid exam paper:the proctors are corrupt!
- this isn't an exam paper at all
Participants could smuggle in a printed invalid exam paper and then raise a fuss. To prevent this, exam papers are marked with a secret string. Participants would have to print this on their smuggled in invalid papers during the test. Anti-counterfeiting technology could be integrated here to make things harder if students can somehow smuggle a laser printer into the exam (EG:tamper seal sticker with secret watermark on all test papers).
The proctors could also use disappearing ink to make an apparently legitimate paper become illegitimate by the end of the test. Anti counterfeit stickers with metallic printed text might then be a good idea even if participants can't smuggle in a laser printer.
Participants would check the secret string when they are given their exam booklet and raise a fuss if there's an error. It can be on a poster or something near where the booklets are handed out.
If there's an invalid paper, other participants can double check. Assuming seating and verification order is verifiably randomized your neighbor is unlikely to be a working with the proctors and it will rapidly be apparent to everyone what's happened.
Making sure the validation secret doesn't leak while also preventing proctors from targeting anyone in particular is a hard problem. Maybe have exam papers laid out beforehand in opaque envelopes that participants are not to touch until the test starts, then hang a banner with the validation secret once the test starts. If participant seating order is verifiably publicly randomized during seating, targeting any one person becomes impractical.