diff --git a/client/src/components/Assignment/Content.tsx b/client/src/components/Assignment/Content.tsx index 4a4fbc3..bfa2bc3 100644 --- a/client/src/components/Assignment/Content.tsx +++ b/client/src/components/Assignment/Content.tsx @@ -100,6 +100,7 @@ const Content = () => { setId(id); const req = await fetch(`/api/subscribe?id=${id}`); const resp = await req.json(); + console.log("getting markdown") console.log(resp); setIsPreviewAssignmentVisible(true); } catch (error) { diff --git a/client/src/pages/api/subscribe.ts b/client/src/pages/api/subscribe.ts index dd025f7..ba0f378 100644 --- a/client/src/pages/api/subscribe.ts +++ b/client/src/pages/api/subscribe.ts @@ -37,6 +37,7 @@ export default async function handler(req:any, res:any) { try { const data = await subscriptionPromise; + console.log(data); res.status(200).json(data); } catch (error) { res.status(500).json({ error: "Assignment not generated" }); diff --git a/client/src/providers/AssignmentProvider.tsx b/client/src/providers/AssignmentProvider.tsx index 31ffe74..8b608d7 100644 --- a/client/src/providers/AssignmentProvider.tsx +++ b/client/src/providers/AssignmentProvider.tsx @@ -37,6 +37,8 @@ interface AssignmentContextProps { "descriptive-type": number[]; "numerical-type": number[]; }>>; + markdown: string|null; + setMarkdown:(markdown:string)=>void; } const AssignmentContext = createContext({ @@ -67,6 +69,8 @@ const AssignmentContext = createContext({ "numerical-type": [0, 0], }, setTypesOfQuestions: () => {}, + markdown:null, + setMarkdown:()=>{}, }); const AssignmentProvider: React.FC = ({ @@ -99,6 +103,7 @@ const AssignmentProvider: React.FC = ({ "descriptive-type": [0, 0], "numerical-type": [0, 0], }); + const [markdown,setMarkdown] = useState(null); const modifyTypesOfQuestions = ( type: keyof typeof typesOfQuestions, @@ -136,6 +141,8 @@ const AssignmentProvider: React.FC = ({ setIsEnabledPlagriasmChecker, typesOfQuestions, setTypesOfQuestions, + markdown, + setMarkdown }} > {children}