let questions = document.querySelectorAll('.singleQuestion');
let formattedQuestions = [];
for(let question of questions) {
// Question number and prompt
let formattedQuestion = ``;
let questionNumber = question.querySelector('.titleCell');
let prompt = question.querySelector('.contentHolder .step .addblank');
let answers = question.querySelectorAll('.contentHolder .mcControl .mcAnswerOverflow');
let isEssay = question.querySelector('.essay') ? true : false;
if(isEssay) {
formattedQuestion += `Type: E \n`;
}
formattedQuestion += `${questionNumber.innerText} ${prompt.innerText}\n`;
// Question answers
for(let answer of answers) {
let isCorrectAnswer = answer.querySelector('.dijitRadioChecked') ? true : false;
if(isCorrectAnswer) {
formattedQuestion += `*${answer.innerText.replace('\n', ' ')}\n`;
} else {
formattedQuestion += `${answer.innerText.replace('\n', ' ')}\n`;
}
}
// Log questions to console
formattedQuestions.push(formattedQuestion);
console.log(formattedQuestion);
}