diff --git a/vercel/.gitignore b/vercel/.gitignore
new file mode 100644
index 000000000..8460eeaf7
--- /dev/null
+++ b/vercel/.gitignore
@@ -0,0 +1,38 @@
+# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
+
+# dependencies
+/node_modules
+/.pnp
+.pnp.js
+.yarn/install-state.gz
+
+# testing
+/coverage
+
+# next.js
+/.next/
+/out/
+
+# production
+/build
+
+# misc
+.DS_Store
+*.pem
+
+# debug
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+# local env files
+.env*.local
+
+# vercel
+.vercel
+
+# typescript
+*.tsbuildinfo
+next-env.d.ts
+
+.vercel
diff --git a/vercel/README.md b/vercel/README.md
deleted file mode 100644
index 8c0dca39c..000000000
--- a/vercel/README.md
+++ /dev/null
@@ -1,52 +0,0 @@
-# 42 Project Evaluation Sheets Hub π―
-
-Welcome to the heart of self-evaluation for 42 School projects! π Whether you're gearing up for a peer-evaluation or refining your code masterpiece, these sheets offer a sneak peek into the evaluation process, setting you up for success. π
-
-Dive into my meticulously curated evaluation sheets, sourced directly from the official 42 School, and fine-tune your projects to ace that evaluation. For the most immersive experience, check out the [42-Evals Web Page](https://42evals.com) - your digital companion for project assessments, updated regularly for seamless access. π₯οΈβ¨
-
-## Contributing to Excellence π€
-
-Your insight and expertise can help countless peers! If you've got an evaluation sheet that could illuminate the path to project perfection, here's how to share that beacon of knowledge:
-
-1. Fork the repository.
-2. Clone your fork and embark on your contribution journey.
-3. Add new enlightenment or polish existing treasures.
-4. Commit your wisdom with a meaningful message.
-5. Push your contributions upstream.
-6. Open a pull request to merge your light into the main beacon.
-
-## Navigating the Sheets πΊοΈ
-
-Each sheet is a roadmap to understanding the intricate expectations of each project. Use them to self-evaluate, discover areas for improvement, and prepare for the peer-evaluation journey that awaits. Review, reflect, and resonate with the criteria that define project success.
-
-## Your Voice Matters π’
-
-I'm in a constant state of learning and improvement, much like the code I write. If you've got ideas, feedback, or enhancements, I'm all ears. Open an issue, submit a pull request, or simply share your thoughts. Together, we grow.
-
-## Important Notes π‘οΈ
-
-### Security and Data Protection
-Please note that the evaluation sheets are no longer hosted on GitHub but on a secure, separate server. This change has been made to protect the image rights of 42 Network and ensure the confidentiality of all data. Only authorized individuals can access and contribute to the sheets, safeguarding the integrity and privacy of the information.
-
-### Platform Usage
-42Evals is intended as a **supplementary tool** and should not be used as an official source for project evaluations. It provides students with an opportunity to verify their projects before official submission, but the accuracy of the data cannot be guaranteed. This platform is designed to assist, not to replace, the official evaluation processes at 42 School.
-
-Funny Stats π
-
- **Last stargazer:**
-
-
- [![Last Stargazer](https://avatars.githubusercontent.com/u/110629446?v=4&s=250)](https://github.com/LipschitzIsSoEasy)
-
-
- Thanks to [LipschitzIsSoEasy](https://github.com/LipschitzIsSoEasy) for starring the repository! π
-
- **Updates occur hourly. Last update :** 09.08.2024, 18:15:09 (CET)
-
- [![Star History Chart](https://api.star-history.com/svg?repos=rphlr/42-Evals&type=Date)](https://star-history.com/#rphlr/42-Evals&Date)
-
- More stats are coming soon! π€
-
----
-
-Remember to give a star β to my repository if it helps you navigate the challenges of 42 School projects. Your support amplifies my reach and aids fellow students in finding this repository with ease. Happy coding, and may your evaluations be ever in your favor! π
\ No newline at end of file
diff --git a/vercel/app/admin/add/page.jsx b/vercel/app/admin/add/page.jsx
index ee9e3a00c..e3445a01f 100644
--- a/vercel/app/admin/add/page.jsx
+++ b/vercel/app/admin/add/page.jsx
@@ -4,9 +4,6 @@ import Link from 'next/link';
import React, { useEffect, useState, useRef } from 'react'
import { useForm } from 'react-hook-form';
import Swal from 'sweetalert2';
-// import JoditEditor from 'jodit-react';
-
-
function page() {
@@ -35,25 +32,6 @@ function page() {
- // JODIT TEXT EDITOR FOR MANDATORY SECTION PART
-
- // const editor = useRef(null);
- // const [mandatorySectionRichText, setMandatorySectionRichText] = useState('')
-
- // const config = useMemo(() => ({
- // readonly: false
- // }), [])
-
- // const config = {
- // readonly: false
- // }
-
- // const handleMandatorySectionRichText = (content) => {
- // setMandatorySectionRichText(content)
- // }
-
-
-
@@ -97,30 +75,89 @@ function page() {
// Handle mandatory options
- const [mandatoryOptionsData, setMandatoryOptionsData] = useState([])
+ // const [mandatoryOptionsData, setMandatoryOptionsData] = useState([])
- const handleTitle = (e) => {
- const title = e.target.value
- setMandatoryOptionsData({ ...mandatoryOptionsData, title })
+ // const handleTitle = (e) => {
+ // const title = e.target.value
+ // setMandatoryOptionsData({ ...mandatoryOptionsData, title })
+ // }
+
+ const [numberOfMandatorySections, setNumberOfMandatorySections] = useState(1)
+
+ const addMandatorySection = () => {
+ setNumberOfMandatorySections(numberOfMandatorySections + 1)
}
+ const removeMandatorySection = () => {
+ setNumberOfMandatorySections(numberOfMandatorySections - 1)
+ }
+
+
+
+ // handle title
+
+ // const handleTitle = (e) => {
+ // const title = e.target.value
+ // setMandatoryOptionsData({ ...mandatoryOptionsData, title })
+ // }
+
+
// handle description (separate each guideline with a new line and arrange them in an array)
- const handleDescription = (e) => {
- // take the splitted guidelines from guidelines and create an array of guidelines
- const descriptionArray = []
- const description = e.target.value.split('\n')
+ // const handleDescription = (e) => {
+ // // take the splitted guidelines from guidelines and create an array of guidelines
+ // const descriptionArray = []
+ // const description = e.target.value.split('\n')
+
+ // description.map(desc => {
+ // descriptionArray.push(desc)
+ // })
+ // setMandatoryOptionsData({ ...mandatoryOptionsData, description: descriptionArray })
+ // }
+
+ // const handleYesNo = (e) => {
+ // const yes_no = e.target.value
+ // setMandatoryOptionsData({ ...mandatoryOptionsData, yes_no })
+ // }
+
+
+ // create an array of mandatory options data and push them to the mandatoryOptionsData state
+ // data is coming from the form
+
+ // const handleMandatoryOptions = (data) => {
+ // const mandatoryOptions = []
+
+ // for (let i = 0; i < numberOfMandatorySections; i++) {
+ // mandatoryOptions.push({
+ // title: data.title,
+ // description: data.description,
+ // yes_no: data.yes_no
+ // })
+ // }
+
+ // setMandatoryOptionsData(mandatoryOptions)
+ // }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- description.map(desc => {
- descriptionArray.push(desc)
- })
- setMandatoryOptionsData({ ...mandatoryOptionsData, description: descriptionArray })
- }
- const handleYesNo = (e) => {
- const yes_no = e.target.value
- setMandatoryOptionsData({ ...mandatoryOptionsData, yes_no })
- }
@@ -273,23 +310,42 @@ function page() {
const submitForm = (data) => {
+
+
const newData = {
optional_bonus_sections: data.optional_bonus_sections,
project_title: data.project_title,
introduction: introductionData,
attachments: [
- `${data.attachment1Title},${data.attachment1Url}`, `${data.attachment2Title},${data.attachment2Url}`, `${data.attachment3Title},${data.attachment3Url}`, `${data.attachment4Title},${data.attachment4Url}`
+ `${data.attachment1Title},${data.attachment1Url}`,
+ `${data.attachment2Title},${data.attachment2Url}`,
+ `${data.attachment3Title},${data.attachment3Url}`,
+ `${data.attachment4Title},${data.attachment4Url}`
],
guidelines: guidelinesData,
number_of_student: parseInt(data.number_of_student),
}
- const newMandatoryOptionsData = {
- title: mandatoryOptionsData.title,
- description: mandatoryOptionsData.description,
- yes_no: mandatoryOptionsData.yes_no === 'true' ? true : false
+ const newMandatoryOptionsData = []
+
+ // create an array of mandatory options data from title, description, yes_no array
+ // example from: title: ['title1', 'title2'], description: ['desc1', 'desc2'], yes_no: ['yes', 'no']
+ // to: [{title: 'title1', description: 'desc1', yes_no: 'yes'}, {title: 'title2', description: 'desc2', yes_no: 'no'}]
+
+ for (let i = 0; i < numberOfMandatorySections; i++) {
+ newMandatoryOptionsData.push({
+ title: data.title[i],
+ description: data.description[i],
+ yes_no: data.yes_no[i] === 'true' ? true : false
+ })
}
+
+
+
+
+
+
const newGradingOptionsData = {
ok: gradingOptionsData.ok === 'true' ? true : false,
outstanding: gradingOptionsData.outstanding === 'true' ? true : false,
@@ -569,78 +625,82 @@ function page() {
{/* mandatory options: data- title, description, yes_no */}