parent
3a7f53ca9b
commit
bed10f4245
16 changed files with 1562 additions and 1003 deletions
@ -0,0 +1,21 @@ |
||||
|
||||
|
||||
import proxy from "../proxy"; |
||||
|
||||
|
||||
const examGroup = { |
||||
info: |
||||
(data = {}) => |
||||
async (dispatch) => |
||||
await proxy.get("examGroup/info", data, { dispatch }), |
||||
list: |
||||
(data = {}) => |
||||
async (dispatch) => |
||||
await proxy.get("examGroup/list", data, { dispatch }), |
||||
add: |
||||
(data = {}) => |
||||
async (dispatch) => |
||||
await proxy.post("examGroup/add", data, { dispatch }), |
||||
}; |
||||
|
||||
export default examGroup; |
@ -0,0 +1,23 @@ |
||||
|
||||
|
||||
import proxy from "../proxy"; |
||||
const lesson = { |
||||
info: |
||||
(data = {}) => |
||||
async (dispatch) => |
||||
await proxy.get("lesson/info", data, { dispatch }), |
||||
list: |
||||
(data = {}) => |
||||
async (dispatch) => |
||||
await proxy.get("lesson/list", data, { dispatch }), |
||||
add: |
||||
(data = {}) => |
||||
async (dispatch) => |
||||
await proxy.post("lesson/add", data, { dispatch }), |
||||
delete: |
||||
(data = {}) => |
||||
async (dispatch) => |
||||
await proxy.delete("lesson/delete", data, { dispatch }), |
||||
}; |
||||
|
||||
export default lesson; |
@ -0,0 +1,24 @@ |
||||
|
||||
|
||||
|
||||
import { toast } from "react-toastify"; |
||||
|
||||
const initialState = { |
||||
loading: false, |
||||
error: null, |
||||
info: null, |
||||
list:null |
||||
}; |
||||
export default function examGroup(state = initialState, action) { |
||||
let { type, data } = action; |
||||
switch (type) { |
||||
case "examGroup/info": |
||||
return { ...state, loading: false, info: data, error: null }; |
||||
case "examGroup/add": |
||||
return { ...state, loading: false, error: null }; |
||||
case "examGroup/list": |
||||
return { ...state, loading: false, error: null,list:data }; |
||||
default: |
||||
return state; |
||||
} |
||||
} |
@ -0,0 +1,24 @@ |
||||
|
||||
|
||||
|
||||
import { toast } from "react-toastify"; |
||||
|
||||
const initialState = { |
||||
loading: false, |
||||
error: null, |
||||
info: null, |
||||
list: null, |
||||
}; |
||||
export default function lesson(state = initialState, action) { |
||||
let { type, data } = action; |
||||
switch (type) { |
||||
case "lesson/info": |
||||
return { ...state, loading: false, info: data, error: null }; |
||||
case "lesson/add": |
||||
return { ...state, loading: false, error: null }; |
||||
case "lesson/list": |
||||
return { ...state, loading: false, error: null, list: data }; |
||||
default: |
||||
return state; |
||||
} |
||||
} |
@ -1,57 +1,103 @@ |
||||
import React from "react"; |
||||
|
||||
const AddQuestionnaireCourse = ({submitOnClick, nameOnChange, questionStart, questionEnd, coefficientOnChange, closeOnClick}) => { |
||||
return( |
||||
<div className="w-full z-10 fixed h-screen backdrop-blur flex items-center -mt-10 justify-center"> |
||||
<div className="w-1/2 bg-white rounded-xl flex flex-col shadow-lg p-6"> |
||||
<div className="w-full"> |
||||
<div className="w-8 h-8 text-white text-sm rounded-full cursor-pointer flex justify-center items-center bg-red52" onClick={closeOnClick}> |
||||
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 15.044 15.044"> |
||||
<g id="vuesax_linear_card-remove" data-name="vuesax/linear/card-remove" transform="translate(-252.46 -511.461)"> |
||||
<g id="card-remove" transform="translate(253.309 512.31)"> |
||||
<path id="Vector" d="M0,13.347,13.347,0" fill="none" stroke="#fff" strokeLinecap="round" strokeWidth="2" /> |
||||
<path id="Vector-2" data-name="Vector" d="M13.347,13.347,0,0" fill="none" stroke="#fff" strokeLinecap="round" strokeWidth="2" /> |
||||
</g> |
||||
</g> |
||||
</svg> |
||||
</div> |
||||
</div> |
||||
<h1 className="w-full text-right text-lg text-red52 font-bold pt-4"> |
||||
افزودن درس |
||||
</h1> |
||||
<div className="w-full flex items-center flex-col mt-6 px-2 "> |
||||
<div className="flex justify-between w-full"> |
||||
<input type='text' placeholder="نام درس..." className="w-4/5 p-4 ml-2 rounded border border-red52 h-12 text-red26 outline-none"
|
||||
onChange={nameOnChange}
|
||||
/> |
||||
<input type='number' placeholder="از سوال..." className="w-2/5 p-4 ml-2 rounded border border-red52 h-12 text-red26 outline-none"
|
||||
onChange={questionStart}
|
||||
/> |
||||
<input type='number' placeholder="تا سوال..." className="w-2/5 p-4 ml-2 rounded border border-red52 h-12 text-red26 outline-none"
|
||||
onChange={questionEnd}
|
||||
/> |
||||
<input type='number' placeholder="ضریب ..." className="w-4/5 p-4 ml-2 rounded border border-red52 h-12 text-red26 outline-none"
|
||||
onChange={coefficientOnChange}
|
||||
/> |
||||
<input type='number' placeholder="تعداد گزینه" className="w-4/5 p-4 ml-2 rounded border border-red52 h-12 text-red26 outline-none"
|
||||
// onChange={}
|
||||
/> |
||||
|
||||
</div> |
||||
<div className="flex w-full justify-end pt-4"> |
||||
<button className="px-6 py-2 rounded-md bg-red52 text-white font-bold" |
||||
onClick={submitOnClick} |
||||
> |
||||
تایید |
||||
</button> |
||||
</div> |
||||
const AddQuestionnaireCourse = ({ |
||||
submitOnClick, |
||||
nameOnChange, |
||||
questionStart, |
||||
questionEnd, |
||||
coefficientOnChange, |
||||
closeOnClick, |
||||
}) => { |
||||
return ( |
||||
<div className="w-full z-10 fixed h-screen backdrop-blur flex items-center -mt-10 justify-center"> |
||||
<div className="w-1/2 bg-white rounded-xl flex flex-col shadow-lg p-6"> |
||||
<div className="w-full"> |
||||
<div |
||||
className="w-8 h-8 text-white text-sm rounded-full cursor-pointer flex justify-center items-center bg-red52" |
||||
onClick={closeOnClick} |
||||
> |
||||
<svg |
||||
xmlns="http://www.w3.org/2000/svg" |
||||
width="12" |
||||
height="12" |
||||
viewBox="0 0 15.044 15.044" |
||||
> |
||||
<g |
||||
id="vuesax_linear_card-remove" |
||||
data-name="vuesax/linear/card-remove" |
||||
transform="translate(-252.46 -511.461)" |
||||
> |
||||
<g id="card-remove" transform="translate(253.309 512.31)"> |
||||
<path |
||||
id="Vector" |
||||
d="M0,13.347,13.347,0" |
||||
fill="none" |
||||
stroke="#fff" |
||||
strokeLinecap="round" |
||||
strokeWidth="2" |
||||
/> |
||||
<path |
||||
id="Vector-2" |
||||
data-name="Vector" |
||||
d="M13.347,13.347,0,0" |
||||
fill="none" |
||||
stroke="#fff" |
||||
strokeLinecap="round" |
||||
strokeWidth="2" |
||||
/> |
||||
</g> |
||||
</g> |
||||
</svg> |
||||
</div> |
||||
</div> |
||||
<h1 className="w-full text-right text-lg text-red52 font-bold pt-4"> |
||||
افزودن درس |
||||
</h1> |
||||
<div className="w-full flex items-center flex-col mt-6 px-2 "> |
||||
<div className="flex justify-between w-full"> |
||||
<input |
||||
type="text" |
||||
placeholder="نام درس..." |
||||
className="w-4/5 p-4 ml-2 rounded border border-red52 h-12 text-red26 outline-none" |
||||
onChange={nameOnChange} |
||||
/> |
||||
<input |
||||
type="number" |
||||
placeholder="از سوال..." |
||||
className="w-2/5 p-4 ml-2 rounded border border-red52 h-12 text-red26 outline-none" |
||||
onChange={questionStart} |
||||
/> |
||||
<input |
||||
type="number" |
||||
placeholder="تا سوال..." |
||||
className="w-2/5 p-4 ml-2 rounded border border-red52 h-12 text-red26 outline-none" |
||||
onChange={questionEnd} |
||||
/> |
||||
<input |
||||
type="number" |
||||
placeholder="ضریب ..." |
||||
className="w-4/5 p-4 ml-2 rounded border border-red52 h-12 text-red26 outline-none" |
||||
onChange={coefficientOnChange} |
||||
/> |
||||
<input |
||||
type="number" |
||||
placeholder="تعداد گزینه" |
||||
className="w-4/5 p-4 ml-2 rounded border border-red52 h-12 text-red26 outline-none" |
||||
// onChange={}
|
||||
/> |
||||
</div> |
||||
<div className="flex w-full justify-end pt-4"> |
||||
<button |
||||
className="px-6 py-2 rounded-md bg-red52 text-white font-bold" |
||||
onClick={submitOnClick} |
||||
> |
||||
تایید |
||||
</button> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
); |
||||
}; |
||||
|
||||
|
||||
|
||||
</div> |
||||
</div> |
||||
</div> |
||||
) |
||||
} |
||||
|
||||
export default AddQuestionnaireCourse; |
||||
export default AddQuestionnaireCourse; |
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue