Updated the MatchSentences exercise to work better now
This commit is contained in:
@@ -124,7 +124,6 @@ const ReadingGeneration = () => {
|
||||
|
||||
const availableTypes = [
|
||||
{type: "fillBlanks", label: "Fill the Blanks"},
|
||||
{type: "multipleChoice", label: "Multiple Choice"},
|
||||
{type: "trueFalse", label: "True or False"},
|
||||
{type: "writeBlanks", label: "Write the Blanks"},
|
||||
{type: "matchSentences", label: "Match Sentences"},
|
||||
|
||||
@@ -29,14 +29,14 @@ async function get(req: NextApiRequest, res: NextApiResponse) {
|
||||
module: Module;
|
||||
endpoint: string;
|
||||
topic?: string;
|
||||
exercises?: string[];
|
||||
exercises?: string[] | string;
|
||||
difficulty?: Difficulty;
|
||||
};
|
||||
const url = `${process.env.BACKEND_URL}/${endpoint}`;
|
||||
|
||||
const params = new URLSearchParams();
|
||||
if (topic) params.append("topic", topic);
|
||||
if (exercises) exercises.forEach((exercise) => params.append("exercises", exercise));
|
||||
if (exercises) (typeof exercises === "string" ? [exercises] : exercises).forEach((exercise) => params.append("exercises", exercise));
|
||||
if (difficulty) params.append("difficulty", difficulty);
|
||||
|
||||
const result = await axios.get(`${url}${params.toString().length > 0 ? `?${params.toString()}` : ""}`, {
|
||||
|
||||
@@ -74,7 +74,11 @@ export default function History({user}: {user: User}) {
|
||||
setGroupedStats(
|
||||
groupByDate(
|
||||
stats.filter((x) => {
|
||||
if ((x.module === "writing" || x.module === "speaking") && !x.isDisabled && !x.solutions.every((y) => "evaluation" in y))
|
||||
if (
|
||||
(x.module === "writing" || x.module === "speaking") &&
|
||||
!x.isDisabled &&
|
||||
!x.solutions.every((y) => Object.keys(y).includes("evaluation"))
|
||||
)
|
||||
return false;
|
||||
return true;
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user