In theory you could use a cryptographically secure one - way hashing algorithm to guarantee anonymity here, but that still leaves the door open to tampering - e.g. by
hacking voting devices so it confirms you've voted on X while actually casting a vote on Y.