End.js 1.41 KB
Newer Older
Jiwon Yoon's avatar
a    
Jiwon Yoon committed
1
2
3
4
5
import React, { createContext } from 'react'
import './End.css'
import tr from './img/img_end.jpg';


Jiwon Yoon's avatar
Jiwon Yoon committed
6
7
8
// import { Link } from 'react-router-dom';

function End() {
baesangjune's avatar
0805    
baesangjune committed
9
    let a = []
Jiwon Yoon's avatar
home    
Jiwon Yoon committed
10
    for (let i = 0; i < 3; i++) {
11
12
13
        if (localStorage.getItem('' + (i + 1)) === localStorage.getItem('정답' + (i + 1))) {
            a[i] = 1
            localStorage.setItem('채점' + (i + 1), 'O')
Jiwon Yoon's avatar
home    
Jiwon Yoon committed
14
15
        }
        else {
16
17
            a[i] = 0
            localStorage.setItem('채점' + (i + 1), 'X')
Jiwon Yoon's avatar
home    
Jiwon Yoon committed
18
19
        }
    }
Jiwon Yoon's avatar
a    
Jiwon Yoon committed
20

Jiwon Yoon's avatar
Jiwon Yoon committed
21
    return (
Jiwon Yoon's avatar
home    
Jiwon Yoon committed
22
        <>
Jiwon Yoon's avatar
a    
Jiwon Yoon committed
23
            <div className="card" >
Jiwon Yoon's avatar
home    
Jiwon Yoon committed
24
                <div className='card-header'>
25
                    -채점표-
Jiwon Yoon's avatar
home    
Jiwon Yoon committed
26
                <div className='card-body'>
27
                        <h3 className='card-title'>이름 : {localStorage.getItem('name')}</h3>
baesangjune's avatar
.    
baesangjune committed
28

29
30
31
32
33
34
35
36
37
38

                        <p className='card-text'>Quiz 1 : {localStorage.getItem('채점1')}</p>
                        <p className='card-text'>Quiz 2 : {localStorage.getItem('채점2')}</p>
                        <p className='card-text'>Quiz 3 : {localStorage.getItem('채점3')}</p>
                        <p className='card-text'>Total Score : {a[0] + a[1] + a[2]}</p>
                    </div>
                    <div style={{ marginTop: '100px' }} className="Box text-center">
                        <img src={tr} alt="수고" />

                    </div>
Jiwon Yoon's avatar
home    
Jiwon Yoon committed
39
40
41
                </div>
            </div>
        </>
Jiwon Yoon's avatar
Jiwon Yoon committed
42
43
44
45

    )
}

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