Skip to content

Instantly share code, notes, and snippets.

@konhi
Last active October 22, 2021 15:41
Show Gist options
  • Save konhi/875c8c21abb2c68c24e8032c30ce4b9f to your computer and use it in GitHub Desktop.
Save konhi/875c8c21abb2c68c24e8032c30ce4b9f to your computer and use it in GitHub Desktop.
Microsoft Teams Forms private anonymous hide personal info and answers
// Press Ctrl + Shift + I and copy paste it into console
const container = document.querySelector('.office-form-question-body');
const points = document.querySelectorAll('.office-form-theme-quiz-point');
const bullets = document.querySelectorAll('.office-form-question-choice-text-row input');
const checkmarks = document.querySelectorAll('.ms-Icon--CheckMark');
const questionNumbers = document.querySelectorAll('.office-form-question-ordinal');
const errors = document.querySelectorAll('.office-form-error-question');
// uncheck every bullet point
for (const bullet of bullets) {
bullet.checked = false;
}
// remove question numbers
for (const number of questionNumbers) {
number.remove();
}
// remove points
for (const point of points) {
point.remove();
}
// remove checkmarks
for (const checkmark of checkmarks) {
checkmark.remove();
}
// remove errors
for (const error of errors) {
error.classList.remove('office-form-error-question');
}
// shuffle questions
for (var i = container.children.length; i >= 0; i--) {
container.appendChild(container.children[Math.random() * i | 0]);
}
document.querySelectorAll('.validation-error-circle-small').forEach(circle => circle.remove())
document.querySelectorAll('.validation-error-message-wrong-Icon').forEach(x => x.remove())
document.querySelectorAll('.office-form-textfield').forEach(input => input.remove())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment