Skip to main content

Exams

Exam Management is always writable — even in evaluation mode. This is the only module exempt from read-only restrictions.

Get Exam Schedule

GET /teacher/exams
GET /teacher/exams/tests
{
"data": {
"upcoming": [
{
"id": "uuid",
"name": "Periodic Test 1",
"type": "PERIODIC_TEST",
"startDate": "2024-04-10",
"endDate": "2024-04-20",
"classId": "uuid",
"divisionId": "uuid"
}
],
"completed": []
}
}

Exam Types

TypeCode
Unit TestUNIT_TEST
Periodic TestPERIODIC_TEST
SemesterSEMESTER
MockMOCK

Create Test

POST /teacher/exams/create-test
{
"data": {
"name": "Chapter 3 Test",
"type": "UNIT_TEST",
"classId": "uuid",
"divisionId": "uuid",
"subjectId": "uuid",
"maxMarks": 20,
"date": "2024-04-15"
}
}

List Exam Types

GET /teacher/exams/list-exam-type

Returns available exam types configured at school level.

Update / Delete Test

PUT /teacher/exams/update-test/{testId}
DELETE /teacher/exams/delete-test/{testId}

UI — Create Test Form

class CreateTestScreen extends StatefulWidget {
@override
State<CreateTestScreen> createState() => _CreateTestScreenState();
}

class _CreateTestScreenState extends State<CreateTestScreen> {
final _formKey = GlobalKey<FormState>();
String _name = '';
String _type = 'UNIT_TEST';
int _maxMarks = 20;
DateTime _date = DateTime.now();

@override
Widget build(BuildContext context) {
return Form(
key: _formKey,
child: Column(
children: [
TextFormField(
decoration: const InputDecoration(labelText: 'Test Name'),
onChanged: (v) => _name = v,
validator: (v) => v!.isEmpty ? 'Required' : null,
),
DropdownButtonFormField<String>(
value: _type,
items: const [
DropdownMenuItem(value: 'UNIT_TEST', child: Text('Unit Test')),
DropdownMenuItem(value: 'PERIODIC_TEST', child: Text('Periodic Test')),
],
onChanged: (v) => setState(() => _type = v!),
),
TextFormField(
decoration: const InputDecoration(labelText: 'Max Marks'),
keyboardType: TextInputType.number,
onChanged: (v) => _maxMarks = int.tryParse(v) ?? 20,
),
DatePickerListTile(
date: _date,
onChanged: (d) => setState(() => _date = d),
),
ElevatedButton(
onPressed: _submit,
child: const Text('Create Test'),
),
],
),
);
}
}

Write Evaluation — Even in Evaluation Mode

Unlike all other modules, exams remain fully writable:

// ExamViewModel — no evaluation mode check
Future<void> createTest(CreateTestDto dto) async {
await requestHandler(() async {
await _examService.createTest(dto);
});
notifyListeners();
}