!!s.timeSpent))).map((_, index) => index),
- datasets: [
- {
- type: "line",
- label: "Average (in minutes)",
- fill: false,
- borderColor: "#6A5FB1",
- backgroundColor: "#7872BF",
- borderWidth: 2,
- spanGaps: true,
- data: calculateAverageTimePerModule(),
- },
- ],
- }}
- />
+ {/* Listening Score Band in Interval */}
+
+ Listening Score Band in Interval
+ moment(date).format("DD/MM/YYYY")),
+ datasets: [
+ {
+ type: "line",
+ label: "Listening",
+ fill: false,
+ borderColor: COLORS[1],
+ backgroundColor: COLORS[1],
+ borderWidth: 2,
+ spanGaps: true,
+ data: intervalDates.map((date) => {
+ return calculateTotalScore(
+ stats.filter(
+ (s) => timestampToMoment(s).isBefore(date) && s.module === "listening",
+ ),
+ ).toFixed(1);
+ }),
+ },
+ ],
+ }}
+ />
+
+
+ {/* Writing Score Band in Interval */}
+
+ Writing Score Band in Interval
+ moment(date).format("DD/MM/YYYY")),
+ datasets: [
+ {
+ type: "line",
+ label: "Writing",
+ fill: false,
+ borderColor: COLORS[2],
+ backgroundColor: COLORS[2],
+ borderWidth: 2,
+ spanGaps: true,
+ data: intervalDates.map((date) => {
+ return calculateTotalScore(
+ stats.filter(
+ (s) => timestampToMoment(s).isBefore(date) && s.module === "writing",
+ ),
+ ).toFixed(1);
+ }),
+ },
+ ],
+ }}
+ />
+
+
+ {/* Speaking Score Band in Interval */}
+
+ Speaking Score Band in Interval
+ moment(date).format("DD/MM/YYYY")),
+ datasets: [
+ {
+ type: "line",
+ label: "Speaking",
+ fill: false,
+ borderColor: COLORS[3],
+ backgroundColor: COLORS[3],
+ borderWidth: 2,
+ spanGaps: true,
+ data: intervalDates.map((date) => {
+ return calculateTotalScore(
+ stats.filter(
+ (s) => timestampToMoment(s).isBefore(date) && s.module === "speaking",
+ ),
+ ).toFixed(1);
+ }),
+ },
+ ],
+ }}
+ />
+
+
+ {/* Level Score Band in Interval */}
+
+ Level Score Band in Interval
+ moment(date).format("DD/MM/YYYY")),
+ datasets: [
+ {
+ type: "line",
+ label: "Level",
+ fill: false,
+ borderColor: COLORS[4],
+ backgroundColor: COLORS[4],
+ borderWidth: 2,
+ spanGaps: true,
+ data: intervalDates.map((date) => {
+ return calculateTotalScore(
+ stats.filter((s) => timestampToMoment(s).isBefore(date) && s.module === "level"),
+ ).toFixed(1);
+ }),
+ },
+ ],
+ }}
+ />
+
+