let score = 0;

function showScore(){
  const totalScore = document.getElementById('score-message');
 if(score == 3) {
    totalScore.innerHTML = score + "点：満点！"
  } else if(score == 2) {
    totalScore.innerHTML = score + "点：もう少し";
  } else if(score == 1) {
      totalScore.innerHTML = score + "点：いいんじゃない";
  } else {
    totalScore.innerHTML = score + "点：無念";
  }   
}

const seikai = '正解';
const matigai = '不正解';



function answerQuiz1() {    
const q1 = document.getElementById('q1');
  const select = '1問目：' + q1.answer.value + 'を選択しました';
    if (q1.answer.value == 'a') {
	score++;
    console.log(select);
    console.log(matigai);
    // 正解はA
} else if (q1.answer.value == 'b') {
	 console.log(select);
	 console.log(seikai);
	 } else if (q1.answer.value == 'c') {
    console.log(select);
    console.log(matigai);
	 } else {
	 }
    console.log('今の点数は?:' + score);
}


function answerQuiz2() {    
const q2 = document.getElementById('q2');
  const select = '2問目：' + q2.answer.value + 'を選択しました';
    if (q2.answer.value == 'a') {
	score++;
    console.log(select);
    console.log(matigai);
} else if (q2.answer.value == 'b') {
	 console.log(select);
	 console.log(seikai);
	 } else if (q2.answer.value == 'c') {
    console.log(select);
    console.log(incorrect);
	 } else {
	 }
    console.log('今の点数は?:' + score);
}

function answerQuiz3() {    
const q3 = document.getElementById('q3');
  const select = '3問目：' + q3.answer.value + 'を選択しました';
    if (q3.answer.value == 'a') {
	score++;
    console.log(select);
    console.log(matigai);
    } else if (q3.answer.value == 'b') {
	 console.log(select);
	 console.log(seikai);
	 } else if (q3.answer.value == 'c') {
    console.log(select);
    console.log(matigai);
	 } else {
	 }
    console.log('今の点数は?:' + score);
}
