Exams
Exam Schedule
GET /parent/exam/get-scheduled-exam?studentId={id}
{
"data": {
"upcoming": [
{
"examId": "uuid",
"name": "Periodic Test 1",
"startDate": "2024-04-10",
"endDate": "2024-04-20",
"subjects": ["Mathematics", "Science", "English"]
}
],
"completed": []
}
}
Exam Results
GET /parent/exam/get-exam-result?studentId={id}
{
"data": {
"examId": "uuid",
"examName": "Periodic Test 1",
"totalMarks": 500,
"marksObtained": 425,
"percentage": 85.0,
"grade": "A1",
"classRank": 3,
"subjects": [
{ "name": "Mathematics", "marksObtained": 90, "maxMarks": 100, "grade": "A1" },
{ "name": "Science", "marksObtained": 85, "maxMarks": 100, "grade": "A2" },
{ "name": "English", "marksObtained": 80, "maxMarks": 100, "grade": "A2" }
]
}
}
UI — Results Card
class ResultCard extends StatelessWidget {
final ExamResult result;
@override
Widget build(BuildContext context) {
return Card(
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(result.examName, style: const TextStyle(fontWeight: FontWeight.bold)),
const SizedBox(height: 8),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text('Total: ${result.marksObtained}/${result.totalMarks}'),
Text('Grade: ${result.grade}'),
Text('Rank: #${result.classRank}'),
],
),
const Divider(),
...result.subjects.map((s) => ListTile(
dense: true,
title: Text(s.name),
trailing: Text('${s.marksObtained}/${s.maxMarks} (${s.grade})'),
)),
],
),
),
);
}
}