Programme added
This commit is contained in:
@@ -209,6 +209,7 @@ function TutorApp({ currentUser, onLogout }) {
|
||||
const [voiceProfiles, setVoiceProfiles] = useState([])
|
||||
const [selectedVoiceProfileId, setSelectedVoiceProfileId] = useState('')
|
||||
const [programLessons, setProgramLessons] = useState([])
|
||||
const [programStatus, setProgramStatus] = useState(null)
|
||||
const [studentProgram, setStudentProgram] = useState(null)
|
||||
const [progressPanelOpen, setProgressPanelOpen] = useState(false)
|
||||
const [settingsPanelOpen, setSettingsPanelOpen] = useState(false)
|
||||
@@ -303,6 +304,7 @@ function TutorApp({ currentUser, onLogout }) {
|
||||
loadMessages(selectedStudentId)
|
||||
loadStudentProgram(selectedStudentId)
|
||||
if (!isStudentUser) {
|
||||
loadProgramStatus()
|
||||
const student = students.find((item) => String(item.id) === String(selectedStudentId))
|
||||
if (student) loadProgramLessons(student.grade)
|
||||
}
|
||||
@@ -546,6 +548,15 @@ function TutorApp({ currentUser, onLogout }) {
|
||||
}
|
||||
}
|
||||
|
||||
async function loadProgramStatus() {
|
||||
try {
|
||||
const data = await apiFetch('/program/status')
|
||||
setProgramStatus(data)
|
||||
} catch {
|
||||
setProgramStatus(null)
|
||||
}
|
||||
}
|
||||
|
||||
async function loadStudentProgram(studentId) {
|
||||
try {
|
||||
const data = await apiFetch(`/students/${studentId}/program`)
|
||||
@@ -1169,6 +1180,14 @@ function TutorApp({ currentUser, onLogout }) {
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
{programLessons.length === 0 && (
|
||||
<p className="program-diagnostic">
|
||||
Aucune leçon trouvée pour {selectedStudent.grade}. Dossier lu: {programStatus?.content_root || 'inconnu'}.
|
||||
{programStatus?.content_root_exists === false
|
||||
? ' Le dossier de programme n’est pas accessible par le backend.'
|
||||
: ' Vérifie le niveau ou le montage du dossier Programme.'}
|
||||
</p>
|
||||
)}
|
||||
</section>
|
||||
)}
|
||||
</>
|
||||
|
||||
@@ -109,6 +109,11 @@ button:disabled { opacity: 0.5; cursor: not-allowed; }
|
||||
.admin-program-panel p {
|
||||
margin: 0;
|
||||
}
|
||||
.program-diagnostic {
|
||||
color: #b45309;
|
||||
font-size: 0.9rem;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.admin-main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
Reference in New Issue
Block a user