added verify button for part-c

This commit is contained in:
Pradeeppon01 2025-01-11 14:07:29 +05:30
parent caf3eca000
commit 9e010d7f49
17 changed files with 513 additions and 74 deletions

2
.env
View File

@ -2,5 +2,5 @@
METABASE_BASE_URL="http://metabase.usln.in/public/question/d8774923-09bb-4cd9-903b-559d417e12cf" 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="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" #VITE_REACT_APP_BACKEND_URL="https://api.exampaper.usln.in"

View File

@ -53,6 +53,7 @@
/* Notification Styles */ /* Notification Styles */
.notification { .notification {
position: fixed; position: fixed;
font-size: 19px;
top: 20px; top: 20px;
right: 20px; right: 20px;
padding: 15px; padding: 15px;
@ -242,3 +243,16 @@ button{
background: blue; background: blue;
color: white; 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;
}

View File

@ -39,6 +39,8 @@ import DataInsertion from "./Components/DataInsertion";
import DataInsertionCsvViewer from "./Components/DataInsertionCsvViewer"; import DataInsertionCsvViewer from "./Components/DataInsertionCsvViewer";
import Login from "./Components/Login"; import Login from "./Components/Login";
import HomeSections from "./Components/HomeSections"; import HomeSections from "./Components/HomeSections";
import CertificateTextVerification from "./Components/CertificateTextVerification";
import AttendenceNotShadedCorrection from "./Components/AttendenceNotShadedCorrection";
function App() { function App() {
return ( return (
@ -46,9 +48,15 @@ function App() {
<BrowserRouter> <BrowserRouter>
<Routes> <Routes>
<Route path="/" element={<Home />}></Route> <Route path="/" element={<Home />}></Route>
<Route path="/sections/:year/sqlPlayground" element={<QueryExecutor />}></Route> <Route
<Route path="/sections/:year/data/insertion" element={<DataInsertion />}></Route> path="/sections/:year/sqlPlayground"
<Route path="/sections/:year" element={<HomeSections/>}></Route> element={<QueryExecutor />}
></Route>
<Route
path="/sections/:year/data/insertion"
element={<DataInsertion />}
></Route>
<Route path="/sections/:year" element={<HomeSections />}></Route>
<Route <Route
path="/sections/:year/data/insertion/validation" path="/sections/:year/data/insertion/validation"
element={<DataInsertionCsvViewer />} element={<DataInsertionCsvViewer />}
@ -65,14 +73,26 @@ function App() {
path="/sections/:year/sqlPlayground/edit" path="/sections/:year/sqlPlayground/edit"
element={<QueryCardEditor />} element={<QueryCardEditor />}
></Route> ></Route>
<Route path="/sections/:year/evQrcode/edit" element={<QrcodeCardEditor />}></Route> <Route
path="/sections/:year/evQrcode/edit"
element={<QrcodeCardEditor />}
></Route>
<Route <Route
path="/sections/:year/studentsDetails" path="/sections/:year/studentsDetails"
element={<StudentResultsData />} element={<StudentResultsData />}
></Route> ></Route>
<Route path="/sections/:year/Playgrounds" element={<PlayGrounds />}></Route> <Route
<Route path="/sections/:year/Playground/:type" element={<PlayGround />}></Route> path="/sections/:year/Playgrounds"
<Route path="/sections/:year/revaluation" element={<Revaluation />}></Route> element={<PlayGrounds />}
></Route>
<Route
path="/sections/:year/Playground/:type"
element={<PlayGround />}
></Route>
<Route
path="/sections/:year/revaluation"
element={<Revaluation />}
></Route>
<Route <Route
path="/sections/:year/playground/updated/:type" path="/sections/:year/playground/updated/:type"
element={<PlayGroundUpdated />} element={<PlayGroundUpdated />}
@ -101,7 +121,10 @@ function App() {
path="/sections/:year/anomoly/attendence/additionalSheet" path="/sections/:year/anomoly/attendence/additionalSheet"
element={<AttendanceAdditionalSheet />} element={<AttendanceAdditionalSheet />}
></Route> ></Route>
<Route path="/sections/:year/barcodeScanner" element={<BarcodeScanner />}></Route> <Route
path="/sections/:year/barcodeScanner"
element={<BarcodeScanner />}
></Route>
<Route <Route
path="/sections/:year/anomoly/reassigned/booklet" path="/sections/:year/anomoly/reassigned/booklet"
element={<AttendenceCorrection />} element={<AttendenceCorrection />}
@ -114,11 +137,18 @@ function App() {
path="/sections/:year/anomoly/attendence" path="/sections/:year/anomoly/attendence"
element={<AnomolyAttendencePage />} element={<AnomolyAttendencePage />}
></Route> ></Route>
<Route path="/sections/:year/qrcodeFinder" element={<QrcodeFinder />}></Route> <Route
path="/sections/:year/qrcodeFinder"
element={<QrcodeFinder />}
></Route>
<Route <Route
path="/sections/:year/anomoly/attendence/additionalRecord" path="/sections/:year/anomoly/attendence/additionalRecord"
element={<AttendenceAdditionalRecord />} element={<AttendenceAdditionalRecord />}
/> />
<Route
path="/sections/:year/AttendenceNotShadedCorrection"
element={<AttendenceNotShadedCorrection />}
/>
<Route <Route
path="/sections/:year/anomoly/attendence/additionalRecord/correction" path="/sections/:year/anomoly/attendence/additionalRecord/correction"
element={<AttendenceAdditionalRecordCorrection />} element={<AttendenceAdditionalRecordCorrection />}
@ -127,18 +157,32 @@ function App() {
path="/sections/:year/anomoly/reassigned/stats/:exam_centre_code" path="/sections/:year/anomoly/reassigned/stats/:exam_centre_code"
element={<IndividualExamCentreStats />} element={<IndividualExamCentreStats />}
></Route> ></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 {/* <Route
path="/verification" path="/verification"
element={<Verification/>} element={<Verification/>}
> >
</Route> */} </Route> */}
<Route path="/sections/:year/statistics" element={<Statistics />}></Route> <Route
path="/sections/:year/statistics"
element={<Statistics />}
></Route>
<Route <Route
path="/sections/:year/anomoly/partA/booklet" path="/sections/:year/anomoly/partA/booklet"
element={<PartACorrection />} element={<PartACorrection />}
></Route> ></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> <Route path="/sections/:year/evQrcode" element={<EvQrcode />}></Route>
</Routes> </Routes>
</BrowserRouter> </BrowserRouter>

View File

@ -26,10 +26,13 @@ import FormControl from "@mui/material/FormControl";
import Select from "@mui/material/Select"; import Select from "@mui/material/Select";
import { useSearchParams } from "react-router-dom"; import { useSearchParams } from "react-router-dom";
import { updatePartCDegreeType } from "../redux/actions/actions"; import { updatePartCDegreeType } from "../redux/actions/actions";
import { useParams } from "react-router-dom";
const { Content, Header } = Layout; const { Content, Header } = Layout;
function AnomalyPartC() { function AnomalyPartC() {
const { year } = useParams()
const [searchParams, setSearchParams] = useSearchParams(); const [searchParams, setSearchParams] = useSearchParams();
const [isLoading, setIsLoading] = useState(false); const [isLoading, setIsLoading] = useState(false);
const [isLoading2, setIsLoading2] = useState(false); const [isLoading2, setIsLoading2] = useState(false);
@ -41,7 +44,7 @@ function AnomalyPartC() {
const [totalPages, setTotalPages] = useState(1); const [totalPages, setTotalPages] = useState(1);
const [showSystemNoContainer, setShowSystemNoContainer] = useState(false); const [showSystemNoContainer, setShowSystemNoContainer] = useState(false);
const [selectedIndex, setSelectedIndex] = useState(null); const [selectedIndex, setSelectedIndex] = useState(null);
const [selectedDegreeType, setSelectedDegreeType] = useState(null); const [selectedDegreeType, setSelectedDegreeType] = useState("0");
const [dataFetched, setDataFetched] = useState([]); const [dataFetched, setDataFetched] = useState([]);
const [counter, setCounter] = useState(0); const [counter, setCounter] = useState(0);
const degreeTypes = [ const degreeTypes = [
@ -56,7 +59,7 @@ function AnomalyPartC() {
if (reduxDegreeType) { if (reduxDegreeType) {
setSelectedDegreeType(reduxDegreeType); setSelectedDegreeType(reduxDegreeType);
} else { } else {
setSelectedDegreeType("2"); setSelectedDegreeType("0");
} }
}, [reduxDegreeType]); }, [reduxDegreeType]);
@ -140,6 +143,7 @@ function AnomalyPartC() {
const payload = { const payload = {
systemRecords, systemRecords,
sysNo: reduxSystemNo, sysNo: reduxSystemNo,
year,
}; };
try { try {
fetch( fetch(
@ -170,7 +174,7 @@ function AnomalyPartC() {
const response = await fetch( const response = await fetch(
`${ `${
import.meta.env.VITE_REACT_APP_BACKEND_URL import.meta.env.VITE_REACT_APP_BACKEND_URL
}/getpartcEv?degreeType=${selectedDegreeType}`, }/getpartcEv?degreeType=${selectedDegreeType}&year=${year}`,
{ {
method: "GET", method: "GET",
headers: { headers: {
@ -203,6 +207,7 @@ function AnomalyPartC() {
error_reason: errorReason, error_reason: errorReason,
sysno: reduxSystemNo, sysno: reduxSystemNo,
degreeType: selectedDegreeType, degreeType: selectedDegreeType,
year: year
}), }),
headers: { headers: {
"Content-Type": "application/json", "Content-Type": "application/json",
@ -368,7 +373,12 @@ function AnomalyPartC() {
<CardContent> <CardContent>
{item.error && ( {item.error && (
<Typography id="1" variant="body2"> <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> </Typography>
)} )}
{item["count(*)"] && ( {item["count(*)"] && (

View File

@ -0,0 +1,8 @@
const AttendenceNotShadedCorrection = () =>{
return(
<div>Hl</div>
)
}
export default AttendenceNotShadedCorrection

View File

@ -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;

View File

@ -0,0 +1,11 @@
const ConvocationCertificateTemplate = () => {
return (
<>
<div>
</div>
</>
);
};
export default ConvocationCertificateTemplate;

View File

@ -13,8 +13,7 @@ import PlayGroundEditContainer from "./PlayGroundEditContainer";
import saveRotatedImage from "./Utilities/PartCPlaygroundUtilities"; import saveRotatedImage from "./Utilities/PartCPlaygroundUtilities";
import markAsPartc from "./Utilities/PartAPlaygroundUtilities"; import markAsPartc from "./Utilities/PartAPlaygroundUtilities";
import { updateAttendenceBlank } from "./Utilities/AttendencePlaygroundUtilities"; import { updateAttendenceBlank } from "./Utilities/AttendencePlaygroundUtilities";
import Notification from "./Notification";
const CustomQueryExecutorCard = ({ const CustomQueryExecutorCard = ({
data, data,
@ -26,15 +25,20 @@ const CustomQueryExecutorCard = ({
degreeType, degreeType,
type, type,
tableName, tableName,
year year,
}) => { }) => {
// console.log("ERROR ============= ",error) // console.log("ERROR ============= ",error)
// console.log("ERROR REASON ============== ",error_reason) // console.log("ERROR REASON ============== ",error_reason)
// console.log("REDUX SYSTEM NO ================== ",reduxSystemNo) // console.log("REDUX SYSTEM NO ================== ",reduxSystemNo)
const navigate = useNavigate(); const navigate = useNavigate();
console.log("year in custom query executer card ====== ",year) 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')) const imageDomain =
console.log('imageDomain ===== ',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 [dataValue, setDataValue] = useState({});
const [isLoading, setIsLoading] = useState(false); const [isLoading, setIsLoading] = useState(false);
// console.log("data in query executor Card : ", data); // console.log("data in query executor Card : ", data);
@ -46,6 +50,7 @@ const CustomQueryExecutorCard = ({
const imageEleRef = useRef(); const imageEleRef = useRef();
const [showEditContainer, setShowEditContainer] = useState(false); const [showEditContainer, setShowEditContainer] = useState(false);
const [editorType, setEditorType] = useState(null); const [editorType, setEditorType] = useState(null);
const [notification, setNotification] = useState(null);
console.log("data =================== ", data); console.log("data =================== ", data);
// console.log("image column ====== ", s3_image_column); // console.log("image column ====== ", s3_image_column);
@ -65,6 +70,10 @@ const CustomQueryExecutorCard = ({
} }
}, [data]); }, [data]);
const showNotification = (message, type) => {
setNotification({ message, type });
};
const updatePartAInstructions = async () => { const updatePartAInstructions = async () => {
console.log("update instrunction"); console.log("update instrunction");
const payload = { const payload = {
@ -168,7 +177,7 @@ const CustomQueryExecutorCard = ({
console.log("update front"); console.log("update front");
const payload = { const payload = {
data, data,
year year,
}; };
try { try {
setIsLoading(true); setIsLoading(true);
@ -192,7 +201,7 @@ const CustomQueryExecutorCard = ({
// toast.success("Record Marked as Frontpage ! ...."); // toast.success("Record Marked as Frontpage ! ....");
} else { } else {
toast.error("Something Went Wrong !..."); toast.error("Something Went Wrong !...");
setIsLoading(false) setIsLoading(false);
throw new Error(responseData?.message); throw new Error(responseData?.message);
} }
} catch (error) { } catch (error) {
@ -203,7 +212,7 @@ const CustomQueryExecutorCard = ({
const updateBack = async () => { const updateBack = async () => {
const payload = { const payload = {
data, data,
year year,
}; };
try { try {
setIsLoading(true); setIsLoading(true);
@ -259,7 +268,7 @@ const CustomQueryExecutorCard = ({
const updateEvCover = async () => { const updateEvCover = async () => {
const payload = { const payload = {
data, data,
year year,
}; };
try { try {
setIsLoading(true); setIsLoading(true);
@ -292,7 +301,7 @@ const CustomQueryExecutorCard = ({
const markAsPart_A = async () => { const markAsPart_A = async () => {
const payload = { const payload = {
data, data,
year year,
}; };
try { try {
setIsLoading(true); setIsLoading(true);
@ -325,7 +334,7 @@ const CustomQueryExecutorCard = ({
const markAsDummy = async () => { const markAsDummy = async () => {
const payload = { const payload = {
data, data,
year year,
}; };
try { try {
setIsLoading(true); setIsLoading(true);
@ -348,7 +357,7 @@ const CustomQueryExecutorCard = ({
console.log("Updation successfull ...."); console.log("Updation successfull ....");
// toast.success("Record Marked As Ev !..."); // toast.success("Record Marked As Ev !...");
} else { } else {
setIsLoading(false) setIsLoading(false);
toast.error("Something Went Wrong !..."); toast.error("Something Went Wrong !...");
throw new Error(responseData?.message); throw new Error(responseData?.message);
} }
@ -365,10 +374,47 @@ const CustomQueryExecutorCard = ({
// setEditorType(type) // 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 = () =>{ console.log("Verification successfull ....");
updateAttendenceBlank(setIsLoading,data,setShowEditContainer) 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 = { const buttonActions = {
PartC: [ PartC: [
@ -376,8 +422,9 @@ const CustomQueryExecutorCard = ({
{ btnLabel: "Mark As Back", action: updateBack }, { btnLabel: "Mark As Back", action: updateBack },
{ btnLabel: "Mark As Ev", action: updateEvCover }, { btnLabel: "Mark As Ev", action: updateEvCover },
{ btnLabel: "Mark As Dummy", action: markAsDummy }, { 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: "Edit", action: showContainerAction },
{ btnLabel: "Verify", action: verifyRecord },
], ],
PartA: [ PartA: [
{ btnLabel: "Mark As Front", action: updatePartAFront }, { btnLabel: "Mark As Front", action: updatePartAFront },
@ -388,15 +435,11 @@ const CustomQueryExecutorCard = ({
{ btnLabel: "Edit", action: showContainerAction }, { btnLabel: "Edit", action: showContainerAction },
], ],
Attendence: [ Attendence: [
{ btnLabel: "Mark As Blank", action:updateAttendenceBlankAction }, { btnLabel: "Mark As Blank", action: updateAttendenceBlankAction },
{ btnLabel: "Edit", action: showContainerAction }, { btnLabel: "Edit", action: showContainerAction },
] ],
}; };
useEffect(() => { useEffect(() => {
setDataValue(data); setDataValue(data);
setKeys(Object.keys(data)); setKeys(Object.keys(data));
@ -474,7 +517,7 @@ const CustomQueryExecutorCard = ({
return ( return (
<Box className="w-100 rounded shadow mb-5 white-background" id={imageName}> <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-4 d-flex justify-content-between align-items-start">
<Box className="p-1"> <Box className="p-1">
<Box className="p-2 d-flex justify-content-end gap-3 align-items-center"> <Box className="p-2 d-flex justify-content-end gap-3 align-items-center">
@ -585,12 +628,19 @@ const CustomQueryExecutorCard = ({
))} ))}
</Box> </Box>
</Box> </Box>
{notification && (
<Notification
message={notification.message}
type={notification.type}
onClose={() => setNotification(null)}
/>
)}
{isLoading && <LoadingContainer loadingText={"Loading ..."} />} {isLoading && <LoadingContainer loadingText={"Loading ..."} />}
{showEditContainer && ( {showEditContainer && (
<PlayGroundEditContainer <PlayGroundEditContainer
type={type} type={type}
year = {year} year={year}
imageDomain = {imageDomain} imageDomain={imageDomain}
rotateAngle={rotateAngle} rotateAngle={rotateAngle}
data={data} data={data}
s3Path={data[s3_image_column]} s3Path={data[s3_image_column]}

View File

@ -32,10 +32,10 @@ const HomeSections = () => {
title: "Part A OCR Anomoly - Old Dummy", title: "Part A OCR Anomoly - Old Dummy",
url: `/sections/${year}/anomoly/partA?type=old`, url: `/sections/${year}/anomoly/partA?type=old`,
}, },
// { {
// title: "Part C", title: "Part C",
// url: `/sections/${year}/anomoly/partC`, url: `/sections/${year}/anomoly/partC`,
// }, },
// { // {
// title:"Verification", // title:"Verification",
// url:"/verification" // url:"/verification"
@ -59,7 +59,13 @@ const HomeSections = () => {
{ {
title:"PlayGrounds", title:"PlayGrounds",
url:`/sections/${year}/Playgrounds` url:`/sections/${year}/Playgrounds`
},// { }
// }, {
// title:"Attendence Not Shaded Solver",
// url:`/sections/${year}/attendenceNotShadedCorrection`
// }
// {
// title:"Revaluation", // title:"Revaluation",
// url:"/revaluation" // url:"/revaluation"
// }, // },

View File

@ -15,9 +15,12 @@ import RotateRightIcon from "@mui/icons-material/RotateRight";
import { updatePartCErrorData, updateSystemNo } from "../redux/actions/actions"; import { updatePartCErrorData, updateSystemNo } from "../redux/actions/actions";
import { updatePartCErrorList } from "../redux/actions/actions"; import { updatePartCErrorList } from "../redux/actions/actions";
import { DiscFullTwoTone } from "@mui/icons-material"; import { DiscFullTwoTone } from "@mui/icons-material";
import { useParams } from "react-router-dom";
const QrcodeCardEditor = () => { const QrcodeCardEditor = () => {
const {year} = useParams()
const [searchParams, setSearchParams] = useSearchParams(); 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 [evQrcode, setEvQrcode] = useState(null);
const [imageName, setImageName] = useState(null); const [imageName, setImageName] = useState(null);
@ -28,7 +31,6 @@ const QrcodeCardEditor = () => {
const [rotationResults, setRotationResults] = useState([]); const [rotationResults, setRotationResults] = useState([]);
const [rotateAngle, setRotateAngle] = useState(0); const [rotateAngle, setRotateAngle] = useState(0);
const evErrorsList = useSelector((state) => state?.partCErrorList); const evErrorsList = useSelector((state) => state?.partCErrorList);
const table = searchParams.get("table");
const image_name = searchParams.get("image_name"); const image_name = searchParams.get("image_name");
const paramsError = searchParams.get("error"); const paramsError = searchParams.get("error");
const paramsErrorReason = searchParams.get("error_reason"); const paramsErrorReason = searchParams.get("error_reason");

View File

@ -15,8 +15,10 @@ import RotateRightIcon from "@mui/icons-material/RotateRight";
import { updatePartCErrorData, updateSystemNo } from "../redux/actions/actions"; import { updatePartCErrorData, updateSystemNo } from "../redux/actions/actions";
import { updatePartCErrorList } from "../redux/actions/actions"; import { updatePartCErrorList } from "../redux/actions/actions";
import { DiscFullTwoTone } from "@mui/icons-material"; import { DiscFullTwoTone } from "@mui/icons-material";
import { useParams } from "react-router-dom";
const QueryCardEditor = () => { const QueryCardEditor = () => {
const {year} = useParams()
const [searchParams, setSearchParams] = useSearchParams(); const [searchParams, setSearchParams] = useSearchParams();
const [barcode, setBarcode] = useState(); const [barcode, setBarcode] = useState();
const [qrcode, setQrcode] = useState(); const [qrcode, setQrcode] = useState();
@ -30,7 +32,8 @@ const QueryCardEditor = () => {
const [rotationResults, setRotationResults] = useState([]); const [rotationResults, setRotationResults] = useState([]);
const [rotateAngle, setRotateAngle] = useState(0); const [rotateAngle, setRotateAngle] = useState(0);
const evErrorsList = useSelector((state) => state?.partCErrorList); 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 image_name = searchParams.get("image_name");
const paramsError = searchParams.get("error"); const paramsError = searchParams.get("error");
const paramsErrorReason = searchParams.get("error_reason"); const paramsErrorReason = searchParams.get("error_reason");
@ -107,6 +110,7 @@ const QueryCardEditor = () => {
} }
}; };
fetchData(); fetchData();
marksInputRef.current.focus()
}, []); }, []);
useEffect(() => { useEffect(() => {
@ -134,6 +138,7 @@ const QueryCardEditor = () => {
marks, marks,
imageName, imageName,
rotateAngle, rotateAngle,
year
}; };
const response = await fetch( const response = await fetch(
`${import.meta.env.VITE_REACT_APP_BACKEND_URL}/editPartCdata`, `${import.meta.env.VITE_REACT_APP_BACKEND_URL}/editPartCdata`,
@ -171,7 +176,7 @@ const QueryCardEditor = () => {
if (newRecords.length > 0) { if (newRecords.length > 0) {
console.log("Has to navigte 12 ....."); console.log("Has to navigte 12 .....");
localStorage.setItem("marks_manual_data", JSON.stringify(newRecords)); 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}&degreeType=${paramsDegreeType}&sysNo=${paramsSysNo}`; const newUrl = `/sections/${year}/sqlPlayground/edit?image_name=${newRecords[currentIndex]?.image_name}&error=${paramsError}&error_reason=${paramsErrorReason}&degreeType=${paramsDegreeType}&sysNo=${paramsSysNo}`;
console.log("new url ==== ", newUrl); console.log("new url ==== ", newUrl);
window.location.href = newUrl; window.location.href = newUrl;
} else { } else {
@ -242,7 +247,7 @@ const QueryCardEditor = () => {
console.log("new index ===== ", newIndex); console.log("new index ===== ", newIndex);
if (newRecords.length > 0) { if (newRecords.length > 0) {
console.log("Has to navigte 12 ....."); 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}&degreeType=${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}&degreeType=${paramsDegreeType}&sysNo=${paramsSysNo}`;
console.log("new url ==== ", newUrl); console.log("new url ==== ", newUrl);
window.location.href = newUrl; window.location.href = newUrl;
} }
@ -273,9 +278,18 @@ const QueryCardEditor = () => {
return ( return (
<AntdesignLayout> <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"> <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 && ( {paramsError && (
<h5 className="text-left">Error Code : {paramsError}</h5> <h5 className="text-left">Error Code : {paramsError}</h5>
)} )}
@ -285,7 +299,8 @@ const QueryCardEditor = () => {
) : ( ) : (
<h5 className="text-left">Degree Type : PG</h5> <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 <TextInputField
placeholder="Barcode" placeholder="Barcode"
value={barcode} value={barcode}
@ -345,15 +360,6 @@ const QueryCardEditor = () => {
</Button> </Button>
</Box> </Box>
</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> </Box>
{isLoading && <LoadingContainer />} {isLoading && <LoadingContainer />}
{showDialog && ( {showDialog && (

View File

@ -6,15 +6,19 @@ import { useState, useEffect } from "react";
import { ToastContainer, toast } from "react-toastify"; import { ToastContainer, toast } from "react-toastify";
import LoadingContainer from "./LoadingContainer"; import LoadingContainer from "./LoadingContainer";
import { useNavigate } from "react-router-dom"; 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 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 ============= ",error)
// console.log("ERROR REASON ============== ",error_reason) // console.log("ERROR REASON ============== ",error_reason)
// console.log("REDUX SYSTEM NO ================== ",reduxSystemNo) // console.log("REDUX SYSTEM NO ================== ",reduxSystemNo)
const navigate = useNavigate() const navigate = useNavigate()
const [dataValue, setDataValue] = useState({}); const [dataValue, setDataValue] = useState({});
const [isLoading, setIsLoading] = useState(false); 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 [keys, setKeys] = useState([]);
const [values, setValues] = useState([]); const [values, setValues] = useState([]);
// console.log("image column ====== ", s3_image_column); // console.log("image column ====== ", s3_image_column);
@ -175,7 +179,7 @@ const QueryExecutorCard = ({ data, s3_image_column, query, error, error_reason,
<> <>
<Button <Button
className="w-50 m-0 bg-primary text-white p-1 rounded" 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}&degreeType=${degreeType}`)} onClick={() => navigate(`/sections/${year}/sqlPlayground/edit?image_name=${data["image_name"]}&error=${error}&error_reason=${error_reason}&sysNo=${reduxSystemNo}&degreeType=${degreeType}`)}
> >
Edit Edit
</Button> </Button>
@ -207,7 +211,7 @@ const QueryExecutorCard = ({ data, s3_image_column, query, error, error_reason,
)} )}
<Button className="bg-primary"> <Button className="bg-primary">
<a <a
href={`https://docs.exampaper.vidh.ai/${data[s3_image_column]}`} href={`${imageDomain}/${data[s3_image_column]}`}
> >
<DownloadIcon className="text-light text-white" /> <DownloadIcon className="text-light text-white" />
</a> </a>
@ -215,7 +219,7 @@ const QueryExecutorCard = ({ data, s3_image_column, query, error, error_reason,
</Box> </Box>
<Box className="border border-dark"> <Box className="border border-dark">
<img <img
src={`https://docs.exampaper.vidh.ai/${data[s3_image_column]}`} src={`${imageDomain}/${data[s3_image_column]}`}
width="800px" width="800px"
height="auto" height="auto"
alt="Image Alt" alt="Image Alt"

View File

@ -28,7 +28,7 @@ const SystemNumberDialog = (setShowSystemNoContainer,showSystemNoContainer) => {
const handleSubmit = () => { const handleSubmit = () => {
console.log("Handling submit") console.log("Handling submit")
dispatch(updateSystemNo(systemNo)); dispatch(updateSystemNo(systemNo));
navigate("/") // navigate("/")
handleClose(true) handleClose(true)
}; };

View File

@ -4,7 +4,7 @@ import React from "react";
const TextInputField = React.forwardRef( const TextInputField = React.forwardRef(
({ placeholder, value, setValue, onKeyDown }, ref) => { ({ placeholder, value, setValue, onKeyDown }, ref) => {
return ( return (
<Box className="d-flex flex-column py-3"> <Box className="d-flex flex-column py-2">
<label htmlFor="limit-input" className="text-left"> <label htmlFor="limit-input" className="text-left">
{placeholder} :- {placeholder} :-
</label> </label>

View File

@ -38,6 +38,12 @@ const UpdatedPlaygroundUpdater = ({
// console.log("REDUX SYSTEM NO ================== ",reduxSystemNo) // console.log("REDUX SYSTEM NO ================== ",reduxSystemNo)
const navigate = useNavigate(); const navigate = useNavigate();
const { year } = useParams(); 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 [dataValue, setDataValue] = useState({});
const [isLoading, setIsLoading] = useState(false); const [isLoading, setIsLoading] = useState(false);
// console.log("data in query executor Card : ", data); // console.log("data in query executor Card : ", data);
@ -47,6 +53,9 @@ const UpdatedPlaygroundUpdater = ({
const [imageName, setImageName] = useState(null); const [imageName, setImageName] = useState(null);
const [tableNameData, setTableNameData] = useState(null); const [tableNameData, setTableNameData] = useState(null);
const imageEleRef = useRef(); const imageEleRef = useRef();
const subjectCodeInputEleRef = useRef();
const registerNumberInputEleRef = useRef();
const [showEditContainer, setShowEditContainer] = useState(false); const [showEditContainer, setShowEditContainer] = useState(false);
const [editorType, setEditorType] = useState(null); const [editorType, setEditorType] = useState(null);
const dialogText = "This is dialog text"; const dialogText = "This is dialog text";
@ -88,6 +97,32 @@ const UpdatedPlaygroundUpdater = ({
console.log("the currect editor type: ", type); console.log("the currect editor type: ", type);
}, [data]); }, [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(() => { // useEffect(() => {
// console.log("barcode in use effect ==== ", barcode); // console.log("barcode in use effect ==== ", barcode);
// }, [barcode]); // }, [barcode]);
@ -424,7 +459,7 @@ const UpdatedPlaygroundUpdater = ({
registerNumber, registerNumber,
imageName, imageName,
rotateAngle, rotateAngle,
year year,
}; };
const response = await fetch( const response = await fetch(
`${import.meta.env.VITE_REACT_APP_BACKEND_URL}/editPartAdata`, `${import.meta.env.VITE_REACT_APP_BACKEND_URL}/editPartAdata`,
@ -586,7 +621,7 @@ const UpdatedPlaygroundUpdater = ({
</Box> </Box>
<Box className="border border-dark" id={imageName}> <Box className="border border-dark" id={imageName}>
<img <img
src={`https://docs.exampaper.vidh.ai/${oldData[s3_image_column]}`} src={`${imageDomain}/${oldData[s3_image_column]}`}
width="850px" width="850px"
height="auto" height="auto"
alt="Image Alt" alt="Image Alt"
@ -657,6 +692,8 @@ const UpdatedPlaygroundUpdater = ({
value={subjectCode || ""} value={subjectCode || ""}
setValue={setSubjectCode} setValue={setSubjectCode}
placeholder={"Subject code"} placeholder={"Subject code"}
ref={subjectCodeInputEleRef}
onKeyDown={handleKeyDown}
/> />
</> </>
) : ( ) : (
@ -670,6 +707,8 @@ const UpdatedPlaygroundUpdater = ({
value={subjectCode} value={subjectCode}
setValue={setSubjectCode} setValue={setSubjectCode}
placeholder={"Subject Code"} placeholder={"Subject Code"}
ref={subjectCodeInputEleRef}
onKeyDown={handleKeyDown}
/> />
<TextInputField <TextInputField
value={totalStudents} value={totalStudents}
@ -701,6 +740,8 @@ const UpdatedPlaygroundUpdater = ({
value={registerNumber || ""} value={registerNumber || ""}
setValue={setRegisterNumber} setValue={setRegisterNumber}
placeholder={"Register no"} placeholder={"Register no"}
ref={registerNumberInputEleRef}
onKeyDown={handleKeyDown}
/> />
) : null} ) : null}
<Box display="flex" justifyContent="space-between"> <Box display="flex" justifyContent="space-between">

File diff suppressed because one or more lines are too long

Binary file not shown.