End.js 1.38 KB
Newer Older
김민수's avatar
김민수 committed
1
2
import React from 'react'
import tr from './img_end.jpg';
김민수's avatar
김민수 committed
3
import './End.css'
김민수's avatar
김민수 committed
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33


// import { Link } from 'react-router-dom';

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')
        }
    }





    return (
        <>
김민수's avatar
김민수 committed
34
            <div className="card" >
김민수's avatar
김민수 committed
35
36
37
38
39
40
41
42
43
44
45
                <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>
김민수's avatar
김민수 committed
46
                <div className="Box-text-center">
김민수's avatar
김민수 committed
47
48
49
50
51
52
53
54
55
56
57
58
                    <img src={tr} alt="수고" />
       
                </div>
                </div>
            </div>
        </>

    )
}

export default End;