|
|
|
@ -179,27 +179,28 @@ const AddQuestionsFromBank = ({ grades, addExamState, dispatch, stepClick, backS |
|
|
|
|
<div className="w-full flex px-10"> |
|
|
|
|
|
|
|
|
|
<div className="w-1/2 border-l flex flex-col border-gray-300 py-10"> |
|
|
|
|
{/* { |
|
|
|
|
selectedQuestionare.id !== null && (<> |
|
|
|
|
{ |
|
|
|
|
selectedCourse.id !== null && (<> |
|
|
|
|
<h1 className="text-blue3A w-full font-bold text-lg text-right"> |
|
|
|
|
دفترچه {selectedQuestionare.name} |
|
|
|
|
{selectedCourse.title} |
|
|
|
|
</h1> |
|
|
|
|
<div className="flex flex-col items-center overflow-x-hidden overflow-scroll" style={{height: '500px'}}> |
|
|
|
|
<div className="w-4/5 "> |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
addExamState.questionairesCourses.filter(itm => itm.questionnaireId == selectedQuestionare.id).map( |
|
|
|
|
addExamState.questions.filter(itm => itm.courseId == selectedCourse.id).map( |
|
|
|
|
(item) => ( |
|
|
|
|
<SelectedCourse title={item.name} coefficient={item.coefficient} questionQuantity={item.questionsQuantity}
|
|
|
|
|
onClick={() => {setSelectedCourse(item); console.log(selectedCourse)}}/> |
|
|
|
|
<Question data={item} /> |
|
|
|
|
|
|
|
|
|
) |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
</>) |
|
|
|
|
} |
|
|
|
|
{selectedQuestionare.id !== null && |
|
|
|
|
{/* {selectedQuestionare.id !== null && |
|
|
|
|
<div className="w-full flex justify-center mt-10"> |
|
|
|
|
<button className=" bg-gray-300 text-xl text-gray-500 border-gray-500 w-1/3 h-12 rounded-xl border" onClick={() => setAddCoursePopup(true)}> |
|
|
|
|
افزودن درس |
|
|
|
@ -212,7 +213,28 @@ const AddQuestionsFromBank = ({ grades, addExamState, dispatch, stepClick, backS |
|
|
|
|
passAnswers={data => {setAnswers(data); setFakeState(fakeState - 2)}}/> */} |
|
|
|
|
{selectedCourse.id !== null && |
|
|
|
|
addExamState.questionBank.filter(itm => itm.courseId == selectedCourse.id).map( |
|
|
|
|
(course) => (<Question data={course} />) |
|
|
|
|
(course , index) => ( |
|
|
|
|
|
|
|
|
|
<div className="flex items-start justify-between w-full"> |
|
|
|
|
<Checkbox name={`PICK_QUESTIONS_${index}_${course.courseId}`} |
|
|
|
|
onChange={(e) => |
|
|
|
|
e.target.checked ? |
|
|
|
|
dispatch({ type: 'ADD_EXAM_QUESTIONS', payload: course }) |
|
|
|
|
// console.log('asodjasd')
|
|
|
|
|
: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dispatch({ type: 'REMOVE_EXAM_QUESTIONS', payload: course }) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/> |
|
|
|
|
{/* <button onClick={() => dispatch({ type: 'ADD_EXAM_QUESTIONS', payload: course })}>ادد کردن</button> */} |
|
|
|
|
|
|
|
|
|
<Question data={course} /> |
|
|
|
|
</div> |
|
|
|
|
) |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
{/* <Question /> */} |
|
|
|
|