Compare commits

...

10 Commits

14 changed files with 101 additions and 34 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 KiB

View File

@ -22,7 +22,9 @@ import StudentProgress from './manage_progress/views/StudentProgress';
import ClassProgress from './manage_progress/views/ClassProgress';
import ManageReports from './manage_reports/views/ManageReports';
import Setting from './setting/views/Setting';
import '../../assets/styles/admin.css'
import Review from '../user/review/views/Review';
import '../../assets/styles/admin.css';
import ProtectedRoute from '../../utils/ProtectedRoute';
@ -52,6 +54,9 @@ const AdminRoutes = () => {
<Route path="learning-progress/c/:progressId" element={<ClassProgress />} />
<Route path="report" element={<ManageReports />} />
<Route path="profile" element={<Setting />} />
<Route path="review/s/:stdLearning" element={<Review />} />
</Route>
{/* <Route path="*" element={<NotFound/>} />

View File

@ -46,7 +46,7 @@ const AdminDashboard = () => {
<Table hover>
<thead>
<tr>
<th>Full Name</th>
<th className='text-start'>Full Name</th>
<th className='text-center'>Class</th>
<th>Topic</th>
<th>Level</th>
@ -70,13 +70,13 @@ const AdminDashboard = () => {
activity.length > 0?(
activity.map((data, index) => (
<tr key={index}>
<td>{data.NAME_USERS}</td>
<td className='text-start'>{data.NAME_USERS}</td>
<td className='text-center'>{data.NAME_CLASS ? data.NAME_CLASS : '-'}</td>
<td>{data.NAME_TOPIC}</td>
<td>{data.NAME_LEVEL}</td>
<td className='text-center'>{data.SCORE}</td>
<td className='text-center action-col'>
<Link className='btn btn-sm btn-view' to={`s/${data.ID_STUDENT_LEARNING}`}><i className="bi bi-eye"></i></Link>
<Link className='btn btn-sm btn-view' to={`/admin/review/s/${data.ID_STUDENT_LEARNING}`}><i className="bi bi-eye"></i></Link>
</td>
</tr>
))

View File

@ -66,7 +66,7 @@ const UpdateExercises = () => {
</Button>
<Breadcrumb className='custom-breadcrumb'>
<Breadcrumb.Item href="#">Learning</Breadcrumb.Item>
<Breadcrumb.Item href="/admin/material" className='text-capitalize'>Exercise</Breadcrumb.Item>
<Breadcrumb.Item href="/admin/exercise" className='text-capitalize'>Exercise</Breadcrumb.Item>
<Breadcrumb.Item active>Update Exercise</Breadcrumb.Item>
</Breadcrumb>
</Col>

View File

@ -183,11 +183,11 @@ const ManageProgress = () => {
<Card.Text className='mb-4 fs-14p'>
{data.STUDENTS < data.TOTAL_STUDENT?(
<>
<span className='fw-bold'>{data.STUDENTS} </span>
out of {data.TOTAL_STUDENT} students
<span className='fw-bold'>{data.STUDENTS} </span>
out of {data.TOTAL_STUDENT} students
</>
):(
`${data.TOTAL_STUDENT} students`
`${data.STUDENTS} students`
)}
</Card.Text>
{/* <Button as={Link} to={`c/${data.ID_CLASS}`} variant="warning" className='py-2 w-100 rounded-35'>See Details</Button> */}

View File

@ -9,6 +9,10 @@ import Feature2 from '../../../../assets/images/feature2.png';
import Feature3 from '../../../../assets/images/feature3.png';
import Feature4 from '../../../../assets/images/feature4.png';
import logo from '../../../../assets/images/logo-w.png'
import polinema from '../../../../assets/images/logo-polinema.png'
import pis from '../../../../assets/images/logo-pis.png'
const Home = () => {
return (
<div className='bg-white landing-page'>
@ -110,7 +114,7 @@ const Home = () => {
</Col>
<Col md={6} className='col-12'>
<h1 className='fw-bold'>What Will You <span className='text-blue'>Get </span>?</h1>
<p className='text-secondary'>In sem orci feugiat nibh. Rhoncus sit integer sed sit pla feugiat elementum suscipit ac ut rhoncus sit.</p>
<p className='text-secondary'>Reach your full potential with smart adaptive learning. Get better learning outcomes and boost your confidence.</p>
<div className="p-3 mb-3 rounded-3 shadow shadow-sm d-flex">
<div className='me-3'>
<div className="bg-blue ratio-1 rounded-3 d-flex items-center" style={{width:"40px",height:"40px"}}>
@ -118,8 +122,8 @@ const Home = () => {
</div>
</div>
<div>
<h6>Feugiat varius imperdiet ultrices pretium.</h6>
<p className='text-secondary fs-7 m-0'>Arcu venenatis iaculis et arcu quis sed. Sed sollicitudin nulla sagittis id et diam lobortis</p>
<h6>Personalized Learning.</h6>
<p className='text-secondary fs-7 m-0'>Learning materials will automatically adjust to your level of understanding, so you won't feel too easy or too difficult.</p>
</div>
</div>
<div className="p-3 mb-3 rounded-3 shadow shadow-sm d-flex">
@ -129,8 +133,8 @@ const Home = () => {
</div>
</div>
<div>
<h6>Feugiat varius imperdiet ultrices pretium.</h6>
<p className='text-secondary fs-7 m-0'>Arcu venenatis iaculis et arcu quis sed. Sed sollicitudin nulla sagittis id et diam lobortis</p>
<h6>Time Efficiency.</h6>
<p className='text-secondary fs-7 m-0'>Learn faster and more effectively by focusing on the material you really need.</p>
</div>
</div>
<div className="p-3 mb-3 rounded-3 shadow shadow-sm d-flex">
@ -140,8 +144,8 @@ const Home = () => {
</div>
</div>
<div>
<h6>Feugiat varius imperdiet ultrices pretium.</h6>
<p className='text-secondary fs-7 m-0'>Arcu venenatis iaculis et arcu quis sed. Sed sollicitudin nulla sagittis id et diam lobortis</p>
<h6>Increased Motivation.</h6>
<p className='text-secondary fs-7 m-0'>Feel satisfied when you reach your learning goals and see your progress in real time.</p>
</div>
</div>
</Col>
@ -178,7 +182,8 @@ const Home = () => {
<Row>
<Col md={6} className='col-12 pe-5'>
<div>
<h4>SEALS</h4>
{/* <h4>SEALS</h4> */}
<img src={logo} alt="" className='mb-2'/>
<p className='text-blue-50'>The first free end-to-end analytics service for the site, designed to work with enterprises of various levels and business segments.</p>
</div>
<div className='mt-5 d-flex justify-content-between align-items-end'>
@ -232,12 +237,14 @@ const Home = () => {
Number Office 22/2/5
</p>
</div>
<div>
<h6>Languages</h6>
<div className='d-flex justify-content-center align-items-center'>
{/* <h6>Languages</h6>
<ButtonGroup size='sm' aria-label="Basic example">
<Button variant="ts" className='text-white'>ENG</Button>
<Button variant="ts" className='text-white'>IND</Button>
</ButtonGroup>
</ButtonGroup> */}
<img src={polinema} alt="" style={{height:"70px"}} className='me-3'/>
<img src={pis} alt="" style={{height:"55px"}}/>
</div>
</div>
</Col>

View File

@ -62,7 +62,7 @@ const fetchDataClassProgress = async (dataId, search, sort, page, limit) => {
const postFeedback = async (id, feedback) => {
try {
const response = await axiosInstance.post(`/monitoring/feedback/${id}`, feedback);
const response = await axiosInstance.post(`/monitoring/feedback/${id}`, {feedback});
return response.data;
} catch (error) {
console.error('Error post feedback:', error);

View File

@ -152,7 +152,7 @@ const StudentFeedback = () => {
{successFeedback?(
<Modal.Body className='p-4 d-flex flex-column items-center'>
<h4 className='mb-4 fw-bold text-dark'>Feedback <span className='text-blue'>sent</span>!</h4>
<img src={successIllustration} alt="" />
<img src={successIllustration} alt="" style={{width:'20vw'}}/>
<p className='my-3 text-muted fw-light'>Thank you for letting us know. Well investigate the issue and work on resolving it promptly.</p>
<Button variant="gd" className="py-2 px-5 mt-4 w-50 rounded-35" onClick={handleCloseFeedback}>Done</Button>
</Modal.Body>

View File

@ -106,9 +106,9 @@ const Dashboard = () => {
</Button>
</Col>
) : (
journey.map(data => (
journey.map((data, index) => (
<Card
key={data.ID}
key={index}
className="flex-row p-3 mb-3 border-0 shadow shadow-sm rounded-4"
>
<Card.Img

View File

@ -6,12 +6,21 @@ const useMaterials = (section, topic, level) => {
const [materials, setMaterial] = useState(null);
const [loading, setLoading] = useState(true);
const [error, setError] = useState(null);
const { topicSlugMap } = useSlugContext();
const { sectionSlugMap, topicSlugMap, groupSlugMap } = useSlugContext();
useEffect(() => {
const fetchData = async () => {
try {
const data = await materialService.fetchMaterials(topicSlugMap[topic], level);
const secId = sectionSlugMap[section];
const findTopic = groupSlugMap[secId].find(
(item) => item.nametopic === topic
);
// console.log('slug', topicSlugMap[topic]);
// console.log('find', findTopic.idtopic);
// const data = await materialService.fetchMaterials(topicSlugMap[topic], level);
const data = await materialService.fetchMaterials(findTopic.idtopic, level);
setMaterial(data[0]);
} catch (err) {
setError(err);

View File

@ -22,6 +22,17 @@ function stringToArray(str) {
return str.split(', ');
}
function extractAnswer(input) {
const lines = input.split('|');
const descriptions = lines.map(line => {
const parts = line.split('>');
return parts[1]?.trim();
});
return descriptions;
}
const MatchingPairsQuestion = ({ question, studentAnswer, index }) => {
const savedAnswer = studentAnswer !== null ? studentAnswer : null;
const [pairs, setPairs] = useState([]);
@ -54,7 +65,12 @@ const MatchingPairsQuestion = ({ question, studentAnswer, index }) => {
}));
if (savedAnswer !== null) {
const arrSavedAnswer = stringToArray(savedAnswer);
//if use "," as separator
// const arrSavedAnswer = stringToArray(savedAnswer);
//if use ">" as separator
const arrSavedAnswer = extractAnswer(savedAnswer);
const updatedPairs = initialPairs.map((pair, index) => ({
...pair,
right: arrSavedAnswer[index],

View File

@ -1,5 +1,5 @@
export const API_URL = 'http://54.173.167.62/api';
export const MEDIA_URL = 'http://54.173.167.62/api/uploads';
export const API_URL = 'https://api.seals.id/api';
export const MEDIA_URL = 'https://api.seals.id/api/uploads';
export let headerSection = 'section'
export let headerTopic = 'topic'

View File

@ -15,8 +15,12 @@ const config = {
export const SlugProvider = ({ children, logout }) => {
const [sectionSlugMap, setSectionSlugMap] = useState({});
const [topicSlugMap, setTopicSlugMap] = useState({});
const [groupSlugMap, setGroupSlugMap] = useState({});
const [loading, setLoading] = useState(true);
const [sectionSuccess, setSectionSuccess] = useState(false);
const [topicSuccess, setTopicSuccess] = useState(false);
const fetchData = async () => {
try {
const sectionMapping = {};
@ -27,6 +31,7 @@ export const SlugProvider = ({ children, logout }) => {
sectionMapping[slug] = section.ID_SECTION;
});
setSectionSlugMap(sectionMapping);
setSectionSuccess(true);
} catch (error) {
if (error.status === 403 || error.status === 401) {
logout();
@ -34,15 +39,39 @@ export const SlugProvider = ({ children, logout }) => {
console.error('Error fetching section', error);
}
} finally{
try{
const topicMapping = {};
// const topicResponse = await axios.get(`${API_URL}/topic`, config);
const topicResponse = await axiosInstance.get(`/topic`);
topicResponse.data.payload.forEach((topic) => {
const slug = slugify(topic.NAME_TOPIC);
topicMapping[slug] = topic.ID_TOPIC;
});
setTopicSlugMap(topicMapping);
setTopicSuccess(true);
} catch (error) {
if (error.status === 403 || error.status === 401) {
logout();
}else{
console.error('Error fetching section', error);
setLoading(false);
}
} finally{
try{
const topicMapping = {};
// const topicResponse = await axios.get(`${API_URL}/topic`, config);
const groupMapping = {};
const topicResponse = await axiosInstance.get(`/topic`);
topicResponse.data.payload.forEach((topic) => {
const slug = slugify(topic.NAME_TOPIC);
topicMapping[slug] = topic.ID_TOPIC;
// const slug = slugify(topic.NAME_TOPIC);
// groupMapping[slug] = topic.ID_TOPIC;
if (!groupMapping[topic.ID_SECTION]) {
groupMapping[topic.ID_SECTION] = [];
}
const idtopic = topic.ID_TOPIC;
const nametopic = slugify(topic.NAME_TOPIC);
groupMapping[topic.ID_SECTION].push({ idtopic, nametopic });
});
setTopicSlugMap(topicMapping);
setGroupSlugMap(groupMapping);
} catch (error) {
if (error.status === 403 || error.status === 401) {
logout();
@ -53,6 +82,7 @@ export const SlugProvider = ({ children, logout }) => {
} finally{
setLoading(false);
}
}
}
};
@ -65,7 +95,7 @@ export const SlugProvider = ({ children, logout }) => {
}
return (
<SlugContext.Provider value={{ sectionSlugMap, topicSlugMap }}>
<SlugContext.Provider value={{ sectionSlugMap, topicSlugMap, groupSlugMap }}>
{children}
</SlugContext.Provider>
);