/* English words */
var englishWords = ["Blackmail", "Coat", "Skirt", "Recent", "Whole", "Necessary", "Responsible", "Aunt", "Positive", "Efficient", "Familiar", "Frequent", "Convenient", "Opposite", "Suit", "Pass", "Raise", "Consider", "Rest", "Across", "Order", "Definitely", "Weary", "Data", "Native", "Heritage", "Destination", "Comprise", "Numerous", "Rather"];
/* Russian words */
var russianWords = ["Шантаж", "Пальто", "Юбка", "Недавний", "Целый, весь", "Необходимо", "Ответственный", "Тетя", "Уверенный", "Эффективный", "Знакомые", "Частый", "Удобный", "Противоположный", "Костюм", "Сдавать,передача", "Поднять", "Рассматривать, считать", "Отдыхать", "Через,поперек", "Заказ,состояние", "Определенно", "Усталый", "Данные", "Родной", "Наследие", "Место назначениия", "Включать, охватывать", "Многочисленный", "Скорее"];
/* Cheack Answer */
function checkAnswer() {
var i = 0;
do {
var answer = prompt("Enter the translation of the word: " + englishWords[i], "");
if (answer === russianWords[i]) {
document.write("Right: " + englishWords[i] + " - " + russianWords[i]+ "<br />");
}
else if (answer === null || answer === undefined) {
var cancel = confirm("Do you want to continue your test?");
if (cancel != true) {
alert("Good Bye!");
break;
} else {
i = i - 1;
}
}
else {
document.write("Your answer: " + answer + ". It is not right" + ". Right: " + englishWords[i] + " - " + russianWords[i] + "<br />");
}
i++;
}
while (i<englishWords.length);
};
body {
margin: 0px;
padding: 0px;
background: url(images/fon.jpg) no-repeat;
width: 500px;
height: 600px;
}
/* Buttons */
#mainBlock {
margin-left: 50px;
}
.button {
position: absolute;
float: right;
width: 120px;
height: 30px;
cursor: pointer;
background-color: #F6F686;
border-radius: 6px;
border: none;
}
#startTest {
margin-top: 150px;
}
#addWords {
margin-top: 200px;
}
#editWords {
margin-top: 250px;
}
#resetList {
margin-top: 300px;
}
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<link href="LEW_style.css" rel="stylesheet" type="text/css" />
<script src="LEW_JS.js"></script>
</head>
<body>
<div id="mainBlock">
<input type="button" value="Start test" id="startTest" class="button" onclick="checkAnswer()">
<input type="button" value="Add words" id="addWords" class="button">
<input type="button" value="Edit words" id="editWords" class="button">
<input type="button" value="Reset List" id="resetList" class="button">
</div>
</body>
</html>