import React, { useState } from 'react' import { BrowserRouter as Router,Link, Routes, Route } from "react-router-dom"; export default function Card({name,no,qno}) { let op = JSON.parse(localStorage.getItem('Checked'+`${no}`)); // let ans=0; let kk=0; if (op!=null) { op = [...new Set(op)]; for(let i=0;i'z')&& op[i]!="\\"&& op[i]!='+') || op.length==3 ) {kk++;} } } let ans = op!=null? kk :0; // console.log(op,' 1p ',ans); const fillerStyles = { height: '100%', width: `${Math.round((ans*100)/qno)}%`, backgroundColor: "#22C55E", borderRadius: 'inherit', // textAlign: 'right', // marginLeft:"1%", } const containerStyles = { height: 10, backgroundColor: "#e0e0de", borderRadius: 10, marginTop:5, // marginBottom:50, // marginLeft : 100, // marginRight : 100, } const labelStyles = { padding: 5, color: 'white', fontWeight: 'bold' } return ( {

{name}

Total Questions : {qno}

{ ans==0 ?
Not Yet Started
: Math.round((ans*100)/qno)!=100 ? // {console.log(ans)
STARTED
{Math.round((ans*100)/qno)} %
{/* Completed */}
{/*
*/} {/*
*/} {/* {console.log(ans)} */} {/*
*/}
:
FINISHED
100%
// }
} ) }