You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

56 lines
1.6 KiB

import moment from "jalali-moment";
import React, { useEffect, useState } from "react";
import { connect } from "react-redux";
import AnswerSheet from "../../../components/AnswerSheet";
import Button from "../../../components/Button";
import DatePicker from "../../../components/Calendar/CalendarComponents/DatePicker";
import Checkbox from "../../../components/Checkbox";
import RangeDatePicker from "../../../components/RangeDatePicker";
import SelectedCourse from "../../../components/selectedCourse";
import { exam, lesson } from "../../../redux/actions";
import AddQuestionnaireCourse from "../components/addQuestionnaireCourse";
import AddQuestionnaireExam from "./addQuestionnaireExam";
import AddQuestionsFromBank from "./AddQuestionsFromBank";
const AddQuestions = ({
addExamState,
stepClick,
backStep,
getLesson,
lessonList,
addLesson,
lastAdd,
parentAdd,
}) => {
useEffect(() => {
getLesson();
}, [lastAdd]);
return addExamState.type == 2 ? (
<AddQuestionnaireExam stepClick={stepClick} backStep={backStep} />
) : (
<AddQuestionsFromBank
stepClick={stepClick}
backStep={backStep}
lessonList={lessonList}
addLesson={addLesson}
/>
);
};
const mapStateToProps = (state) => ({
grades: state.publicApi.grades,
addExamState: state.addExamReduser,
lessonList: state.lesson.list,
lastAdd: state.lesson.lastAdd,
});
const mapDispatchToProps = {
getLesson: lesson.list,
addLesson: lesson.add,
parentAdd: exam.parentAdd,
};
export default connect(mapStateToProps, mapDispatchToProps)(AddQuestions);