added verify button for part-c
This commit is contained in:
parent
caf3eca000
commit
9e010d7f49
2
.env
2
.env
|
|
@ -2,5 +2,5 @@
|
|||
METABASE_BASE_URL="http://metabase.usln.in/public/question/d8774923-09bb-4cd9-903b-559d417e12cf"
|
||||
|
||||
VITE_REACT_APP_BACKEND_URL="http://localhost:9999"
|
||||
#VITE_REACT_APP_BACKEND_URL="https://api.dev.exampaper.usln.in"
|
||||
# VITE_REACT_APP_BACKEND_URL="https://api.dev.exampaper.usln.in"
|
||||
#VITE_REACT_APP_BACKEND_URL="https://api.exampaper.usln.in"
|
||||
|
|
|
|||
14
src/App.css
14
src/App.css
|
|
@ -53,6 +53,7 @@
|
|||
/* Notification Styles */
|
||||
.notification {
|
||||
position: fixed;
|
||||
font-size: 19px;
|
||||
top: 20px;
|
||||
right: 20px;
|
||||
padding: 15px;
|
||||
|
|
@ -242,3 +243,16 @@ button{
|
|||
background: blue;
|
||||
color: white;
|
||||
}
|
||||
|
||||
|
||||
@font-face {
|
||||
font-family: 'Bamini';
|
||||
src: url('./assets/fonts/Bamini_0.TTF') format('truetype');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
/* Apply the font */
|
||||
.font-bamini {
|
||||
font-family: 'Bamini', sans-serif;
|
||||
}
|
||||
68
src/App.jsx
68
src/App.jsx
|
|
@ -39,6 +39,8 @@ import DataInsertion from "./Components/DataInsertion";
|
|||
import DataInsertionCsvViewer from "./Components/DataInsertionCsvViewer";
|
||||
import Login from "./Components/Login";
|
||||
import HomeSections from "./Components/HomeSections";
|
||||
import CertificateTextVerification from "./Components/CertificateTextVerification";
|
||||
import AttendenceNotShadedCorrection from "./Components/AttendenceNotShadedCorrection";
|
||||
|
||||
function App() {
|
||||
return (
|
||||
|
|
@ -46,9 +48,15 @@ function App() {
|
|||
<BrowserRouter>
|
||||
<Routes>
|
||||
<Route path="/" element={<Home />}></Route>
|
||||
<Route path="/sections/:year/sqlPlayground" element={<QueryExecutor />}></Route>
|
||||
<Route path="/sections/:year/data/insertion" element={<DataInsertion />}></Route>
|
||||
<Route path="/sections/:year" element={<HomeSections/>}></Route>
|
||||
<Route
|
||||
path="/sections/:year/sqlPlayground"
|
||||
element={<QueryExecutor />}
|
||||
></Route>
|
||||
<Route
|
||||
path="/sections/:year/data/insertion"
|
||||
element={<DataInsertion />}
|
||||
></Route>
|
||||
<Route path="/sections/:year" element={<HomeSections />}></Route>
|
||||
<Route
|
||||
path="/sections/:year/data/insertion/validation"
|
||||
element={<DataInsertionCsvViewer />}
|
||||
|
|
@ -65,14 +73,26 @@ function App() {
|
|||
path="/sections/:year/sqlPlayground/edit"
|
||||
element={<QueryCardEditor />}
|
||||
></Route>
|
||||
<Route path="/sections/:year/evQrcode/edit" element={<QrcodeCardEditor />}></Route>
|
||||
<Route
|
||||
path="/sections/:year/evQrcode/edit"
|
||||
element={<QrcodeCardEditor />}
|
||||
></Route>
|
||||
<Route
|
||||
path="/sections/:year/studentsDetails"
|
||||
element={<StudentResultsData />}
|
||||
></Route>
|
||||
<Route path="/sections/:year/Playgrounds" element={<PlayGrounds />}></Route>
|
||||
<Route path="/sections/:year/Playground/:type" element={<PlayGround />}></Route>
|
||||
<Route path="/sections/:year/revaluation" element={<Revaluation />}></Route>
|
||||
<Route
|
||||
path="/sections/:year/Playgrounds"
|
||||
element={<PlayGrounds />}
|
||||
></Route>
|
||||
<Route
|
||||
path="/sections/:year/Playground/:type"
|
||||
element={<PlayGround />}
|
||||
></Route>
|
||||
<Route
|
||||
path="/sections/:year/revaluation"
|
||||
element={<Revaluation />}
|
||||
></Route>
|
||||
<Route
|
||||
path="/sections/:year/playground/updated/:type"
|
||||
element={<PlayGroundUpdated />}
|
||||
|
|
@ -101,7 +121,10 @@ function App() {
|
|||
path="/sections/:year/anomoly/attendence/additionalSheet"
|
||||
element={<AttendanceAdditionalSheet />}
|
||||
></Route>
|
||||
<Route path="/sections/:year/barcodeScanner" element={<BarcodeScanner />}></Route>
|
||||
<Route
|
||||
path="/sections/:year/barcodeScanner"
|
||||
element={<BarcodeScanner />}
|
||||
></Route>
|
||||
<Route
|
||||
path="/sections/:year/anomoly/reassigned/booklet"
|
||||
element={<AttendenceCorrection />}
|
||||
|
|
@ -114,11 +137,18 @@ function App() {
|
|||
path="/sections/:year/anomoly/attendence"
|
||||
element={<AnomolyAttendencePage />}
|
||||
></Route>
|
||||
<Route path="/sections/:year/qrcodeFinder" element={<QrcodeFinder />}></Route>
|
||||
<Route
|
||||
path="/sections/:year/qrcodeFinder"
|
||||
element={<QrcodeFinder />}
|
||||
></Route>
|
||||
<Route
|
||||
path="/sections/:year/anomoly/attendence/additionalRecord"
|
||||
element={<AttendenceAdditionalRecord />}
|
||||
/>
|
||||
<Route
|
||||
path="/sections/:year/AttendenceNotShadedCorrection"
|
||||
element={<AttendenceNotShadedCorrection />}
|
||||
/>
|
||||
<Route
|
||||
path="/sections/:year/anomoly/attendence/additionalRecord/correction"
|
||||
element={<AttendenceAdditionalRecordCorrection />}
|
||||
|
|
@ -127,18 +157,32 @@ function App() {
|
|||
path="/sections/:year/anomoly/reassigned/stats/:exam_centre_code"
|
||||
element={<IndividualExamCentreStats />}
|
||||
></Route>
|
||||
<Route path="/sections/:year/anomoly/PartA" element={<PartAReassigned />}></Route>
|
||||
<Route
|
||||
path="/sections/:year/anomoly/PartA"
|
||||
element={<PartAReassigned />}
|
||||
></Route>
|
||||
<Route
|
||||
path="/sections/:year/CertificateTextVerification"
|
||||
element={<CertificateTextVerification />}
|
||||
></Route>
|
||||
|
||||
{/* <Route
|
||||
path="/verification"
|
||||
element={<Verification/>}
|
||||
>
|
||||
</Route> */}
|
||||
<Route path="/sections/:year/statistics" element={<Statistics />}></Route>
|
||||
<Route
|
||||
path="/sections/:year/statistics"
|
||||
element={<Statistics />}
|
||||
></Route>
|
||||
<Route
|
||||
path="/sections/:year/anomoly/partA/booklet"
|
||||
element={<PartACorrection />}
|
||||
></Route>
|
||||
<Route path="/sections/:year/anomoly/partC" element={<AnomolyPartC />}></Route>
|
||||
<Route
|
||||
path="/sections/:year/anomoly/partC"
|
||||
element={<AnomolyPartC />}
|
||||
></Route>
|
||||
<Route path="/sections/:year/evQrcode" element={<EvQrcode />}></Route>
|
||||
</Routes>
|
||||
</BrowserRouter>
|
||||
|
|
|
|||
|
|
@ -26,10 +26,13 @@ import FormControl from "@mui/material/FormControl";
|
|||
import Select from "@mui/material/Select";
|
||||
import { useSearchParams } from "react-router-dom";
|
||||
import { updatePartCDegreeType } from "../redux/actions/actions";
|
||||
import { useParams } from "react-router-dom";
|
||||
|
||||
const { Content, Header } = Layout;
|
||||
|
||||
function AnomalyPartC() {
|
||||
const { year } = useParams()
|
||||
|
||||
const [searchParams, setSearchParams] = useSearchParams();
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [isLoading2, setIsLoading2] = useState(false);
|
||||
|
|
@ -41,7 +44,7 @@ function AnomalyPartC() {
|
|||
const [totalPages, setTotalPages] = useState(1);
|
||||
const [showSystemNoContainer, setShowSystemNoContainer] = useState(false);
|
||||
const [selectedIndex, setSelectedIndex] = useState(null);
|
||||
const [selectedDegreeType, setSelectedDegreeType] = useState(null);
|
||||
const [selectedDegreeType, setSelectedDegreeType] = useState("0");
|
||||
const [dataFetched, setDataFetched] = useState([]);
|
||||
const [counter, setCounter] = useState(0);
|
||||
const degreeTypes = [
|
||||
|
|
@ -56,7 +59,7 @@ function AnomalyPartC() {
|
|||
if (reduxDegreeType) {
|
||||
setSelectedDegreeType(reduxDegreeType);
|
||||
} else {
|
||||
setSelectedDegreeType("2");
|
||||
setSelectedDegreeType("0");
|
||||
}
|
||||
}, [reduxDegreeType]);
|
||||
|
||||
|
|
@ -140,6 +143,7 @@ function AnomalyPartC() {
|
|||
const payload = {
|
||||
systemRecords,
|
||||
sysNo: reduxSystemNo,
|
||||
year,
|
||||
};
|
||||
try {
|
||||
fetch(
|
||||
|
|
@ -170,7 +174,7 @@ function AnomalyPartC() {
|
|||
const response = await fetch(
|
||||
`${
|
||||
import.meta.env.VITE_REACT_APP_BACKEND_URL
|
||||
}/getpartcEv?degreeType=${selectedDegreeType}`,
|
||||
}/getpartcEv?degreeType=${selectedDegreeType}&year=${year}`,
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
|
|
@ -203,6 +207,7 @@ function AnomalyPartC() {
|
|||
error_reason: errorReason,
|
||||
sysno: reduxSystemNo,
|
||||
degreeType: selectedDegreeType,
|
||||
year: year
|
||||
}),
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
|
@ -368,7 +373,12 @@ function AnomalyPartC() {
|
|||
<CardContent>
|
||||
{item.error && (
|
||||
<Typography id="1" variant="body2">
|
||||
Code: {item.error}
|
||||
Error Code: {item.error}
|
||||
</Typography>
|
||||
)}
|
||||
{item.error_reason && (
|
||||
<Typography id="1" variant="body2">
|
||||
Error Reason: {item.error_reason}
|
||||
</Typography>
|
||||
)}
|
||||
{item["count(*)"] && (
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
const AttendenceNotShadedCorrection = () =>{
|
||||
return(
|
||||
<div>Hl</div>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
export default AttendenceNotShadedCorrection
|
||||
|
|
@ -0,0 +1,242 @@
|
|||
import AntdesignLayout from "./AntdesignLayout";
|
||||
import { Box, Button } from "@mui/material";
|
||||
import { useState, useEffect, useRef } from "react";
|
||||
import { useParams } from "react-router-dom";
|
||||
import { Bamini_base64 } from "../assets/fonts/Bamini";
|
||||
|
||||
const CertificateTextVerification = () => {
|
||||
const [certificateData, setCertificateData] = useState([]);
|
||||
const [registerNumber, setRegisterNumber] = useState(null)
|
||||
const { year } = useParams();
|
||||
const certificateDataRef = useRef(null);
|
||||
|
||||
const [currentPage, setCurrentPage] = useState(1); // Track current page
|
||||
const itemsPerPage = 30; // Number of items per page
|
||||
|
||||
// Fetch certificate data
|
||||
const fetchCertificateTextVerificationData = async () => {
|
||||
try {
|
||||
const payload = {
|
||||
year,
|
||||
registerNumber
|
||||
};
|
||||
const certificateDataResponse = await fetch(
|
||||
`${
|
||||
import.meta.env.VITE_REACT_APP_BACKEND_URL
|
||||
}/fetchCertificateTextVerification`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(payload),
|
||||
}
|
||||
);
|
||||
const responseData = await certificateDataResponse.json();
|
||||
console.log("response data certificateDataResponse ==== ", responseData);
|
||||
if (responseData?.status === "success") {
|
||||
console.log("response status success ...");
|
||||
setCertificateData(responseData?.data);
|
||||
}
|
||||
} catch (error) {
|
||||
throw new Error(error);
|
||||
}
|
||||
};
|
||||
|
||||
// Download HTML function
|
||||
const downloadHTML = () => {
|
||||
const content = certificateDataRef.current.outerHTML;
|
||||
|
||||
// Base64 encoded font data (replace with your actual base64 string)
|
||||
const base64Font = Bamini_base64; // Replace with the actual base64 string or import it
|
||||
|
||||
// Create the HTML template that includes the embedded font and table styles
|
||||
const htmlContent = `
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: 'Bamini';
|
||||
src: url('data:font/ttf;base64,${base64Font}');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
margin: 20px;
|
||||
}
|
||||
.font-bamini {
|
||||
font-family: 'Bamini', sans-serif;
|
||||
}
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-top: 20px;
|
||||
}
|
||||
table, th, td {
|
||||
border: 1px solid black;
|
||||
}
|
||||
th, td {
|
||||
padding: 8px 12px;
|
||||
text-align: left;
|
||||
}
|
||||
th {
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
${content}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
`;
|
||||
|
||||
// Create a Blob object with the HTML content
|
||||
const blob = new Blob([htmlContent], { type: "text/html" });
|
||||
|
||||
// Create a download link
|
||||
const link = document.createElement("a");
|
||||
link.href = URL.createObjectURL(blob);
|
||||
link.download = "certificate_data.html"; // The name of the downloaded file
|
||||
|
||||
// Trigger the download
|
||||
link.click();
|
||||
};
|
||||
|
||||
// Handle pagination
|
||||
const totalItems = certificateData.length;
|
||||
const totalPages = Math.ceil(totalItems / itemsPerPage);
|
||||
const indexOfLastItem = currentPage * itemsPerPage;
|
||||
const indexOfFirstItem = indexOfLastItem - itemsPerPage;
|
||||
const currentData = certificateData.slice(indexOfFirstItem, indexOfLastItem);
|
||||
|
||||
const paginate = (pageNumber) => setCurrentPage(pageNumber);
|
||||
|
||||
useEffect(() => {
|
||||
fetchCertificateTextVerificationData();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<AntdesignLayout>
|
||||
<Box>
|
||||
<h5>Certificate Tamil Text Verification</h5>
|
||||
</Box>
|
||||
<Box className="d-flex justify-content-center gap-3 align-items-center py-3">
|
||||
<input
|
||||
type="text"
|
||||
style={{ width: "600px" }}
|
||||
className="form-control p-3"
|
||||
id="registerNumberFormControlInput1"
|
||||
placeholder="Ex: 20212231103112"
|
||||
value={registerNumber}
|
||||
onChange={(e)=>{
|
||||
setRegisterNumber(e.target.value)
|
||||
}}
|
||||
/>
|
||||
<button type="button" className="btn btn-primary btn-sm px-4 h-75">
|
||||
Submit
|
||||
</button>
|
||||
</Box>
|
||||
|
||||
{certificateData.length > 0 && (
|
||||
<>
|
||||
<Box className="w-75 mx-auto" id="certificateDataList">
|
||||
<table className="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th className="h4">Register Number</th>
|
||||
<th className="h4">Tamil Name</th>
|
||||
<th className="h4">Tamil Degree</th>
|
||||
<th className="h4">Tamil Class</th>
|
||||
<th className="h4">Tamil Month Year</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{currentData.map((data, index) => (
|
||||
<tr key={index}>
|
||||
<td className="h5">{data?.register_number}</td>
|
||||
<td className="font-bamini h5">{data?.tamil_name}</td>
|
||||
<td className="font-bamini h5">{data?.tamil_degree}</td>
|
||||
<td className="font-bamini h5">{data?.tamil_class_name}</td>
|
||||
<td className="font-bamini h5">{data?.tamil_month_year}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
<Box className="w-100 d-flex justify-content-center py-2">
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary btn-sm px-4 h-75"
|
||||
onClick={downloadHTML}
|
||||
>
|
||||
Download Data
|
||||
</button>
|
||||
</Box>
|
||||
{/* Pagination Controls (Will not be included in download) */}
|
||||
<div className="d-flex justify-content-center mt-3">
|
||||
<button
|
||||
onClick={() => paginate(currentPage - 1)}
|
||||
disabled={currentPage === 1}
|
||||
className="btn btn-outline-secondary mx-2"
|
||||
>
|
||||
Previous
|
||||
</button>
|
||||
|
||||
{[...Array(totalPages)].map((_, index) => (
|
||||
<button
|
||||
key={index}
|
||||
onClick={() => paginate(index + 1)}
|
||||
className={`btn btn-outline-secondary mx-2 ${
|
||||
currentPage === index + 1 ? "active" : ""
|
||||
}`}
|
||||
>
|
||||
{index + 1}
|
||||
</button>
|
||||
))}
|
||||
|
||||
<button
|
||||
onClick={() => paginate(currentPage + 1)}
|
||||
disabled={currentPage === totalPages}
|
||||
className="btn btn-outline-secondary mx-2"
|
||||
>
|
||||
Next
|
||||
</button>
|
||||
</div>
|
||||
</Box>
|
||||
<Box
|
||||
className="w-75 mx-auto d-none"
|
||||
id="certificateDataList"
|
||||
ref={certificateDataRef}
|
||||
>
|
||||
<table className="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th className="h4">Register Number</th>
|
||||
<th className="h4">Tamil Name</th>
|
||||
<th className="h4">Tamil Degree</th>
|
||||
<th className="h4">Tamil Class</th>
|
||||
<th className="h4">Tamil Month Year</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{certificateData.map((data, index) => (
|
||||
<tr key={index}>
|
||||
<td className="h5">{data?.register_number}</td>
|
||||
<td className="font-bamini h5">{data?.tamil_name}</td>
|
||||
<td className="font-bamini h5">{data?.tamil_degree}</td>
|
||||
<td className="font-bamini h5">{data?.tamil_class_name}</td>
|
||||
<td className="font-bamini h5">{data?.tamil_month_year}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</Box>
|
||||
</>
|
||||
)}
|
||||
</AntdesignLayout>
|
||||
);
|
||||
};
|
||||
|
||||
export default CertificateTextVerification;
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
const ConvocationCertificateTemplate = () => {
|
||||
return (
|
||||
<>
|
||||
<div>
|
||||
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default ConvocationCertificateTemplate;
|
||||
|
|
@ -13,8 +13,7 @@ import PlayGroundEditContainer from "./PlayGroundEditContainer";
|
|||
import saveRotatedImage from "./Utilities/PartCPlaygroundUtilities";
|
||||
import markAsPartc from "./Utilities/PartAPlaygroundUtilities";
|
||||
import { updateAttendenceBlank } from "./Utilities/AttendencePlaygroundUtilities";
|
||||
|
||||
|
||||
import Notification from "./Notification";
|
||||
|
||||
const CustomQueryExecutorCard = ({
|
||||
data,
|
||||
|
|
@ -26,15 +25,20 @@ const CustomQueryExecutorCard = ({
|
|||
degreeType,
|
||||
type,
|
||||
tableName,
|
||||
year
|
||||
year,
|
||||
}) => {
|
||||
// console.log("ERROR ============= ",error)
|
||||
// console.log("ERROR REASON ============== ",error_reason)
|
||||
// console.log("REDUX SYSTEM NO ================== ",reduxSystemNo)
|
||||
const navigate = useNavigate();
|
||||
console.log("year in custom query executer card ====== ",year)
|
||||
const imageDomain = (year === "april2024" ? "https://docs.exampaper.vidh.ai" : (year === "november2024" ? 'https://images.exampaper.usln.in' : 'https://docs.exampaper.vidh.ai'))
|
||||
console.log('imageDomain ===== ',imageDomain)
|
||||
console.log("year in custom query executer card ====== ", year);
|
||||
const imageDomain =
|
||||
year === "april2024"
|
||||
? "https://docs.exampaper.vidh.ai"
|
||||
: year === "november2024"
|
||||
? "https://images.exampaper.usln.in"
|
||||
: "https://docs.exampaper.vidh.ai";
|
||||
console.log("imageDomain ===== ", imageDomain);
|
||||
const [dataValue, setDataValue] = useState({});
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
// console.log("data in query executor Card : ", data);
|
||||
|
|
@ -46,6 +50,7 @@ const CustomQueryExecutorCard = ({
|
|||
const imageEleRef = useRef();
|
||||
const [showEditContainer, setShowEditContainer] = useState(false);
|
||||
const [editorType, setEditorType] = useState(null);
|
||||
const [notification, setNotification] = useState(null);
|
||||
|
||||
console.log("data =================== ", data);
|
||||
// console.log("image column ====== ", s3_image_column);
|
||||
|
|
@ -65,6 +70,10 @@ const CustomQueryExecutorCard = ({
|
|||
}
|
||||
}, [data]);
|
||||
|
||||
const showNotification = (message, type) => {
|
||||
setNotification({ message, type });
|
||||
};
|
||||
|
||||
const updatePartAInstructions = async () => {
|
||||
console.log("update instrunction");
|
||||
const payload = {
|
||||
|
|
@ -168,7 +177,7 @@ const CustomQueryExecutorCard = ({
|
|||
console.log("update front");
|
||||
const payload = {
|
||||
data,
|
||||
year
|
||||
year,
|
||||
};
|
||||
try {
|
||||
setIsLoading(true);
|
||||
|
|
@ -192,7 +201,7 @@ const CustomQueryExecutorCard = ({
|
|||
// toast.success("Record Marked as Frontpage ! ....");
|
||||
} else {
|
||||
toast.error("Something Went Wrong !...");
|
||||
setIsLoading(false)
|
||||
setIsLoading(false);
|
||||
throw new Error(responseData?.message);
|
||||
}
|
||||
} catch (error) {
|
||||
|
|
@ -203,7 +212,7 @@ const CustomQueryExecutorCard = ({
|
|||
const updateBack = async () => {
|
||||
const payload = {
|
||||
data,
|
||||
year
|
||||
year,
|
||||
};
|
||||
try {
|
||||
setIsLoading(true);
|
||||
|
|
@ -259,7 +268,7 @@ const CustomQueryExecutorCard = ({
|
|||
const updateEvCover = async () => {
|
||||
const payload = {
|
||||
data,
|
||||
year
|
||||
year,
|
||||
};
|
||||
try {
|
||||
setIsLoading(true);
|
||||
|
|
@ -292,7 +301,7 @@ const CustomQueryExecutorCard = ({
|
|||
const markAsPart_A = async () => {
|
||||
const payload = {
|
||||
data,
|
||||
year
|
||||
year,
|
||||
};
|
||||
try {
|
||||
setIsLoading(true);
|
||||
|
|
@ -325,7 +334,7 @@ const CustomQueryExecutorCard = ({
|
|||
const markAsDummy = async () => {
|
||||
const payload = {
|
||||
data,
|
||||
year
|
||||
year,
|
||||
};
|
||||
try {
|
||||
setIsLoading(true);
|
||||
|
|
@ -348,7 +357,7 @@ const CustomQueryExecutorCard = ({
|
|||
console.log("Updation successfull ....");
|
||||
// toast.success("Record Marked As Ev !...");
|
||||
} else {
|
||||
setIsLoading(false)
|
||||
setIsLoading(false);
|
||||
toast.error("Something Went Wrong !...");
|
||||
throw new Error(responseData?.message);
|
||||
}
|
||||
|
|
@ -365,10 +374,47 @@ const CustomQueryExecutorCard = ({
|
|||
// setEditorType(type)
|
||||
};
|
||||
|
||||
const verifyRecord = async () => {
|
||||
const payload = {
|
||||
data,
|
||||
year,
|
||||
};
|
||||
try {
|
||||
setIsLoading(true);
|
||||
const response = await fetch(
|
||||
`${import.meta.env.VITE_REACT_APP_BACKEND_URL}/verifyRecord`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(payload),
|
||||
}
|
||||
);
|
||||
setIsLoading(false);
|
||||
const responseData = await response.json();
|
||||
if (responseData.status === "success") {
|
||||
const updatedData = { ...dataValue, is_cover: 1 };
|
||||
// console.log("Data ===== ", updatedData);
|
||||
|
||||
const updateAttendenceBlankAction = () =>{
|
||||
updateAttendenceBlank(setIsLoading,data,setShowEditContainer)
|
||||
}
|
||||
console.log("Verification successfull ....");
|
||||
showNotification("Record Verified Successfully ..", "success");
|
||||
// toast.success("Record Marked As Ev !...");
|
||||
} else {
|
||||
setIsLoading(false);
|
||||
showNotification("Something Went Wrong ..", "error");
|
||||
throw new Error(responseData?.message);
|
||||
}
|
||||
} catch (error) {
|
||||
setIsLoading(false);
|
||||
showNotification("Something Went Wrong ..", "error");
|
||||
throw new Error(error);
|
||||
}
|
||||
};
|
||||
|
||||
const updateAttendenceBlankAction = () => {
|
||||
updateAttendenceBlank(setIsLoading, data, setShowEditContainer);
|
||||
};
|
||||
|
||||
const buttonActions = {
|
||||
PartC: [
|
||||
|
|
@ -376,8 +422,9 @@ const CustomQueryExecutorCard = ({
|
|||
{ btnLabel: "Mark As Back", action: updateBack },
|
||||
{ btnLabel: "Mark As Ev", action: updateEvCover },
|
||||
{ btnLabel: "Mark As Dummy", action: markAsDummy },
|
||||
{btnLabel: "Mark As Part-A", action: markAsPart_A},
|
||||
{ btnLabel: "Mark As Part-A", action: markAsPart_A },
|
||||
{ btnLabel: "Edit", action: showContainerAction },
|
||||
{ btnLabel: "Verify", action: verifyRecord },
|
||||
],
|
||||
PartA: [
|
||||
{ btnLabel: "Mark As Front", action: updatePartAFront },
|
||||
|
|
@ -388,15 +435,11 @@ const CustomQueryExecutorCard = ({
|
|||
{ btnLabel: "Edit", action: showContainerAction },
|
||||
],
|
||||
Attendence: [
|
||||
{ btnLabel: "Mark As Blank", action:updateAttendenceBlankAction },
|
||||
{ btnLabel: "Mark As Blank", action: updateAttendenceBlankAction },
|
||||
{ btnLabel: "Edit", action: showContainerAction },
|
||||
]
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
setDataValue(data);
|
||||
setKeys(Object.keys(data));
|
||||
|
|
@ -474,7 +517,7 @@ const CustomQueryExecutorCard = ({
|
|||
|
||||
return (
|
||||
<Box className="w-100 rounded shadow mb-5 white-background" id={imageName}>
|
||||
<ToastContainer/>
|
||||
<ToastContainer />
|
||||
<Box className="p-4 d-flex justify-content-between align-items-start">
|
||||
<Box className="p-1">
|
||||
<Box className="p-2 d-flex justify-content-end gap-3 align-items-center">
|
||||
|
|
@ -585,12 +628,19 @@ const CustomQueryExecutorCard = ({
|
|||
))}
|
||||
</Box>
|
||||
</Box>
|
||||
{notification && (
|
||||
<Notification
|
||||
message={notification.message}
|
||||
type={notification.type}
|
||||
onClose={() => setNotification(null)}
|
||||
/>
|
||||
)}
|
||||
{isLoading && <LoadingContainer loadingText={"Loading ..."} />}
|
||||
{showEditContainer && (
|
||||
<PlayGroundEditContainer
|
||||
type={type}
|
||||
year = {year}
|
||||
imageDomain = {imageDomain}
|
||||
year={year}
|
||||
imageDomain={imageDomain}
|
||||
rotateAngle={rotateAngle}
|
||||
data={data}
|
||||
s3Path={data[s3_image_column]}
|
||||
|
|
|
|||
|
|
@ -32,10 +32,10 @@ const HomeSections = () => {
|
|||
title: "Part A OCR Anomoly - Old Dummy",
|
||||
url: `/sections/${year}/anomoly/partA?type=old`,
|
||||
},
|
||||
// {
|
||||
// title: "Part C",
|
||||
// url: `/sections/${year}/anomoly/partC`,
|
||||
// },
|
||||
{
|
||||
title: "Part C",
|
||||
url: `/sections/${year}/anomoly/partC`,
|
||||
},
|
||||
// {
|
||||
// title:"Verification",
|
||||
// url:"/verification"
|
||||
|
|
@ -59,7 +59,13 @@ const HomeSections = () => {
|
|||
{
|
||||
title:"PlayGrounds",
|
||||
url:`/sections/${year}/Playgrounds`
|
||||
},// {
|
||||
}
|
||||
// }, {
|
||||
// title:"Attendence Not Shaded Solver",
|
||||
// url:`/sections/${year}/attendenceNotShadedCorrection`
|
||||
// }
|
||||
|
||||
// {
|
||||
// title:"Revaluation",
|
||||
// url:"/revaluation"
|
||||
// },
|
||||
|
|
|
|||
|
|
@ -15,9 +15,12 @@ import RotateRightIcon from "@mui/icons-material/RotateRight";
|
|||
import { updatePartCErrorData, updateSystemNo } from "../redux/actions/actions";
|
||||
import { updatePartCErrorList } from "../redux/actions/actions";
|
||||
import { DiscFullTwoTone } from "@mui/icons-material";
|
||||
import { useParams } from "react-router-dom";
|
||||
|
||||
const QrcodeCardEditor = () => {
|
||||
const {year} = useParams()
|
||||
const [searchParams, setSearchParams] = useSearchParams();
|
||||
const table = year === "april2024" ? "ocr_scanned_part_c_v1" : year === "november2024" ? "ocr_scanned_part_c_v2" : "ocr_scanned_part_c_v1"
|
||||
|
||||
const [evQrcode, setEvQrcode] = useState(null);
|
||||
const [imageName, setImageName] = useState(null);
|
||||
|
|
@ -28,7 +31,6 @@ const QrcodeCardEditor = () => {
|
|||
const [rotationResults, setRotationResults] = useState([]);
|
||||
const [rotateAngle, setRotateAngle] = useState(0);
|
||||
const evErrorsList = useSelector((state) => state?.partCErrorList);
|
||||
const table = searchParams.get("table");
|
||||
const image_name = searchParams.get("image_name");
|
||||
const paramsError = searchParams.get("error");
|
||||
const paramsErrorReason = searchParams.get("error_reason");
|
||||
|
|
|
|||
|
|
@ -15,8 +15,10 @@ import RotateRightIcon from "@mui/icons-material/RotateRight";
|
|||
import { updatePartCErrorData, updateSystemNo } from "../redux/actions/actions";
|
||||
import { updatePartCErrorList } from "../redux/actions/actions";
|
||||
import { DiscFullTwoTone } from "@mui/icons-material";
|
||||
import { useParams } from "react-router-dom";
|
||||
|
||||
const QueryCardEditor = () => {
|
||||
const {year} = useParams()
|
||||
const [searchParams, setSearchParams] = useSearchParams();
|
||||
const [barcode, setBarcode] = useState();
|
||||
const [qrcode, setQrcode] = useState();
|
||||
|
|
@ -30,7 +32,8 @@ const QueryCardEditor = () => {
|
|||
const [rotationResults, setRotationResults] = useState([]);
|
||||
const [rotateAngle, setRotateAngle] = useState(0);
|
||||
const evErrorsList = useSelector((state) => state?.partCErrorList);
|
||||
const table = searchParams.get("table");
|
||||
const table = year === "april2024" ? "ocr_scanned_part_c_v1" : year === "november2024" ? "ocr_scanned_part_c_v2" : "ocr_scanned_part_c_v1"
|
||||
const imageDomain = (year === "april2024" ? "https://docs.exampaper.vidh.ai" : (year === "november2024" ? 'https://images.exampaper.usln.in' : 'https://docs.exampaper.vidh.ai'))
|
||||
const image_name = searchParams.get("image_name");
|
||||
const paramsError = searchParams.get("error");
|
||||
const paramsErrorReason = searchParams.get("error_reason");
|
||||
|
|
@ -107,6 +110,7 @@ const QueryCardEditor = () => {
|
|||
}
|
||||
};
|
||||
fetchData();
|
||||
marksInputRef.current.focus()
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -134,6 +138,7 @@ const QueryCardEditor = () => {
|
|||
marks,
|
||||
imageName,
|
||||
rotateAngle,
|
||||
year
|
||||
};
|
||||
const response = await fetch(
|
||||
`${import.meta.env.VITE_REACT_APP_BACKEND_URL}/editPartCdata`,
|
||||
|
|
@ -171,7 +176,7 @@ const QueryCardEditor = () => {
|
|||
if (newRecords.length > 0) {
|
||||
console.log("Has to navigte 12 .....");
|
||||
localStorage.setItem("marks_manual_data", JSON.stringify(newRecords));
|
||||
const newUrl = `/sqlPlayground/edit?image_name=${newRecords[currentIndex]?.image_name}&table=ocr_scanned_part_c_v1&error=${paramsError}&error_reason=${paramsErrorReason}°reeType=${paramsDegreeType}&sysNo=${paramsSysNo}`;
|
||||
const newUrl = `/sections/${year}/sqlPlayground/edit?image_name=${newRecords[currentIndex]?.image_name}&error=${paramsError}&error_reason=${paramsErrorReason}°reeType=${paramsDegreeType}&sysNo=${paramsSysNo}`;
|
||||
console.log("new url ==== ", newUrl);
|
||||
window.location.href = newUrl;
|
||||
} else {
|
||||
|
|
@ -242,7 +247,7 @@ const QueryCardEditor = () => {
|
|||
console.log("new index ===== ", newIndex);
|
||||
if (newRecords.length > 0) {
|
||||
console.log("Has to navigte 12 .....");
|
||||
const newUrl = `/sqlPlayground/edit?image_name=${evErrorsData[newIndex]?.image_name}&table=ocr_scanned_part_c_v1&error=${paramsError}&error_reason=${paramsErrorReason}°reeType=${paramsDegreeType}&sysNo=${paramsSysNo}`;
|
||||
const newUrl = `/sections/${year}/sqlPlayground/edit?image_name=${evErrorsData[newIndex]?.image_name}&table=ocr_scanned_part_c_v1&error=${paramsError}&error_reason=${paramsErrorReason}°reeType=${paramsDegreeType}&sysNo=${paramsSysNo}`;
|
||||
console.log("new url ==== ", newUrl);
|
||||
window.location.href = newUrl;
|
||||
}
|
||||
|
|
@ -273,9 +278,18 @@ const QueryCardEditor = () => {
|
|||
|
||||
return (
|
||||
<AntdesignLayout>
|
||||
<Box className="d-flex justify-content-between align-items-center">
|
||||
<Box className="d-flex justify-content-between align-items-start">
|
||||
<Box className="w-75">
|
||||
<Box className="px-5" id="img-container">
|
||||
<img
|
||||
src={`${imageDomain}/${recordData?.s3_path}`}
|
||||
width="100%"
|
||||
height="auto"
|
||||
/>
|
||||
</Box>
|
||||
</Box>
|
||||
<Box className="d-flex flex-column gap-3 w-25">
|
||||
{imageName && <h5 className="text-left">ID : {imageName}</h5>}
|
||||
{/* {imageName && <h5 className="text-left">ID : {imageName}</h5>}
|
||||
{paramsError && (
|
||||
<h5 className="text-left">Error Code : {paramsError}</h5>
|
||||
)}
|
||||
|
|
@ -285,7 +299,8 @@ const QueryCardEditor = () => {
|
|||
) : (
|
||||
<h5 className="text-left">Degree Type : PG</h5>
|
||||
)
|
||||
) : null}
|
||||
) : null} */}
|
||||
<h5 style={{textAlign:"left",marginTop:'10px',marginBottom:'0px'}}><strong>COVER CODE : </strong>{recordData?.new_cover_barcode}</h5>
|
||||
<TextInputField
|
||||
placeholder="Barcode"
|
||||
value={barcode}
|
||||
|
|
@ -345,15 +360,6 @@ const QueryCardEditor = () => {
|
|||
</Button>
|
||||
</Box>
|
||||
</Box>
|
||||
<Box className="w-75">
|
||||
<Box className="px-5" id="img-container">
|
||||
<img
|
||||
src={`https://docs.exampaper.vidh.ai/${recordData?.s3_path}`}
|
||||
width="100%"
|
||||
height="auto"
|
||||
/>
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
{isLoading && <LoadingContainer />}
|
||||
{showDialog && (
|
||||
|
|
|
|||
|
|
@ -6,15 +6,19 @@ import { useState, useEffect } from "react";
|
|||
import { ToastContainer, toast } from "react-toastify";
|
||||
import LoadingContainer from "./LoadingContainer";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useParams } from "react-router-dom";
|
||||
|
||||
|
||||
const QueryExecutorCard = ({ data, s3_image_column, query, error, error_reason, reduxSystemNo,degreeType }) => {
|
||||
const { year } = useParams()
|
||||
const imageDomain = (year === "april2024" ? "https://docs.exampaper.vidh.ai" : (year === "november2024" ? 'https://images.exampaper.usln.in' : 'https://docs.exampaper.vidh.ai'))
|
||||
// console.log("ERROR ============= ",error)
|
||||
// console.log("ERROR REASON ============== ",error_reason)
|
||||
// console.log("REDUX SYSTEM NO ================== ",reduxSystemNo)
|
||||
const navigate = useNavigate()
|
||||
const [dataValue, setDataValue] = useState({});
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
// console.log("data in query executor Card : ", data);
|
||||
console.log("data in query executor Card : ", data);
|
||||
const [keys, setKeys] = useState([]);
|
||||
const [values, setValues] = useState([]);
|
||||
// console.log("image column ====== ", s3_image_column);
|
||||
|
|
@ -175,7 +179,7 @@ const QueryExecutorCard = ({ data, s3_image_column, query, error, error_reason,
|
|||
<>
|
||||
<Button
|
||||
className="w-50 m-0 bg-primary text-white p-1 rounded"
|
||||
onClick={() => navigate(`/sqlPlayground/edit?image_name=${data["image_name"]}&table=ocr_scanned_part_c_v1&error=${error}&error_reason=${error_reason}&sysNo=${reduxSystemNo}°reeType=${degreeType}`)}
|
||||
onClick={() => navigate(`/sections/${year}/sqlPlayground/edit?image_name=${data["image_name"]}&error=${error}&error_reason=${error_reason}&sysNo=${reduxSystemNo}°reeType=${degreeType}`)}
|
||||
>
|
||||
Edit
|
||||
</Button>
|
||||
|
|
@ -207,7 +211,7 @@ const QueryExecutorCard = ({ data, s3_image_column, query, error, error_reason,
|
|||
)}
|
||||
<Button className="bg-primary">
|
||||
<a
|
||||
href={`https://docs.exampaper.vidh.ai/${data[s3_image_column]}`}
|
||||
href={`${imageDomain}/${data[s3_image_column]}`}
|
||||
>
|
||||
<DownloadIcon className="text-light text-white" />
|
||||
</a>
|
||||
|
|
@ -215,7 +219,7 @@ const QueryExecutorCard = ({ data, s3_image_column, query, error, error_reason,
|
|||
</Box>
|
||||
<Box className="border border-dark">
|
||||
<img
|
||||
src={`https://docs.exampaper.vidh.ai/${data[s3_image_column]}`}
|
||||
src={`${imageDomain}/${data[s3_image_column]}`}
|
||||
width="800px"
|
||||
height="auto"
|
||||
alt="Image Alt"
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ const SystemNumberDialog = (setShowSystemNoContainer,showSystemNoContainer) => {
|
|||
const handleSubmit = () => {
|
||||
console.log("Handling submit")
|
||||
dispatch(updateSystemNo(systemNo));
|
||||
navigate("/")
|
||||
// navigate("/")
|
||||
handleClose(true)
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import React from "react";
|
|||
const TextInputField = React.forwardRef(
|
||||
({ placeholder, value, setValue, onKeyDown }, ref) => {
|
||||
return (
|
||||
<Box className="d-flex flex-column py-3">
|
||||
<Box className="d-flex flex-column py-2">
|
||||
<label htmlFor="limit-input" className="text-left">
|
||||
{placeholder} :-
|
||||
</label>
|
||||
|
|
|
|||
|
|
@ -38,6 +38,12 @@ const UpdatedPlaygroundUpdater = ({
|
|||
// console.log("REDUX SYSTEM NO ================== ",reduxSystemNo)
|
||||
const navigate = useNavigate();
|
||||
const { year } = useParams();
|
||||
const imageDomain =
|
||||
year === "april2024"
|
||||
? "https://docs.exampaper.vidh.ai"
|
||||
: year === "november2024"
|
||||
? "https://images.exampaper.usln.in"
|
||||
: "https://docs.exampaper.vidh.ai";
|
||||
const [dataValue, setDataValue] = useState({});
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
// console.log("data in query executor Card : ", data);
|
||||
|
|
@ -47,6 +53,9 @@ const UpdatedPlaygroundUpdater = ({
|
|||
const [imageName, setImageName] = useState(null);
|
||||
const [tableNameData, setTableNameData] = useState(null);
|
||||
const imageEleRef = useRef();
|
||||
const subjectCodeInputEleRef = useRef();
|
||||
const registerNumberInputEleRef = useRef();
|
||||
|
||||
const [showEditContainer, setShowEditContainer] = useState(false);
|
||||
const [editorType, setEditorType] = useState(null);
|
||||
const dialogText = "This is dialog text";
|
||||
|
|
@ -88,6 +97,32 @@ const UpdatedPlaygroundUpdater = ({
|
|||
console.log("the currect editor type: ", type);
|
||||
}, [data]);
|
||||
|
||||
useEffect(() => {
|
||||
if (type == "PartA") {
|
||||
subjectCodeInputEleRef.current.focus();
|
||||
}
|
||||
}, [type]);
|
||||
|
||||
const handleKeyDown = (e) => {
|
||||
console.log("handle key down ...")
|
||||
try {
|
||||
if (type === "PartA") {
|
||||
// console.log("Handle key down clicked ...", e);
|
||||
// console.log("event target ..... ", e.target);
|
||||
// console.log("barcode targed .....", barcodeInputRef.current);
|
||||
if (e.key === "Enter") {
|
||||
if (e.target === subjectCodeInputEleRef.current) {
|
||||
console.log("subject code input ele ...")
|
||||
registerNumberInputEleRef.current.focus();
|
||||
} else if (e.target === registerNumberInputEleRef.current) {
|
||||
console.log('updating ...')
|
||||
updateRecordPartA()
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (error) {}
|
||||
};
|
||||
|
||||
// useEffect(() => {
|
||||
// console.log("barcode in use effect ==== ", barcode);
|
||||
// }, [barcode]);
|
||||
|
|
@ -424,7 +459,7 @@ const UpdatedPlaygroundUpdater = ({
|
|||
registerNumber,
|
||||
imageName,
|
||||
rotateAngle,
|
||||
year
|
||||
year,
|
||||
};
|
||||
const response = await fetch(
|
||||
`${import.meta.env.VITE_REACT_APP_BACKEND_URL}/editPartAdata`,
|
||||
|
|
@ -586,7 +621,7 @@ const UpdatedPlaygroundUpdater = ({
|
|||
</Box>
|
||||
<Box className="border border-dark" id={imageName}>
|
||||
<img
|
||||
src={`https://docs.exampaper.vidh.ai/${oldData[s3_image_column]}`}
|
||||
src={`${imageDomain}/${oldData[s3_image_column]}`}
|
||||
width="850px"
|
||||
height="auto"
|
||||
alt="Image Alt"
|
||||
|
|
@ -657,6 +692,8 @@ const UpdatedPlaygroundUpdater = ({
|
|||
value={subjectCode || ""}
|
||||
setValue={setSubjectCode}
|
||||
placeholder={"Subject code"}
|
||||
ref={subjectCodeInputEleRef}
|
||||
onKeyDown={handleKeyDown}
|
||||
/>
|
||||
</>
|
||||
) : (
|
||||
|
|
@ -670,6 +707,8 @@ const UpdatedPlaygroundUpdater = ({
|
|||
value={subjectCode}
|
||||
setValue={setSubjectCode}
|
||||
placeholder={"Subject Code"}
|
||||
ref={subjectCodeInputEleRef}
|
||||
onKeyDown={handleKeyDown}
|
||||
/>
|
||||
<TextInputField
|
||||
value={totalStudents}
|
||||
|
|
@ -701,6 +740,8 @@ const UpdatedPlaygroundUpdater = ({
|
|||
value={registerNumber || ""}
|
||||
setValue={setRegisterNumber}
|
||||
placeholder={"Register no"}
|
||||
ref={registerNumberInputEleRef}
|
||||
onKeyDown={handleKeyDown}
|
||||
/>
|
||||
) : null}
|
||||
<Box display="flex" justifyContent="space-between">
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Binary file not shown.
Loading…
Reference in New Issue