June 29, 2022
What do the acids (e.g. citric acid, lactic acid, …) that attack the tooth have in common?,

What do the acids (e.g. citric acid, lactic acid, …) that attack the tooth have in common?

Brain of the Week – Science

function createAnswerOption(answers, i) {
var mapping = [‘A’,’B’,’C’,’D’,’E’,’F’,’G’,’H’];
var answerOption = document.createElement(‘a’);
var box = document.createElement(‘span’);
var answerText = document.createElement(‘span’);
jQuery(answerOption).addClass(‘answer-option’).attr(‘href’, ‘#answer-‘ + mapping[i]);
jQuery(box).addClass(‘answer-selection-box’).text(mapping[i]);
jQuery(answerText).addClass(‘answer-text’).text(answers[i]);
jQuery(box).appendTo(answerOption);
jQuery(answerText).appendTo(answerOption);
jQuery(answerOption).appendTo(‘.dental-quiz-container’);
}
function showResult(correctAnswer, option) {
if (!jQuery(option).hasClass(‘selected’)) {
jQuery(option).addClass(‘selected’);
var resultBox = document.createElement(‘p’);
var resultText = (correctAnswer ? ‘YES, you\’re right!’ : ‘Sorry, that\’s the wrong answer’);
var resultClass = (correctAnswer ? ‘correct’ : ‘incorrect’);
jQuery(resultBox).addClass(‘answer-result ‘ + resultClass).text(resultText);
jQuery(resultBox).insertAfter(option);
}
}
jQuery(document).ready(function() {
var answers = [
‘Form chemical complexes with calcium ions’,
‘Form an atomic bond with magnesium ions’,
‘Form crystal structures’,
‘Have a hexagonal crystal structure’,
];
var correctAnswer = ‘A’;
for (i=0; i<answers.length; i++) {
createAnswerOption(answers, i);
}
jQuery(document).on('click', '.answer-option', function(e) {
e.preventDefault()
var selectedAnswer = jQuery(this).attr('href').substr(-1);
if (selectedAnswer == correctAnswer) {
showResult(true, jQuery(this));
} else {
showResult(false, jQuery(this));
}
});
});

.answer-selection-box, .answer-text {
display: inline-block;
}
.answer-selection-box {
background: #000;
color: #fff;
font-weight: bold;
text-align: center;
align-self: center;
flex: 0 0 45px;
}
.answer-text {
background: #00C7DC;
color: #000;
padding: 8px 15px;
flex: 1;
font-weight: bold;
}
.answer-option {
display: flex;
text-decoration: none;
background: #000;
}
.answer-option:hover, .answer-option:focus {
text-decoration: none;
outline: 0;
}
.answer-option + .answer-option {
margin-top: 10px;
}
.answer-result {
border-bottom: 1px solid #00C7DC;
border-right: 1px solid #00C7DC;
border-left: 1px solid #00C7DC;
margin-bottom: 10px;
padding: 8px 15px;
}
.correct {
color: #3bbd5f;
}
.incorrect {
color: red;
}

You May Also Like

Contouring and Polishing Anterior Composite Restorations created with the 3M™ Filtek™ Matrix

Achieving the correct shape is vital to a natural-looking anterior composite restoration. Learn how the 3M™ Filtek™ Matrix, paired with…

Simplicity at your fingertips: A template for smile makeovers

Direct composite restorative procedures can be challenging, particularly when it comes to esthetic cases. Discover how new techniques and tools…

Choose clinical success: 3M™ Scotchbond™ Universal Plus Adhesive

When choosing a new universal adhesive for your office, you have a lot to consider – including clinical history. Take…