Add support for "BOTH" exam form type and update translations

This commit is contained in:
nati14575
2026-08-24 12:13:18 +03:00
parent 895690de80
commit ff47c7b0aa
5 changed files with 21 additions and 4 deletions

View File

@@ -67,7 +67,11 @@ const STATUS_TONE: Record<string, StatusTone> = {
PUBLISHED: 'success', PUBLISHED: 'success',
}; };
const FORM_LABEL: Record<string, string> = { ESSAY: "Essay", CHOICE: "Choice" }; const FORM_LABEL: Record<string, string> = {
ESSAY: "Essay",
CHOICE: "Choice",
BOTH: "Both",
};
const TYPE_LABEL: Record<string, string> = { WRITTEN: "Written", ORAL: "Oral" }; const TYPE_LABEL: Record<string, string> = { WRITTEN: "Written", ORAL: "Oral" };
const ADMIN_LABEL: Record<string, string> = { const ADMIN_LABEL: Record<string, string> = {
OFFLINE: "Offline", OFFLINE: "Offline",

View File

@@ -249,6 +249,7 @@ function ExamForm({
data={[ data={[
{ value: "ESSAY", label: t("exam.form.essay") }, { value: "ESSAY", label: t("exam.form.essay") },
{ value: "CHOICE", label: t("exam.form.choice") }, { value: "CHOICE", label: t("exam.form.choice") },
{ value: "BOTH", label: t("exam.form.both") },
]} ]}
value={form} value={form}
onChange={setForm} onChange={setForm}

View File

@@ -3,6 +3,8 @@ import type { EstimatedTime } from "../../question/types/question";
import type { QuestionForm } from "../../question/types/question"; import type { QuestionForm } from "../../question/types/question";
export type { QuestionForm }; export type { QuestionForm };
export type ExamForm = QuestionForm | "BOTH";
export type ExamType = "WRITTEN" | "ORAL"; export type ExamType = "WRITTEN" | "ORAL";
export type ExamAdministrationMethod = "OFFLINE" | "ONLINE"; export type ExamAdministrationMethod = "OFFLINE" | "ONLINE";
export type ExamEvaluationMethod = "SUM" | "AVERAGE" | "PERCENTAGE"; export type ExamEvaluationMethod = "SUM" | "AVERAGE" | "PERCENTAGE";
@@ -39,7 +41,7 @@ export interface Exam {
date: string; date: string;
givenTime: EstimatedTime | null; givenTime: EstimatedTime | null;
type: ExamType; type: ExamType;
form: QuestionForm; form: ExamForm;
venue: string; venue: string;
administrationMethod: ExamAdministrationMethod; administrationMethod: ExamAdministrationMethod;
evaluationMethod: ExamEvaluationMethod; evaluationMethod: ExamEvaluationMethod;
@@ -63,7 +65,7 @@ export interface CreateExamPayload {
date: string; date: string;
givenTime: EstimatedTime; givenTime: EstimatedTime;
type: ExamType; type: ExamType;
form: QuestionForm; form: ExamForm;
venue: string; venue: string;
administrationMethod: ExamAdministrationMethod; administrationMethod: ExamAdministrationMethod;
evaluationMethod: ExamEvaluationMethod; evaluationMethod: ExamEvaluationMethod;
@@ -79,7 +81,7 @@ export interface UpdateExamPayload {
date?: string; date?: string;
givenTime?: EstimatedTime; givenTime?: EstimatedTime;
type?: ExamType; type?: ExamType;
form?: QuestionForm; form?: ExamForm;
venue?: string; venue?: string;
administrationMethod?: ExamAdministrationMethod; administrationMethod?: ExamAdministrationMethod;
evaluationMethod?: ExamEvaluationMethod; evaluationMethod?: ExamEvaluationMethod;

View File

@@ -257,6 +257,7 @@ export const am: Translations = {
oral: "ቃል", oral: "ቃል",
essay: "ኢሴይ", essay: "ኢሴይ",
choice: "ምርጫ", choice: "ምርጫ",
both: "ሁለቱም",
offline: "ከመስመር ውጪ", offline: "ከመስመር ውጪ",
online: "በመስመር", online: "በመስመር",
onlineChoiceOnlyHint: "የመስመር ላይ ፈተናዎች በራስ-ሰር ይመዘገባሉ፣ ይህም ለምርጫ ጥያቄዎች ብቻ ይሰራል።", onlineChoiceOnlyHint: "የመስመር ላይ ፈተናዎች በራስ-ሰር ይመዘገባሉ፣ ይህም ለምርጫ ጥያቄዎች ብቻ ይሰራል።",
@@ -309,6 +310,7 @@ export const am: Translations = {
formType: { formType: {
ESSAY: "ኢሴይ", ESSAY: "ኢሴይ",
CHOICE: "ምርጫ", CHOICE: "ምርጫ",
BOTH: "ሁለቱም",
}, },
admin: { admin: {
OFFLINE: "ከመስመር ውጪ", OFFLINE: "ከመስመር ውጪ",
@@ -1007,7 +1009,10 @@ export const am: Translations = {
requestAdjustment: "ማስተካከያ ጠይቅ", requestAdjustment: "ማስተካከያ ጠይቅ",
reject: "አትቀበል", reject: "አትቀበል",
scheduleExam: "የፈተና ቀጠሮ ስጥ", scheduleExam: "የፈተና ቀጠሮ ስጥ",
recordExamOutcome: "የፈተና ውጤት መዝግብ",
confirmPayment: "ክፍያ አረጋግጥ", confirmPayment: "ክፍያ አረጋግጥ",
scheduleIssuance: "የመረከቢያ ቀጠሮ ያዝ",
issueCertificate: "ሰርተፍኬት ስጥ",
print: "ሰነድ አትም", print: "ሰነድ አትም",
copyLink: "አገናኝ ቅዳ", copyLink: "አገናኝ ቅዳ",
downloadDocuments: "ሁሉንም ሰነዶች አውርድ", downloadDocuments: "ሁሉንም ሰነዶች አውርድ",

View File

@@ -256,6 +256,7 @@ export const en = {
oral: 'Oral', oral: 'Oral',
essay: 'Essay', essay: 'Essay',
choice: 'Choice', choice: 'Choice',
both: 'Both',
offline: 'Offline', offline: 'Offline',
online: 'Online', online: 'Online',
onlineChoiceOnlyHint: 'Online exams are graded automatically, which only works for multiple choice.', onlineChoiceOnlyHint: 'Online exams are graded automatically, which only works for multiple choice.',
@@ -307,6 +308,7 @@ export const en = {
formType: { formType: {
ESSAY: 'Essay', ESSAY: 'Essay',
CHOICE: 'Choice', CHOICE: 'Choice',
BOTH: 'Both',
}, },
admin: { admin: {
OFFLINE: 'Offline', OFFLINE: 'Offline',
@@ -1016,7 +1018,10 @@ export const en = {
requestAdjustment: 'Request adjustment', requestAdjustment: 'Request adjustment',
reject: 'Reject', reject: 'Reject',
scheduleExam: 'Schedule exam', scheduleExam: 'Schedule exam',
recordExamOutcome: 'Record exam outcome',
confirmPayment: 'Confirm payment', confirmPayment: 'Confirm payment',
scheduleIssuance: 'Schedule pickup',
issueCertificate: 'Issue certificate',
print: 'Print dossier', print: 'Print dossier',
copyLink: 'Copy link', copyLink: 'Copy link',
downloadDocuments: 'Download all documents', downloadDocuments: 'Download all documents',