End.js 1.19 KB
Newer Older
Jiwon Yoon's avatar
Jiwon Yoon committed
1
2
3
4
import React from 'react'
// import { Link } from 'react-router-dom';

function End() {
Jiwon Yoon's avatar
home    
Jiwon Yoon committed
5
6
    let k = []
    for (let i = 0; i < 3; i++) {
7
        if (localStorage.getItem((i+1) + '번문제답') === localStorage.getItem((i+1) + '번문제정답')) {
Jiwon Yoon's avatar
home    
Jiwon Yoon committed
8
9
10
11
12
13
14
15
            alert('정답입니다.')
            k[i] = ['O', 1]
        }
        else {
            alert('오답입니다.')
            k[i] = ['X', 0]
        }
    }
Jiwon Yoon's avatar
Jiwon Yoon committed
16
    return (
Jiwon Yoon's avatar
home    
Jiwon Yoon committed
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
        <>
            <div className="card " >
                <div className='card-header'>
                    -채점표-
            </div>
                <div className='card-body'>
                    <h3 className='card-title'>이름 : {localStorage.getItem('name')}</h3>
                    <p className='card-text'>Quiz 1 : {k[0][0]}</p>
                    <p className='card-text'>Quiz 2 : {k[1][0]}</p>
                    <p className='card-text'>Quiz 3 : {k[2][0]}</p>
                    <p className='card-text'>Total Score : {k[0][1] + k[1][1] + k[2][1]}</p>
                </div>
                <div className="Box text-center">
                    <h1>수고하셨습니다.</h1>
                </div>
            </div>
        </>
Jiwon Yoon's avatar
Jiwon Yoon committed
34
35
36
37

    )
}

Jiwon Yoon's avatar
home    
Jiwon Yoon committed
38
export default End;