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


6
// import { Link } from 'react-router-dom';
JeongYeonwoo's avatar
updated    
JeongYeonwoo committed
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

function End() {
    let a = []
    for (let i = 0; i < 3; i++) {

        if (localStorage.getItem(''+(i+1)) === localStorage.getItem('정답'+(i+1))) {

            a[i] =1
            

            localStorage.setItem('채점'+(i+1),'O')

        }
        else {

            a[i] =0
            
            localStorage.setItem('채점'+(i+1),'X')
        }
    }



30
31
32
33


    return (
        <>
JeongYeonwoo's avatar
updated    
JeongYeonwoo committed
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
            <div className="card" style={{fontSize:'30px', textAlign:"center"}} >
                <div className='card-header'>
                    -채점표-            
                <div className='card-body'>
                    <h3 className='card-title'>이름 : {localStorage.getItem('name')}</h3>
                    

                    <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>
                </div>
51
52
            </div>
        </>
JeongYeonwoo's avatar
updated    
JeongYeonwoo committed
53

54
55
56
    )
}

JeongYeonwoo's avatar
updated    
JeongYeonwoo committed
57
58
export default End;