End.js 1.43 KB
Newer Older
baesangjune's avatar
0805    
baesangjune committed
1
import React from 'react'
baesangjune's avatar
.    
baesangjune committed
2
import tr from './img_end.jpg';
baesangjune's avatar
.    
baesangjune committed
3

Jiwon Yoon's avatar
Jiwon Yoon committed
4

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

function End() {
baesangjune's avatar
0805    
baesangjune committed
8
    let a = []
baesangjune's avatar
.    
baesangjune committed
9
10
    for (let i = 0; i < 3; i++) {

baesangjune's avatar
0805    
baesangjune committed
11
        if (localStorage.getItem(''+(i+1)) === localStorage.getItem('정답'+(i+1))) {
baesangjune's avatar
0    
baesangjune committed
12

baesangjune's avatar
0805    
baesangjune committed
13
14
15
16
            a[i] =1
            

            localStorage.setItem('채점'+(i+1),'O')
baesangjune's avatar
.    
baesangjune committed
17
18
19

        }
        else {
baesangjune's avatar
0805    
baesangjune committed
20
21

            a[i] =0
baesangjune's avatar
.    
baesangjune committed
22
            
baesangjune's avatar
0805    
baesangjune committed
23
            localStorage.setItem('채점'+(i+1),'X')
baesangjune's avatar
.    
baesangjune committed
24
25
26
27
28
29
30
        }
    }





Jiwon Yoon's avatar
Jiwon Yoon committed
31
    return (
baesangjune's avatar
.    
baesangjune committed
32
        <>
baesangjune's avatar
0    
baesangjune committed
33
            <div className="card" style={{fontSize:'30px', textAlign:"center"}} >
baesangjune's avatar
.    
baesangjune committed
34
                <div className='card-header'>
baesangjune's avatar
0    
baesangjune committed
35
                    -채점표-            
baesangjune's avatar
.    
baesangjune committed
36
37
                <div className='card-body'>
                    <h3 className='card-title'>이름 : {localStorage.getItem('name')}</h3>
baesangjune's avatar
0805    
baesangjune committed
38
                    
baesangjune's avatar
.    
baesangjune committed
39

baesangjune's avatar
0805    
baesangjune committed
40
41
42
43
                    <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>
baesangjune's avatar
.    
baesangjune committed
44
                </div>
baesangjune's avatar
0    
baesangjune committed
45
46
47
48
                <div style={{marginTop:'100px'}}className="Box text-center">
                    <img src={tr} alt="수고" />
       
                </div>
baesangjune's avatar
.    
baesangjune committed
49
                </div>
baesangjune's avatar
.    
baesangjune committed
50
51
52
            </div>
        </>

Jiwon Yoon's avatar
Jiwon Yoon committed
53
54
55
    )
}

baesangjune's avatar
.    
baesangjune committed
56
57
export default End;