Updated the labels for the level
This commit is contained in:
@@ -14,7 +14,7 @@ import useExamStore from "@/stores/examStore";
|
|||||||
import {getExamById} from "@/utils/exams";
|
import {getExamById} from "@/utils/exams";
|
||||||
import {getUserCorporate} from "@/utils/groups";
|
import {getUserCorporate} from "@/utils/groups";
|
||||||
import {MODULE_ARRAY, sortByModule, sortByModuleName} from "@/utils/moduleUtils";
|
import {MODULE_ARRAY, sortByModule, sortByModuleName} from "@/utils/moduleUtils";
|
||||||
import {getLevelScore} from "@/utils/score";
|
import {getLevelLabel, getLevelScore} from "@/utils/score";
|
||||||
import {averageScore, groupBySession} from "@/utils/stats";
|
import {averageScore, groupBySession} from "@/utils/stats";
|
||||||
import {CreateOrderActions, CreateOrderData, OnApproveActions, OnApproveData, OrderResponseBody} from "@paypal/paypal-js";
|
import {CreateOrderActions, CreateOrderData, OnApproveActions, OnApproveData, OrderResponseBody} from "@paypal/paypal-js";
|
||||||
import {PayPalButtons} from "@paypal/react-paypal-js";
|
import {PayPalButtons} from "@paypal/react-paypal-js";
|
||||||
@@ -244,7 +244,7 @@ export default function StudentDashboard({user}: Props) {
|
|||||||
<div className="flex w-full justify-between">
|
<div className="flex w-full justify-between">
|
||||||
<span className="text-sm font-bold md:font-extrabold">{capitalize(module)}</span>
|
<span className="text-sm font-bold md:font-extrabold">{capitalize(module)}</span>
|
||||||
<span className="text-mti-gray-dim text-sm font-normal">
|
<span className="text-mti-gray-dim text-sm font-normal">
|
||||||
{module === "level" && `English Level: ${getLevelScore(level).join(" / ")}`}
|
{module === "level" && `English Level: ${getLevelLabel(level).join(" / ")}`}
|
||||||
{module !== "level" && `Level ${level} / Level 9 (Desired Level: ${desiredLevel})`}
|
{module !== "level" && `Level ${level} / Level 9 (Desired Level: ${desiredLevel})`}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -163,3 +163,14 @@ export const getLevelScore = (level: number) => {
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getLevelLabel = (level: number) => {
|
||||||
|
if (level < 2) return ["Foundation", "Pre-A1"];
|
||||||
|
if (level < 4) return ["Elementary", "A1"];
|
||||||
|
if (level < 5) return ["Pre-intermediate", "A2"];
|
||||||
|
if (level < 6) return ["Intermediate", "B1"];
|
||||||
|
if (level < 7) return ["Upper Intermediate", "B2"];
|
||||||
|
if (level < 8) return ["Advanced", "C1"];
|
||||||
|
|
||||||
|
return ["Proficiency", "C2"];
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user