Skip to content

Commit

Permalink
Merge pull request #29 from avantifellows/SendingDataToDB
Browse files Browse the repository at this point in the history
SendingDataToDB
  • Loading branch information
suryabulusu authored Dec 22, 2023
2 parents 0e792ae + d4e6845 commit 4e5cc3b
Show file tree
Hide file tree
Showing 22 changed files with 621 additions and 108 deletions.
6 changes: 5 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
NEXT_PUBLIC_DB_URL = "https://localhost:3000"
AF_DB_URL =
AF_TOPIC_ARN =
AF_BEARER_TOKEN =
AF_ACCESS_KEY_ID =
AF_SECRET_ACCESS_KEY =
168 changes: 168 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"dependencies": {
"@heroicons/react": "^2.0.18",
"@types/react-select": "^5.0.1",
"aws-sdk": "^2.1512.0",
"axios": "^1.5.0",
"cross-env": "^7.0.3",
"eslint": "8.44.0",
Expand Down
14 changes: 7 additions & 7 deletions src/components/Options/StudentDetailsOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ export interface OptionType {
}

const ProgramOptions: OptionType[] = [
{ value: "Haryana Students", label: "Haryana Students" },
{ value: "Himachal Students", label: "Himachal Students" },
{ value: "Delhi Students", label: "Delhi Students" },
{ value: "Enable Students", label: "Enable Students" },
{ value: "AF Teachers", label: "AF Teachers" },
{ value: "HaryanaStudents", label: "Haryana Students" },
{ value: "HimachalStudents", label: "Himachal Students" },
{ value: "DelhiStudents", label: "Delhi Students" },
{ value: "EnableStudents", label: "Enable Students" },
{ value: "AFTeachers", label: "AF Teachers" },
{ value: "Candidates", label: "Candidates" },
{ value: "Gujarat Students", label: "Gujarat Students" },
{ value: "AF Testing", label: "AF Testing" },
{ value: "GujaratStudents", label: "Gujarat Students" },
{ value: "AFTesting", label: "AF Testing" },
];

const BatchOptions: OptionType[] = [
Expand Down
7 changes: 5 additions & 2 deletions src/components/Options/TestDetailsOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { OptionType } from "./StudentDetailsOptions";
const TestTypeOptions: OptionType[] = [
{ value: "assessment", label: "Assessment" },
{ value: "homework", label: "Homework" },
{ value: "omr_assessment", label: "Omr-Assessment" },
{ value: "omr-assessment", label: "Omr-Assessment" },
];

const TestFormatOptions: OptionType[] = [
Expand All @@ -25,7 +25,10 @@ const TestPurposeOptions: OptionType[] = [
{ value: "one_time_test", label: "One Time Test" },
];

const TestPlatformOptions = [{ value: "Quiz", label: "Quiz" }];
const TestPlatformOptions = [
{ value: "quiz", label: "Quiz" },
{ value: "meet", label: "Live Class" },
];

const MarkingSchemeOptions: OptionType[] = [
{ value: "4,-1", label: "4 , -1" },
Expand Down
6 changes: 3 additions & 3 deletions src/components/Steps/Form/SelectField.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import styles from "@/styles/Home.module.css";
import { MyForm, MyFormKey } from "@/types/FormTypes";
import { QuizCreatorForm, QuizCreatorFormKey } from "@/types/FormTypes";
import { OptionType } from "@/types/types";
import { Control, Controller } from "react-hook-form";
import Select from "react-select";
interface SelectFieldProps {
control: Control<MyForm, any>;
control: Control<QuizCreatorForm, any>;
options: OptionType[];
name_: MyFormKey;
name_: QuizCreatorFormKey;
placeholder?: string;
}

Expand Down
6 changes: 3 additions & 3 deletions src/components/Steps/StudentDetails.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Step } from "@/pages/SessionCreator";
import styles from "@/styles/Home.module.css";
import { MyForm } from "@/types/FormTypes";
import { QuizCreatorForm } from "@/types/FormTypes";
import { ActiveFormProps } from "@/types/types";
import { SubmitHandler, useForm } from "react-hook-form";
import {
Expand All @@ -17,11 +17,11 @@ export default function StudentDetails({
setActiveStep,
setData,
}: ActiveFormProps) {
const { register, handleSubmit, control } = useForm<MyForm>({
const { register, handleSubmit, control } = useForm<QuizCreatorForm>({
defaultValues: { ...data.student },
});

const onSubmit: SubmitHandler<MyForm> = (student) => {
const onSubmit: SubmitHandler<QuizCreatorForm> = (student) => {
setData((prevData) => ({ ...prevData, student }));

setActiveStep(Step.TEST_DETAILS);
Expand Down
Loading

0 comments on commit 4e5cc3b

Please sign in to comment.