2399 lines
68 KiB
Vue
2399 lines
68 KiB
Vue
<script setup lang="ts">
|
|
import { getDisplayLocale } from "../i18n";
|
|
import { useI18n } from "vue-i18n";
|
|
const { t, locale } = useI18n();
|
|
import {
|
|
computed,
|
|
nextTick,
|
|
onBeforeUnmount,
|
|
onMounted,
|
|
reactive,
|
|
ref,
|
|
watch,
|
|
} from "vue";
|
|
import {
|
|
Delete,
|
|
Download,
|
|
Refresh,
|
|
Search,
|
|
Setting,
|
|
} from "@element-plus/icons-vue";
|
|
import * as echarts from "echarts/core";
|
|
import { BarChart, LineChart } from "echarts/charts";
|
|
import {
|
|
AriaComponent,
|
|
GridComponent,
|
|
LegendComponent,
|
|
TooltipComponent,
|
|
} from "echarts/components";
|
|
import { CanvasRenderer } from "echarts/renderers";
|
|
import http, { apiErrorMessage } from "../api/http";
|
|
import { downloadApiFile } from "../api/excel";
|
|
import {
|
|
academicTermLabel,
|
|
defaultAcademicTermId,
|
|
} from "../utils/academicTerms";
|
|
import { useAuthStore } from "../stores/auth";
|
|
|
|
echarts.use([
|
|
AriaComponent,
|
|
BarChart,
|
|
CanvasRenderer,
|
|
GridComponent,
|
|
LegendComponent,
|
|
LineChart,
|
|
TooltipComponent,
|
|
]);
|
|
|
|
interface TeachingClassItem {
|
|
gradeSheetId: string;
|
|
teachingTaskId: string;
|
|
taskNumber: string;
|
|
taskName: string;
|
|
courseCode: string;
|
|
courseName: string;
|
|
termName: string;
|
|
academicTermId: string;
|
|
teacherNames: string[];
|
|
classNames: string[];
|
|
studentCount: number;
|
|
averageScore: number;
|
|
passRate: number;
|
|
excellentRate: number;
|
|
calculatedAt: string;
|
|
}
|
|
|
|
interface CourseOverviewItem {
|
|
courseId: string;
|
|
courseCode: string;
|
|
courseName: string;
|
|
collegeId: string;
|
|
collegeName: string;
|
|
termCount: number;
|
|
teachingClassCount: number;
|
|
studentCount: number;
|
|
passedCount: number;
|
|
excellentCount: number;
|
|
highestScore: number;
|
|
averageScore: number;
|
|
lowestScore: number;
|
|
passRate: number;
|
|
excellentRate: number;
|
|
calculatedAt: string;
|
|
}
|
|
|
|
interface GradeAnalyticsComment {
|
|
id: string;
|
|
content: string;
|
|
isAnonymous: boolean;
|
|
authorName: string;
|
|
createdAt: string;
|
|
canDelete: boolean;
|
|
replyCount: number;
|
|
likeCount: number;
|
|
insightfulCount: number;
|
|
agreeCount: number;
|
|
hasLiked: boolean;
|
|
hasInsightful: boolean;
|
|
hasAgreed: boolean;
|
|
replies?: GradeAnalyticsComment[];
|
|
repliesHasMore?: boolean;
|
|
repliesNextCursor?: { createdAt: string; id: string };
|
|
}
|
|
|
|
const terms = ref<any[]>([]);
|
|
const colleges = ref<any[]>([]);
|
|
const auth = useAuthStore();
|
|
const canManageSchedule = computed(
|
|
() =>
|
|
auth.user?.roles.some((role) =>
|
|
["SuperAdmin", "AcademicAdmin"].includes(role),
|
|
) ?? false,
|
|
);
|
|
const canViewCourseOverview = computed(
|
|
() =>
|
|
auth.user?.roles.some((role) =>
|
|
["SuperAdmin", "AcademicAdmin", "CollegeAdmin", "Leader"].includes(role),
|
|
) ?? false,
|
|
);
|
|
const analysisMode = ref<"classes" | "courses">("classes");
|
|
const classes = ref<TeachingClassItem[]>([]);
|
|
const selected = ref<TeachingClassItem>();
|
|
const report = ref<any>();
|
|
const termId = ref<string>();
|
|
const keyword = ref("");
|
|
const collegeId = ref<string>();
|
|
const teacherKeyword = ref("");
|
|
const riskOnly = ref(false);
|
|
const page = ref(1);
|
|
const total = ref(0);
|
|
const courses = ref<CourseOverviewItem[]>([]);
|
|
const selectedCourse = ref<CourseOverviewItem>();
|
|
const courseReport = ref<any>();
|
|
const courseTotal = ref(0);
|
|
const coursePage = ref(1);
|
|
const courseReportLoading = ref(false);
|
|
const courseExporting = ref(false);
|
|
const pageSize = 12;
|
|
const loading = ref(false);
|
|
const reportLoading = ref(false);
|
|
const exporting = ref(false);
|
|
const historyMetric = ref<"average" | "passRate" | "excellentRate">("average");
|
|
const scheduleDialogVisible = ref(false);
|
|
const scheduleLoading = ref(false);
|
|
const scheduleSaving = ref(false);
|
|
const schedule = reactive({
|
|
isEnabled: true,
|
|
intervalMinutes: 5,
|
|
batchSize: 100,
|
|
lastRunAt: null as string | null,
|
|
nextRunAt: null as string | null,
|
|
});
|
|
const comments = ref<GradeAnalyticsComment[]>([]);
|
|
const commentsLoading = ref(false);
|
|
const commentSubmitting = ref(false);
|
|
const commentContent = ref("");
|
|
const commentAnonymous = ref(false);
|
|
const commentsHasMore = ref(false);
|
|
const commentsNextCursor = ref<{ createdAt: string; id: string }>();
|
|
const replyDrafts = reactive<Record<string, string>>({});
|
|
const replyAnonymous = reactive<Record<string, boolean>>({});
|
|
const replyOpen = reactive<Record<string, boolean>>({});
|
|
const replyLoading = reactive<Record<string, boolean>>({});
|
|
|
|
const distributionElement = ref<HTMLElement>();
|
|
const peerAverageElement = ref<HTMLElement>();
|
|
const peerPassElement = ref<HTMLElement>();
|
|
const benchmarkElement = ref<HTMLElement>();
|
|
const historyElement = ref<HTMLElement>();
|
|
const charts: echarts.ECharts[] = [];
|
|
|
|
const summary = computed(() => report.value?.summary);
|
|
const delta = computed(() => report.value?.universityDelta);
|
|
const commentCourseId = computed(() =>
|
|
analysisMode.value === "courses"
|
|
? selectedCourse.value?.courseId
|
|
: report.value?.courseId,
|
|
);
|
|
const commentCourseName = computed(() =>
|
|
analysisMode.value === "courses"
|
|
? selectedCourse.value?.courseName
|
|
: report.value?.courseName,
|
|
);
|
|
const historyMetricMeta = computed(
|
|
() =>
|
|
({
|
|
average: {
|
|
label: t("gradeAnalyticsScript.averageScore"),
|
|
course: t("gradeAnalyticsScript.universityCourseAverage"),
|
|
instructor: t("gradeAnalyticsScript.instructorHistory"),
|
|
suffix: t("gradeAnalyticsScript.pointSuffix"),
|
|
},
|
|
passRate: {
|
|
label: t("gradeAnalyticsScript.passRate"),
|
|
course: t("gradeAnalyticsScript.universityCoursePassRate"),
|
|
instructor: t("gradeAnalyticsScript.instructorHistory"),
|
|
suffix: "%",
|
|
},
|
|
excellentRate: {
|
|
label: t("gradeAnalyticsScript.excellentRate"),
|
|
course: t("gradeAnalyticsScript.universityCourseExcellentRate"),
|
|
instructor: t("gradeAnalyticsScript.instructorHistory"),
|
|
suffix: "%",
|
|
},
|
|
})[historyMetric.value],
|
|
);
|
|
|
|
function number(value: unknown, digits = 1) {
|
|
const parsed = Number(value);
|
|
return Number.isFinite(parsed) ? parsed.toFixed(digits) : "—";
|
|
}
|
|
|
|
function signed(value: unknown, suffix = "") {
|
|
const parsed = Number(value);
|
|
if (!Number.isFinite(parsed)) return "—";
|
|
return `${parsed > 0 ? "+" : ""}${parsed.toFixed(1)}${suffix}`;
|
|
}
|
|
|
|
function disposeCharts() {
|
|
charts.splice(0).forEach((chart) => chart.dispose());
|
|
}
|
|
|
|
function createChart(element: HTMLElement | undefined) {
|
|
if (!element) return undefined;
|
|
const chart = echarts.init(element);
|
|
charts.push(chart);
|
|
return chart;
|
|
}
|
|
|
|
async function loadClasses(reset = false) {
|
|
if (reset) page.value = 1;
|
|
loading.value = true;
|
|
try {
|
|
const data = (
|
|
await http.get("/grade-analytics/teaching-classes", {
|
|
params: {
|
|
academicTermId: termId.value,
|
|
keyword: keyword.value.trim() || undefined,
|
|
collegeId: collegeId.value,
|
|
teacherKeyword: teacherKeyword.value.trim() || undefined,
|
|
riskOnly: riskOnly.value || undefined,
|
|
page: page.value,
|
|
pageSize,
|
|
},
|
|
})
|
|
).data;
|
|
classes.value = data.items;
|
|
total.value = data.total;
|
|
const retained = classes.value.find(
|
|
(item) => item.gradeSheetId === selected.value?.gradeSheetId,
|
|
);
|
|
selected.value = retained ?? classes.value[0];
|
|
if (selected.value) await loadReport(selected.value);
|
|
else {
|
|
report.value = undefined;
|
|
disposeCharts();
|
|
await loadComments(true);
|
|
}
|
|
} catch (error) {
|
|
ElMessage.error(apiErrorMessage(error));
|
|
} finally {
|
|
loading.value = false;
|
|
}
|
|
}
|
|
|
|
async function loadCourses(reset = false) {
|
|
if (reset) coursePage.value = 1;
|
|
loading.value = true;
|
|
try {
|
|
const data = (
|
|
await http.get("/grade-analytics/courses", {
|
|
params: {
|
|
academicTermId: termId.value,
|
|
keyword: keyword.value.trim() || undefined,
|
|
collegeId: collegeId.value,
|
|
riskOnly: riskOnly.value || undefined,
|
|
page: coursePage.value,
|
|
pageSize,
|
|
},
|
|
})
|
|
).data;
|
|
courses.value = data.items;
|
|
courseTotal.value = data.total;
|
|
selectedCourse.value =
|
|
courses.value.find(
|
|
(item) => item.courseId === selectedCourse.value?.courseId,
|
|
) ?? courses.value[0];
|
|
if (selectedCourse.value) await loadCourseReport(selectedCourse.value);
|
|
else {
|
|
courseReport.value = undefined;
|
|
await loadComments(true);
|
|
}
|
|
} catch (error) {
|
|
ElMessage.error(apiErrorMessage(error));
|
|
} finally {
|
|
loading.value = false;
|
|
}
|
|
}
|
|
|
|
async function loadCourseReport(item = selectedCourse.value) {
|
|
if (!item) return;
|
|
selectedCourse.value = item;
|
|
courseReportLoading.value = true;
|
|
try {
|
|
courseReport.value = (
|
|
await http.get(`/grade-analytics/courses/${item.courseId}`, {
|
|
params: { academicTermId: termId.value },
|
|
})
|
|
).data;
|
|
await loadComments(true);
|
|
} catch (error) {
|
|
ElMessage.error(apiErrorMessage(error));
|
|
} finally {
|
|
courseReportLoading.value = false;
|
|
}
|
|
}
|
|
|
|
async function exportCourseWordReport() {
|
|
if (!selectedCourse.value) return;
|
|
courseExporting.value = true;
|
|
try {
|
|
await downloadApiFile(
|
|
`/grade-analytics/courses/${selectedCourse.value.courseId}/report.docx`,
|
|
t("gradeAnalyticsScript.courseReport", {
|
|
code: selectedCourse.value.courseCode,
|
|
}),
|
|
{ params: { academicTermId: termId.value } },
|
|
);
|
|
ElMessage.success(
|
|
t("gradeAnalyticsScript.courseWideGradeAnalysisWordReportExported"),
|
|
);
|
|
} catch (error) {
|
|
ElMessage.error(apiErrorMessage(error));
|
|
} finally {
|
|
courseExporting.value = false;
|
|
}
|
|
}
|
|
|
|
async function switchAnalysisMode(mode: "classes" | "courses") {
|
|
analysisMode.value = mode;
|
|
if (mode === "courses") await loadCourses(true);
|
|
else await loadClasses(true);
|
|
}
|
|
|
|
function reloadCurrent(reset = true) {
|
|
if (analysisMode.value === "courses") return loadCourses(reset);
|
|
return loadClasses(reset);
|
|
}
|
|
|
|
function resetFilters() {
|
|
termId.value = defaultAcademicTermId(terms.value);
|
|
collegeId.value = undefined;
|
|
keyword.value = "";
|
|
teacherKeyword.value = "";
|
|
riskOnly.value = false;
|
|
reloadCurrent(true);
|
|
}
|
|
|
|
async function loadReport(item = selected.value) {
|
|
if (!item) return;
|
|
selected.value = item;
|
|
reportLoading.value = true;
|
|
try {
|
|
report.value = (
|
|
await http.get(`/grade-analytics/teaching-classes/${item.gradeSheetId}`)
|
|
).data;
|
|
await loadComments(true);
|
|
await nextTick();
|
|
drawCharts();
|
|
} catch (error) {
|
|
ElMessage.error(apiErrorMessage(error));
|
|
} finally {
|
|
reportLoading.value = false;
|
|
}
|
|
}
|
|
|
|
async function refreshStatistics() {
|
|
if (!selected.value) {
|
|
await loadClasses();
|
|
return;
|
|
}
|
|
reportLoading.value = true;
|
|
try {
|
|
await http.post(
|
|
`/grade-analytics/teaching-classes/${selected.value.gradeSheetId}/refresh`,
|
|
);
|
|
ElMessage.success(t("gradeAnalyticsScript.statisticsRefreshSubmitted"));
|
|
window.setTimeout(() => loadClasses(), 900);
|
|
} catch (error) {
|
|
ElMessage.error(apiErrorMessage(error));
|
|
reportLoading.value = false;
|
|
}
|
|
}
|
|
|
|
async function openScheduleSettings() {
|
|
scheduleDialogVisible.value = true;
|
|
scheduleLoading.value = true;
|
|
try {
|
|
const data = (await http.get("/grade-analytics/refresh-schedule")).data;
|
|
schedule.isEnabled = data.isEnabled;
|
|
schedule.intervalMinutes = Math.max(
|
|
1,
|
|
Math.round(data.intervalSeconds / 60),
|
|
);
|
|
schedule.batchSize = data.batchSize;
|
|
schedule.lastRunAt = data.lastRunAt;
|
|
schedule.nextRunAt = data.nextRunAt;
|
|
} catch (error) {
|
|
ElMessage.error(apiErrorMessage(error));
|
|
} finally {
|
|
scheduleLoading.value = false;
|
|
}
|
|
}
|
|
|
|
async function saveScheduleSettings() {
|
|
scheduleSaving.value = true;
|
|
try {
|
|
await http.put("/grade-analytics/refresh-schedule", {
|
|
isEnabled: schedule.isEnabled,
|
|
intervalSeconds: schedule.intervalMinutes * 60,
|
|
batchSize: schedule.batchSize,
|
|
});
|
|
ElMessage.success(
|
|
t(
|
|
"gradeAnalyticsScript.scheduledRefreshSettingsForGradeStatisticsAndAcademicOverviewSaved",
|
|
),
|
|
);
|
|
scheduleDialogVisible.value = false;
|
|
} catch (error) {
|
|
ElMessage.error(apiErrorMessage(error));
|
|
} finally {
|
|
scheduleSaving.value = false;
|
|
}
|
|
}
|
|
|
|
async function exportWordReport() {
|
|
if (!selected.value) return;
|
|
exporting.value = true;
|
|
try {
|
|
await downloadApiFile(
|
|
`/grade-analytics/teaching-classes/${selected.value.gradeSheetId}/report.docx`,
|
|
t("gradeAnalyticsScript.classReport", {
|
|
code: selected.value.courseCode,
|
|
task: selected.value.taskNumber,
|
|
}),
|
|
);
|
|
ElMessage.success(t("gradeAnalyticsScript.gradeAnalysisReportExported"));
|
|
} catch (error) {
|
|
ElMessage.error(apiErrorMessage(error));
|
|
} finally {
|
|
exporting.value = false;
|
|
}
|
|
}
|
|
|
|
async function loadComments(reset = false) {
|
|
const courseId = commentCourseId.value;
|
|
if (!courseId) {
|
|
comments.value = [];
|
|
commentsHasMore.value = false;
|
|
commentsNextCursor.value = undefined;
|
|
return;
|
|
}
|
|
if (reset) {
|
|
comments.value = [];
|
|
commentsHasMore.value = false;
|
|
commentsNextCursor.value = undefined;
|
|
}
|
|
commentsLoading.value = true;
|
|
try {
|
|
const data = (
|
|
await http.get(`/grade-analytics/courses/${courseId}/comments`, {
|
|
params:
|
|
reset || !commentsNextCursor.value
|
|
? undefined
|
|
: {
|
|
beforeCreatedAt: commentsNextCursor.value.createdAt,
|
|
beforeId: commentsNextCursor.value.id,
|
|
},
|
|
})
|
|
).data;
|
|
comments.value.push(...data.items);
|
|
commentsHasMore.value = data.hasMore;
|
|
commentsNextCursor.value = data.nextCursor ?? undefined;
|
|
} catch (error) {
|
|
ElMessage.error(apiErrorMessage(error));
|
|
} finally {
|
|
commentsLoading.value = false;
|
|
}
|
|
}
|
|
|
|
async function submitComment() {
|
|
const courseId = commentCourseId.value;
|
|
if (!courseId) return;
|
|
const content = commentContent.value.trim();
|
|
if (!content) {
|
|
ElMessage.warning(t("discussion.messages.enterContent"));
|
|
return;
|
|
}
|
|
commentSubmitting.value = true;
|
|
try {
|
|
await http.post(`/grade-analytics/courses/${courseId}/comments`, {
|
|
content,
|
|
isAnonymous: commentAnonymous.value,
|
|
});
|
|
commentContent.value = "";
|
|
await loadComments(true);
|
|
ElMessage.success(
|
|
commentAnonymous.value
|
|
? t("gradeAnalyticsScript.anonymousCommentPublished")
|
|
: t("gradeAnalyticsScript.namedCommentPublished"),
|
|
);
|
|
} catch (error) {
|
|
ElMessage.error(apiErrorMessage(error));
|
|
} finally {
|
|
commentSubmitting.value = false;
|
|
}
|
|
}
|
|
|
|
async function deleteComment(comment: GradeAnalyticsComment) {
|
|
try {
|
|
await ElMessageBox.confirm(
|
|
t("gradeAnalyticsScript.deleteThisCommentThisCannotBeUndone"),
|
|
t("gradeAnalyticsScript.deleteComment"),
|
|
{ type: "warning" },
|
|
);
|
|
await http.delete(`/grade-analytics/comments/${comment.id}`);
|
|
comments.value = comments.value.filter((item) => item.id !== comment.id);
|
|
ElMessage.success(t("discussion.messages.deleted"));
|
|
} catch (error) {
|
|
if (error !== "cancel" && error !== "close")
|
|
ElMessage.error(apiErrorMessage(error));
|
|
}
|
|
}
|
|
|
|
async function toggleReaction(
|
|
comment: GradeAnalyticsComment,
|
|
type: "Like" | "Insightful" | "Agree",
|
|
) {
|
|
const courseId = commentCourseId.value;
|
|
if (!courseId) return;
|
|
try {
|
|
await http.post(
|
|
`/grade-analytics/courses/${courseId}/comments/${comment.id}/reactions/${type}`,
|
|
);
|
|
await loadComments(true);
|
|
} catch (error) {
|
|
ElMessage.error(apiErrorMessage(error));
|
|
}
|
|
}
|
|
|
|
async function toggleReplies(comment: GradeAnalyticsComment) {
|
|
replyOpen[comment.id] = !replyOpen[comment.id];
|
|
if (!replyOpen[comment.id] || comment.replies) return;
|
|
await loadReplies(comment, true);
|
|
}
|
|
|
|
async function loadReplies(comment: GradeAnalyticsComment, reset = false) {
|
|
const courseId = commentCourseId.value;
|
|
if (!courseId) return;
|
|
replyLoading[comment.id] = true;
|
|
try {
|
|
const cursor = reset ? undefined : comment.repliesNextCursor;
|
|
const data = (
|
|
await http.get(
|
|
`/grade-analytics/courses/${courseId}/comments/${comment.id}/replies`,
|
|
{
|
|
params: cursor
|
|
? { afterCreatedAt: cursor.createdAt, afterId: cursor.id }
|
|
: undefined,
|
|
},
|
|
)
|
|
).data;
|
|
comment.replies = reset
|
|
? data.items
|
|
: [...(comment.replies ?? []), ...data.items];
|
|
comment.repliesHasMore = data.hasMore;
|
|
comment.repliesNextCursor = data.nextCursor ?? undefined;
|
|
} catch (error) {
|
|
ElMessage.error(apiErrorMessage(error));
|
|
} finally {
|
|
replyLoading[comment.id] = false;
|
|
}
|
|
}
|
|
|
|
async function submitReply(comment: GradeAnalyticsComment) {
|
|
const courseId = commentCourseId.value;
|
|
const content = replyDrafts[comment.id]?.trim();
|
|
if (!courseId || !content) return;
|
|
try {
|
|
await http.post(
|
|
`/grade-analytics/courses/${courseId}/comments/${comment.id}/replies`,
|
|
{ content, isAnonymous: replyAnonymous[comment.id] === true },
|
|
);
|
|
replyDrafts[comment.id] = "";
|
|
comment.replies = undefined;
|
|
replyOpen[comment.id] = false;
|
|
await toggleReplies(comment);
|
|
await loadComments(true);
|
|
} catch (error) {
|
|
ElMessage.error(apiErrorMessage(error));
|
|
}
|
|
}
|
|
|
|
function baseGrid(left = 48, right = 24) {
|
|
return { left, right, top: 42, bottom: 44, containLabel: true };
|
|
}
|
|
|
|
function drawCharts() {
|
|
disposeCharts();
|
|
if (!summary.value) return;
|
|
|
|
const distribution = createChart(distributionElement.value);
|
|
distribution?.setOption({
|
|
aria: { enabled: true, decal: { show: true } },
|
|
tooltip: { trigger: "axis", axisPointer: { type: "shadow" } },
|
|
grid: baseGrid(),
|
|
xAxis: {
|
|
type: "category",
|
|
data: summary.value.scoreBands.map((x: any) => x.label),
|
|
axisTick: { show: false },
|
|
},
|
|
yAxis: {
|
|
type: "value",
|
|
minInterval: 1,
|
|
name: t("gradeAnalyticsScript.students"),
|
|
splitLine: { lineStyle: { color: "#edf1f6" } },
|
|
},
|
|
series: [
|
|
{
|
|
name: t("gradeAnalyticsScript.students"),
|
|
type: "bar",
|
|
barMaxWidth: 54,
|
|
data: summary.value.scoreBands.map((x: any, index: number) => ({
|
|
value: x.studentCount,
|
|
itemStyle: {
|
|
color: ["#b9c6d8", "#95a9c5", "#6f8db5", "#496f9f", "#204f87"][
|
|
index
|
|
],
|
|
},
|
|
})),
|
|
label: {
|
|
show: true,
|
|
position: "top",
|
|
formatter: (p: any) =>
|
|
t("gradeAnalyticsScript.people", { count: p.value }),
|
|
},
|
|
itemStyle: { borderRadius: [4, 4, 0, 0] },
|
|
},
|
|
],
|
|
});
|
|
|
|
const peers = report.value.peerTeachingClasses ?? [];
|
|
const peerNames = peers.map(
|
|
(x: any) =>
|
|
`${x.taskNumber} · ${x.teacherNames || t("gradeAnalyticsScript.instructorNotSpecified")}`,
|
|
);
|
|
const peerAverage = createChart(peerAverageElement.value);
|
|
peerAverage?.setOption({
|
|
aria: { enabled: true, decal: { show: true } },
|
|
tooltip: {
|
|
trigger: "axis",
|
|
axisPointer: { type: "shadow" },
|
|
valueFormatter: (v: any) =>
|
|
t("gradeAnalyticsScript.points", { value: number(v) }),
|
|
},
|
|
grid: baseGrid(20, 36),
|
|
xAxis: {
|
|
type: "value",
|
|
min: 0,
|
|
max: 100,
|
|
name: t("gradeAnalyticsScript.averageScore"),
|
|
splitLine: { lineStyle: { color: "#edf1f6" } },
|
|
},
|
|
yAxis: {
|
|
type: "category",
|
|
inverse: true,
|
|
data: peerNames,
|
|
axisTick: { show: false },
|
|
axisLabel: { width: 150, overflow: "truncate" },
|
|
},
|
|
series: [
|
|
{
|
|
type: "bar",
|
|
barMaxWidth: 24,
|
|
data: peers.map((x: any) => ({
|
|
value: x.averageScore,
|
|
itemStyle: { color: x.isSelected ? "#204f87" : "#aebdd1" },
|
|
})),
|
|
label: {
|
|
show: true,
|
|
position: "right",
|
|
formatter: (p: any) => number(p.value),
|
|
},
|
|
itemStyle: { borderRadius: [0, 4, 4, 0] },
|
|
},
|
|
],
|
|
});
|
|
|
|
const peerPass = createChart(peerPassElement.value);
|
|
peerPass?.setOption({
|
|
aria: { enabled: true, decal: { show: true } },
|
|
tooltip: {
|
|
trigger: "axis",
|
|
axisPointer: { type: "shadow" },
|
|
valueFormatter: (v: any) => `${number(v)}%`,
|
|
},
|
|
grid: baseGrid(20, 42),
|
|
xAxis: {
|
|
type: "value",
|
|
min: 0,
|
|
max: 100,
|
|
name: t("gradeAnalyticsScript.passRate"),
|
|
axisLabel: { formatter: "{value}%" },
|
|
splitLine: { lineStyle: { color: "#edf1f6" } },
|
|
},
|
|
yAxis: {
|
|
type: "category",
|
|
inverse: true,
|
|
data: peerNames,
|
|
axisTick: { show: false },
|
|
axisLabel: { width: 150, overflow: "truncate" },
|
|
},
|
|
series: [
|
|
{
|
|
type: "bar",
|
|
barMaxWidth: 18,
|
|
data: peers.map((x: any) => ({
|
|
value: x.passRate,
|
|
itemStyle: { color: x.isSelected ? "#b8732d" : "#dcc3a5" },
|
|
})),
|
|
label: {
|
|
show: true,
|
|
position: "right",
|
|
formatter: (p: any) => `${number(p.value)}%`,
|
|
},
|
|
itemStyle: { borderRadius: [0, 4, 4, 0] },
|
|
},
|
|
],
|
|
});
|
|
|
|
const benchmarks = report.value.scopeBenchmarks ?? [];
|
|
const benchmark = createChart(benchmarkElement.value);
|
|
benchmark?.setOption({
|
|
aria: { enabled: true, decal: { show: true } },
|
|
tooltip: {
|
|
trigger: "axis",
|
|
formatter: (params: any) => {
|
|
const item = benchmarks[params[0]?.dataIndex ?? 0];
|
|
return t("gradeAnalyticsScript.benchmarkTooltip", {
|
|
scope: item.scope,
|
|
name: item.name,
|
|
count: item.studentCount,
|
|
highest: number(item.highestScore),
|
|
average: number(item.averageScore),
|
|
lowest: number(item.lowestScore),
|
|
pass: number(item.passRate),
|
|
});
|
|
},
|
|
},
|
|
legend: {
|
|
top: 0,
|
|
data: [
|
|
t("gradeAnalyticsScript.scoreRange"),
|
|
t("gradeAnalyticsScript.averageScore"),
|
|
t("gradeAnalyticsScript.passRate"),
|
|
],
|
|
},
|
|
grid: { left: 30, right: 54, top: 58, bottom: 52, containLabel: true },
|
|
xAxis: {
|
|
type: "category",
|
|
data: benchmarks.map((x: any) => `${x.scope}\n${x.name}`),
|
|
axisTick: { show: false },
|
|
},
|
|
yAxis: [
|
|
{
|
|
type: "value",
|
|
min: 0,
|
|
max: 100,
|
|
name: t("gradeAnalyticsScript.score"),
|
|
splitLine: { lineStyle: { color: "#edf1f6" } },
|
|
},
|
|
{
|
|
type: "value",
|
|
min: 0,
|
|
max: 100,
|
|
name: t("gradeAnalyticsScript.passRate"),
|
|
axisLabel: { formatter: "{value}%" },
|
|
splitLine: { show: false },
|
|
},
|
|
],
|
|
series: [
|
|
{
|
|
name: t("gradeAnalyticsScript.rangeStart"),
|
|
type: "bar",
|
|
stack: "range",
|
|
silent: true,
|
|
itemStyle: { color: "transparent" },
|
|
data: benchmarks.map((x: any) => x.lowestScore),
|
|
},
|
|
{
|
|
name: t("gradeAnalyticsScript.scoreRange"),
|
|
type: "bar",
|
|
stack: "range",
|
|
barWidth: 20,
|
|
itemStyle: { color: "#a7b8cf", borderRadius: 6 },
|
|
data: benchmarks.map((x: any) => x.highestScore - x.lowestScore),
|
|
},
|
|
{
|
|
name: t("gradeAnalyticsScript.averageScore"),
|
|
type: "line",
|
|
symbolSize: 9,
|
|
lineStyle: { color: "#204f87", width: 3 },
|
|
itemStyle: { color: "#204f87" },
|
|
data: benchmarks.map((x: any) => x.averageScore),
|
|
},
|
|
{
|
|
name: t("gradeAnalyticsScript.passRate"),
|
|
type: "line",
|
|
yAxisIndex: 1,
|
|
symbol: "diamond",
|
|
symbolSize: 9,
|
|
lineStyle: { color: "#b8732d", type: "dashed", width: 2 },
|
|
itemStyle: { color: "#b8732d" },
|
|
data: benchmarks.map((x: any) => x.passRate),
|
|
},
|
|
],
|
|
});
|
|
|
|
drawHistoryChart();
|
|
}
|
|
|
|
function drawHistoryChart() {
|
|
const old = charts.find((chart) => chart.getDom() === historyElement.value);
|
|
if (old) {
|
|
old.dispose();
|
|
charts.splice(charts.indexOf(old), 1);
|
|
}
|
|
const history = report.value?.history ?? [];
|
|
const chart = createChart(historyElement.value);
|
|
if (!chart) return;
|
|
const field =
|
|
historyMetric.value === "average"
|
|
? "AverageScore"
|
|
: historyMetric.value === "passRate"
|
|
? "PassRate"
|
|
: "ExcellentRate";
|
|
const courseField = `course${field}`;
|
|
const instructorField = field[0].toLowerCase() + field.slice(1);
|
|
const seriesType = history.length >= 4 ? "line" : "bar";
|
|
chart.setOption({
|
|
aria: { enabled: true, decal: { show: true } },
|
|
tooltip: {
|
|
trigger: "axis",
|
|
valueFormatter: (v: any) =>
|
|
`${number(v)}${historyMetricMeta.value.suffix}`,
|
|
},
|
|
legend: {
|
|
top: 0,
|
|
data: [
|
|
historyMetricMeta.value.course,
|
|
historyMetricMeta.value.instructor,
|
|
],
|
|
},
|
|
grid: { left: 46, right: 28, top: 58, bottom: 54, containLabel: true },
|
|
xAxis: {
|
|
type: "category",
|
|
data: history.map((x: any) => x.termName),
|
|
axisLabel: { rotate: history.length > 5 ? 24 : 0 },
|
|
},
|
|
yAxis: {
|
|
type: "value",
|
|
min: 0,
|
|
max: 100,
|
|
name: historyMetricMeta.value.label,
|
|
axisLabel: {
|
|
formatter: historyMetric.value === "average" ? "{value}" : "{value}%",
|
|
},
|
|
splitLine: { lineStyle: { color: "#edf1f6" } },
|
|
},
|
|
series: [
|
|
{
|
|
name: historyMetricMeta.value.course,
|
|
type: seriesType,
|
|
smooth: seriesType === "line",
|
|
symbol: "circle",
|
|
symbolSize: 8,
|
|
barMaxWidth: 34,
|
|
itemStyle: { color: "#9eafc5" },
|
|
lineStyle: { color: "#9eafc5", width: 2 },
|
|
data: history.map((x: any) => x[courseField]),
|
|
},
|
|
{
|
|
name: historyMetricMeta.value.instructor,
|
|
type: seriesType,
|
|
smooth: seriesType === "line",
|
|
symbol: "diamond",
|
|
symbolSize: 9,
|
|
barMaxWidth: 34,
|
|
itemStyle: { color: "#204f87" },
|
|
lineStyle: { color: "#204f87", width: 3 },
|
|
data: history.map((x: any) => x.instructor?.[instructorField] ?? null),
|
|
},
|
|
],
|
|
});
|
|
}
|
|
|
|
function resizeCharts() {
|
|
charts.forEach((chart) => chart.resize());
|
|
}
|
|
|
|
watch(locale, async () => {
|
|
await nextTick();
|
|
if (summary.value) drawCharts();
|
|
});
|
|
|
|
watch(historyMetric, async () => {
|
|
await nextTick();
|
|
drawHistoryChart();
|
|
});
|
|
|
|
onMounted(async () => {
|
|
try {
|
|
const [termResponse, collegeResponse] = await Promise.all([
|
|
http.get("/base-data/terms"),
|
|
http.get("/base-data/colleges"),
|
|
]);
|
|
terms.value = termResponse.data;
|
|
colleges.value = collegeResponse.data;
|
|
termId.value = defaultAcademicTermId(terms.value);
|
|
} catch (error) {
|
|
ElMessage.error(apiErrorMessage(error));
|
|
}
|
|
await loadClasses(true);
|
|
window.addEventListener("resize", resizeCharts);
|
|
});
|
|
|
|
onBeforeUnmount(() => {
|
|
window.removeEventListener("resize", resizeCharts);
|
|
disposeCharts();
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<div class="page-stack grade-analytics">
|
|
<section class="page-intro analytics-intro">
|
|
<div>
|
|
<span class="section-kicker">TEACHING CLASS ANALYTICS</span>
|
|
<h2>{{ t("workflowBatch.teachingClassGradeAnalysis") }}</h2>
|
|
<p>
|
|
{{
|
|
t(
|
|
"workflowBatch.compareThisTeachingClassWithOtherClassesStudentGroupsAndHistoricalResultsOnlyPublishedGradesAreIncluded",
|
|
)
|
|
}}
|
|
</p>
|
|
</div>
|
|
<div class="intro-actions">
|
|
<el-button
|
|
v-if="canManageSchedule"
|
|
:icon="Setting"
|
|
@click="openScheduleSettings"
|
|
>{{ t("workflowBatch.scheduledRefreshSettings") }}</el-button
|
|
>
|
|
<el-button :icon="Refresh" @click="refreshStatistics">{{
|
|
t("workflowBatch.recalculateThisTeachingClass")
|
|
}}</el-button>
|
|
</div>
|
|
</section>
|
|
|
|
<el-radio-group
|
|
v-if="canViewCourseOverview"
|
|
v-model="analysisMode"
|
|
class="analysis-mode"
|
|
@change="switchAnalysisMode(analysisMode)"
|
|
>
|
|
<el-radio-button value="classes">{{
|
|
t("workflowBatch.teachingClassAnalysis")
|
|
}}</el-radio-button>
|
|
<el-radio-button value="courses">{{
|
|
t("workflowBatch.courseWideAnalysis")
|
|
}}</el-radio-button>
|
|
</el-radio-group>
|
|
|
|
<el-dialog
|
|
v-model="scheduleDialogVisible"
|
|
:title="
|
|
t('workflowBatch.scheduledGradeStatisticsAndAcademicOverviewRefresh')
|
|
"
|
|
width="520px"
|
|
>
|
|
<el-form v-loading="scheduleLoading" label-width="130px">
|
|
<el-form-item :label="t('workflowBatch.enableScheduledRefresh')">
|
|
<el-switch v-model="schedule.isEnabled" />
|
|
</el-form-item>
|
|
<el-form-item :label="t('workflowBatch.refreshInterval')">
|
|
<el-input-number
|
|
v-model="schedule.intervalMinutes"
|
|
:min="1"
|
|
:max="1440"
|
|
:disabled="!schedule.isEnabled"
|
|
/>
|
|
<span class="schedule-unit">{{ t("workflowBatch.minutes") }}</span>
|
|
</el-form-item>
|
|
<el-form-item :label="t('workflowBatch.maximumPerRun')">
|
|
<el-input-number
|
|
v-model="schedule.batchSize"
|
|
:min="1"
|
|
:max="5000"
|
|
:step="50"
|
|
:disabled="!schedule.isEnabled"
|
|
/>
|
|
<span class="schedule-unit">{{
|
|
t("workflowBatch.courseTermsAlsoRefreshesAcademicOverview")
|
|
}}</span>
|
|
</el-form-item>
|
|
<el-form-item :label="t('baseData.operationalStatus')">
|
|
<div class="schedule-status">
|
|
<span>{{
|
|
t("gradeAnalysisTemplate.lastScanValue", {
|
|
value: schedule.lastRunAt
|
|
? new Date(schedule.lastRunAt).toLocaleString(
|
|
getDisplayLocale(),
|
|
)
|
|
: t("gradeAnalysisTemplate.neverRun"),
|
|
})
|
|
}}</span>
|
|
<span v-if="schedule.isEnabled">{{
|
|
t("gradeAnalysisTemplate.nextScanValue", {
|
|
value: schedule.nextRunAt
|
|
? new Date(schedule.nextRunAt).toLocaleString(
|
|
getDisplayLocale(),
|
|
)
|
|
: t("gradeAnalysisTemplate.willRunShortlyAfterBeingEnabled"),
|
|
})
|
|
}}</span>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form>
|
|
<template #footer>
|
|
<el-button @click="scheduleDialogVisible = false">{{
|
|
t("businessLabels.cancel")
|
|
}}</el-button>
|
|
<el-button
|
|
type="primary"
|
|
:loading="scheduleSaving"
|
|
@click="saveScheduleSettings"
|
|
>{{ t("workflowBatch.saveSettings") }}</el-button
|
|
>
|
|
</template>
|
|
</el-dialog>
|
|
|
|
<section class="filter-bar">
|
|
<el-select
|
|
v-model="termId"
|
|
clearable
|
|
:placeholder="t('businessLabels.allTerms')"
|
|
style="width: 240px"
|
|
@change="reloadCurrent(true)"
|
|
>
|
|
<el-option
|
|
v-for="term in terms"
|
|
:key="term.id"
|
|
:label="academicTermLabel(term)"
|
|
:value="term.id"
|
|
/>
|
|
</el-select>
|
|
<el-select
|
|
v-model="collegeId"
|
|
clearable
|
|
:placeholder="t('courses.allColleges')"
|
|
style="width: 190px"
|
|
@change="reloadCurrent(true)"
|
|
>
|
|
<el-option
|
|
v-for="college in colleges"
|
|
:key="college.id"
|
|
:label="college.name"
|
|
:value="college.id"
|
|
/>
|
|
</el-select>
|
|
<el-input
|
|
v-model="keyword"
|
|
clearable
|
|
:placeholder="
|
|
analysisMode === 'courses'
|
|
? t('gradeAnalysisTemplate.courseNameOrCode')
|
|
: t('gradeAnalysisTemplate.courseOrTeachingClassNameOrNumber')
|
|
"
|
|
:prefix-icon="Search"
|
|
@keyup.enter="reloadCurrent(true)"
|
|
/>
|
|
<el-input
|
|
v-if="analysisMode === 'classes'"
|
|
v-model="teacherKeyword"
|
|
clearable
|
|
:placeholder="t('batchBusiness.instructorNameOrEmployeeNumber')"
|
|
:prefix-icon="Search"
|
|
@keyup.enter="loadClasses(true)"
|
|
@clear="loadClasses(true)"
|
|
/>
|
|
<el-checkbox v-model="riskOnly" @change="reloadCurrent(true)">{{
|
|
t(
|
|
analysisMode === "courses"
|
|
? "gradeAnalysisTemplate.showFlaggedCoursesOnly"
|
|
: "gradeAnalysisTemplate.showFlaggedClassesOnly",
|
|
)
|
|
}}</el-checkbox>
|
|
<el-button type="primary" @click="reloadCurrent(true)">{{
|
|
t("businessLabels.search")
|
|
}}</el-button>
|
|
<el-button :icon="Refresh" @click="resetFilters">{{
|
|
t("businessLabels.reset")
|
|
}}</el-button>
|
|
</section>
|
|
|
|
<section v-if="analysisMode === 'classes'" class="analytics-shell">
|
|
<aside class="class-rail" v-loading="loading">
|
|
<header>
|
|
<strong>{{ t("workflowBatch.availableTeachingClasses") }}</strong
|
|
><small>{{
|
|
t("gradeAnalysisTemplate.countWithStatistics", { count: total })
|
|
}}</small>
|
|
</header>
|
|
<button
|
|
v-for="item in classes"
|
|
:key="item.gradeSheetId"
|
|
type="button"
|
|
:class="[
|
|
'class-option',
|
|
{ active: selected?.gradeSheetId === item.gradeSheetId },
|
|
]"
|
|
@click="loadReport(item)"
|
|
>
|
|
<span class="course-code"
|
|
>{{ item.courseCode }} · {{ item.taskNumber }}</span
|
|
>
|
|
<strong>{{ item.courseName }}</strong>
|
|
<small>{{
|
|
t("gradeAnalysisTemplate.teachersCountStudents", {
|
|
teachers:
|
|
item.teacherNames.join(t("academicPlanning.separator")) ||
|
|
t("gradeAnalysisTemplate.instructorNotSpecified"),
|
|
count: item.studentCount,
|
|
})
|
|
}}</small>
|
|
<span class="option-metrics">{{
|
|
t("gradeAnalysisTemplate.averageAveragePassRateRate", {
|
|
average: number(item.averageScore),
|
|
rate: number(item.passRate),
|
|
})
|
|
}}</span>
|
|
</button>
|
|
<el-empty
|
|
v-if="!loading && !classes.length"
|
|
:image-size="72"
|
|
:description="
|
|
t('workflowBatch.noPublishedGradeStatisticsInYourScope')
|
|
"
|
|
/>
|
|
<el-pagination
|
|
v-if="total > pageSize"
|
|
small
|
|
layout="prev, pager, next"
|
|
:total="total"
|
|
:page-size="pageSize"
|
|
v-model:current-page="page"
|
|
@current-change="loadClasses()"
|
|
/>
|
|
</aside>
|
|
|
|
<main class="analysis-canvas" v-loading="reportLoading">
|
|
<el-empty
|
|
v-if="!selected"
|
|
:description="t('workflowBatch.selectATeachingClassToViewAnalysis')"
|
|
/>
|
|
<el-alert
|
|
v-else-if="report?.isRefreshing"
|
|
type="info"
|
|
:closable="false"
|
|
:title="
|
|
t(
|
|
'workflowBatch.statisticsForThisTeachingClassAreBeingGeneratedRefreshLater',
|
|
)
|
|
"
|
|
/>
|
|
<template v-else-if="summary">
|
|
<header class="report-heading">
|
|
<div>
|
|
<span
|
|
>{{ report.courseCode }} · {{ report.taskNumber }} ·
|
|
{{ report.termName }}</span
|
|
>
|
|
<h3>{{ report.courseName }}</h3>
|
|
<p>
|
|
{{
|
|
t("gradeAnalysisTemplate.nameDataUpdatedTime", {
|
|
name: report.taskName,
|
|
time: new Date(summary.calculatedAt).toLocaleString(
|
|
getDisplayLocale(),
|
|
),
|
|
})
|
|
}}
|
|
</p>
|
|
</div>
|
|
<div class="report-actions">
|
|
<el-button
|
|
type="primary"
|
|
plain
|
|
:icon="Download"
|
|
:loading="exporting"
|
|
@click="exportWordReport"
|
|
>{{ t("workflowBatch.exportWordReport") }}</el-button
|
|
>
|
|
<div class="sample-stamp">
|
|
<b>{{ summary.studentCount }}</b
|
|
><span>{{ t("workflowBatch.validGrades") }}</span>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<section class="kpi-strip">
|
|
<article>
|
|
<span>{{ t("courseStats.average") }}</span
|
|
><strong>{{ number(summary.averageScore) }}</strong
|
|
><small>{{ t("workflowBatch.allValidGrades") }}</small>
|
|
</article>
|
|
<article>
|
|
<span>{{ t("workflowBatch.median") }}</span
|
|
><strong>{{ number(summary.medianScore) }}</strong
|
|
><small>{{ t("workflowBatch.lessSensitiveToOutliers") }}</small>
|
|
</article>
|
|
<article>
|
|
<span>{{ t("workflowBatch.standardDeviation") }}</span
|
|
><strong>{{ number(summary.standardDeviation, 2) }}</strong
|
|
><small>{{
|
|
t("workflowBatch.aHigherValueIndicatesMoreDispersedScores")
|
|
}}</small>
|
|
</article>
|
|
<article>
|
|
<span>{{ t("workflowBatch.highestLowest") }}</span
|
|
><strong
|
|
>{{ number(summary.highestScore) }} /
|
|
{{ number(summary.lowestScore) }}</strong
|
|
><small>{{
|
|
t("gradeAnalysisTemplate.scoreRangeValue", {
|
|
value: number(summary.highestScore - summary.lowestScore),
|
|
})
|
|
}}</small>
|
|
</article>
|
|
<article>
|
|
<span>{{ t("courseStats.passRate") }}</span
|
|
><strong>{{ number(summary.passRate) }}%</strong
|
|
><small
|
|
>{{ summary.passedCount }} / {{ summary.studentCount }}
|
|
{{ t("graduationAudits.people") }}</small
|
|
>
|
|
</article>
|
|
<article>
|
|
<span>{{ t("workflowBatch.excellentRate") }}</span
|
|
><strong>{{ number(summary.excellentRate) }}%</strong
|
|
><small>{{
|
|
t("gradeAnalysisTemplate.countStudentsScoredAtLeast90", {
|
|
count: summary.excellentCount,
|
|
})
|
|
}}</small>
|
|
</article>
|
|
</section>
|
|
|
|
<section v-if="delta" class="benchmark-note">
|
|
<span>{{
|
|
t("workflowBatch.comparedWithTheUniversityWideCourseThisTerm")
|
|
}}</span>
|
|
<strong :class="{ negative: delta.averageScoreDifference < 0 }">{{
|
|
t("gradeAnalysisTemplate.averageScoreValue", {
|
|
value: t("approvalBatch.scorePoints", {
|
|
score: signed(delta.averageScoreDifference),
|
|
}),
|
|
})
|
|
}}</strong>
|
|
<strong :class="{ negative: delta.passRateDifference < 0 }"
|
|
>{{ t("courseStats.passRate") }}
|
|
{{ signed(delta.passRateDifference, "%") }}</strong
|
|
>
|
|
<small>{{
|
|
t(
|
|
"gradeAnalysisTemplate.universityBenchmarkAverageAveragePassRateRate",
|
|
{
|
|
average: number(delta.universityAverageScore),
|
|
rate: number(delta.universityPassRate),
|
|
},
|
|
)
|
|
}}</small>
|
|
</section>
|
|
|
|
<section class="chart-grid">
|
|
<article class="chart-card">
|
|
<header>
|
|
<div>
|
|
<span>DISTRIBUTION</span>
|
|
<h4>
|
|
{{
|
|
t("workflowBatch.gradeDistributionForThisTeachingClass")
|
|
}}
|
|
</h4>
|
|
</div>
|
|
<p>
|
|
{{
|
|
t(
|
|
"gradeAnalysisTemplate.countStudentsInFiveFixedScoreBands",
|
|
{ count: summary.studentCount },
|
|
)
|
|
}}
|
|
</p>
|
|
</header>
|
|
<div ref="distributionElement" class="chart" />
|
|
</article>
|
|
<article class="chart-card">
|
|
<header>
|
|
<div>
|
|
<span>PEER AVERAGE</span>
|
|
<h4>{{ t("workflowBatch.averageScoresByTeachingClass") }}</h4>
|
|
</div>
|
|
<p>
|
|
{{
|
|
t("workflowBatch.thisTeachingClassIsShownInADarkerColor")
|
|
}}
|
|
</p>
|
|
</header>
|
|
<div ref="peerAverageElement" class="chart" />
|
|
</article>
|
|
<article class="chart-card">
|
|
<header>
|
|
<div>
|
|
<span>PEER PASS RATE</span>
|
|
<h4>{{ t("workflowBatch.passRatesByTeachingClass") }}</h4>
|
|
</div>
|
|
<p>
|
|
{{
|
|
t(
|
|
"workflowBatch.comparisonAcrossClassesOfTheSameCourseAndTerm",
|
|
)
|
|
}}
|
|
</p>
|
|
</header>
|
|
<div ref="peerPassElement" class="chart" />
|
|
</article>
|
|
<article class="chart-card chart-card-wide">
|
|
<header>
|
|
<div>
|
|
<span>SCOPE BENCHMARK</span>
|
|
<h4>
|
|
{{
|
|
t(
|
|
"workflowBatch.classMajorCollegeAndUniversityBenchmarks",
|
|
)
|
|
}}
|
|
</h4>
|
|
</div>
|
|
<p>
|
|
{{
|
|
t(
|
|
"workflowBatch.scoreRangesAveragesAndPassRatesForTheGroupsRepresentedInThisClass",
|
|
)
|
|
}}
|
|
</p>
|
|
</header>
|
|
<div ref="benchmarkElement" class="chart chart-large" />
|
|
</article>
|
|
<article class="chart-card chart-card-wide">
|
|
<header class="history-heading">
|
|
<div>
|
|
<span>HISTORICAL COMPARISON</span>
|
|
<h4>
|
|
{{
|
|
t(
|
|
"workflowBatch.historicalComparisonOfCurrentInstructorsAndTheUniversityWideCourse",
|
|
)
|
|
}}
|
|
</h4>
|
|
</div>
|
|
<el-radio-group v-model="historyMetric" size="small">
|
|
<el-radio-button value="average">{{
|
|
t("courseStats.average")
|
|
}}</el-radio-button>
|
|
<el-radio-button value="passRate">{{
|
|
t("courseStats.passRate")
|
|
}}</el-radio-button>
|
|
<el-radio-button value="excellentRate">{{
|
|
t("workflowBatch.excellentRate")
|
|
}}</el-radio-button>
|
|
</el-radio-group>
|
|
</header>
|
|
<p class="chart-caption">
|
|
{{
|
|
t(
|
|
"workflowBatch.instructorResultsAreWeightedAcrossTheirClassesForTheSameCourseInEachTermUniversityResultsIncludeAllPublishedGradesForThatCourseAndTerm",
|
|
)
|
|
}}
|
|
</p>
|
|
<div ref="historyElement" class="chart chart-large" />
|
|
</article>
|
|
</section>
|
|
</template>
|
|
</main>
|
|
</section>
|
|
|
|
<section v-else class="analytics-shell course-overview-shell">
|
|
<aside class="class-rail" v-loading="loading">
|
|
<header>
|
|
<strong>{{ t("workflowBatch.availableCourses") }}</strong
|
|
><small>{{
|
|
t("gradeAnalysisTemplate.countWithStatistics", {
|
|
count: courseTotal,
|
|
})
|
|
}}</small>
|
|
</header>
|
|
<button
|
|
v-for="item in courses"
|
|
:key="item.courseId"
|
|
type="button"
|
|
:class="[
|
|
'class-option',
|
|
{ active: selectedCourse?.courseId === item.courseId },
|
|
]"
|
|
@click="loadCourseReport(item)"
|
|
>
|
|
<span class="course-code"
|
|
>{{ item.courseCode }} · {{ item.collegeName }}</span
|
|
>
|
|
<strong>{{ item.courseName }}</strong>
|
|
<small>{{
|
|
t("gradeAnalysisTemplate.classesTeachingClassesStudentsStudents", {
|
|
classes: item.teachingClassCount,
|
|
students: item.studentCount,
|
|
})
|
|
}}</small>
|
|
<span class="option-metrics">{{
|
|
t("gradeAnalysisTemplate.averageAveragePassRateRate", {
|
|
average: number(item.averageScore),
|
|
rate: number(item.passRate),
|
|
})
|
|
}}</span>
|
|
</button>
|
|
<el-empty
|
|
v-if="!loading && !courses.length"
|
|
:image-size="72"
|
|
:description="
|
|
t('workflowBatch.noPublishedGradeStatisticsInYourScope')
|
|
"
|
|
/>
|
|
<el-pagination
|
|
v-if="courseTotal > pageSize"
|
|
small
|
|
layout="prev, pager, next"
|
|
:total="courseTotal"
|
|
:page-size="pageSize"
|
|
v-model:current-page="coursePage"
|
|
@current-change="loadCourses()"
|
|
/>
|
|
</aside>
|
|
|
|
<main class="analysis-canvas" v-loading="courseReportLoading">
|
|
<el-empty
|
|
v-if="!selectedCourse"
|
|
:description="t('workflowBatch.selectACourseToViewOverallAnalysis')"
|
|
/>
|
|
<template v-else-if="courseReport?.summary">
|
|
<header class="report-heading">
|
|
<div>
|
|
<span
|
|
>{{ courseReport.summary.courseCode }} ·
|
|
{{ courseReport.summary.collegeName }}</span
|
|
>
|
|
<h3>
|
|
{{
|
|
t("gradeAnalysisTemplate.nameCourseWideAnalysis", {
|
|
name: courseReport.summary.courseName,
|
|
})
|
|
}}
|
|
</h3>
|
|
<p>
|
|
{{
|
|
t(
|
|
"gradeAnalysisTemplate.coversTermsTermsAndClassesTeachingClassesOnlyPublishedGradesAreIncluded",
|
|
{
|
|
terms: courseReport.summary.termCount,
|
|
classes: courseReport.summary.teachingClassCount,
|
|
},
|
|
)
|
|
}}
|
|
</p>
|
|
</div>
|
|
<div class="report-actions">
|
|
<el-button
|
|
type="primary"
|
|
plain
|
|
:icon="Download"
|
|
:loading="courseExporting"
|
|
@click="exportCourseWordReport"
|
|
>{{ t("workflowBatch.exportWordReport") }}</el-button
|
|
>
|
|
<div class="sample-stamp">
|
|
<b>{{ courseReport.summary.studentCount }}</b
|
|
><span>{{ t("workflowBatch.validGrades") }}</span>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
<section class="kpi-strip">
|
|
<article>
|
|
<span>{{ t("courseStats.average") }}</span
|
|
><strong>{{ number(courseReport.summary.averageScore) }}</strong
|
|
><small>{{ t("workflowBatch.weightedByStudentCount") }}</small>
|
|
</article>
|
|
<article>
|
|
<span>{{ t("courseStats.passRate") }}</span
|
|
><strong>{{ number(courseReport.summary.passRate) }}%</strong
|
|
><small
|
|
>{{ courseReport.summary.passedCount }} /
|
|
{{ courseReport.summary.studentCount }}
|
|
{{ t("graduationAudits.people") }}</small
|
|
>
|
|
</article>
|
|
<article>
|
|
<span>{{ t("workflowBatch.excellentRate") }}</span
|
|
><strong>{{ number(courseReport.summary.excellentRate) }}%</strong
|
|
><small>{{
|
|
t("gradeAnalysisTemplate.countStudentsScoredAtLeast90", {
|
|
count: courseReport.summary.excellentCount,
|
|
})
|
|
}}</small>
|
|
</article>
|
|
<article>
|
|
<span>{{ t("workflowBatch.highestLowest") }}</span
|
|
><strong
|
|
>{{ number(courseReport.summary.highestScore) }} /
|
|
{{ number(courseReport.summary.lowestScore) }}</strong
|
|
><small>{{
|
|
t("gradeAnalysisTemplate.scoreRangeValue", {
|
|
value: number(
|
|
courseReport.summary.highestScore -
|
|
courseReport.summary.lowestScore,
|
|
),
|
|
})
|
|
}}</small>
|
|
</article>
|
|
<article>
|
|
<span>{{ t("workflowBatch.teachingClasses") }}</span
|
|
><strong>{{ courseReport.summary.teachingClassCount }}</strong
|
|
><small>{{ t("workflowBatch.teachingClassesOffered") }}</small>
|
|
</article>
|
|
<article>
|
|
<span>{{ t("workflowBatch.dataUpdated") }}</span
|
|
><strong class="date-metric">{{
|
|
new Date(courseReport.summary.calculatedAt).toLocaleDateString(
|
|
getDisplayLocale(),
|
|
)
|
|
}}</strong
|
|
><small>{{
|
|
t("workflowBatch.basedOnTheMostRecentRefresh")
|
|
}}</small>
|
|
</article>
|
|
</section>
|
|
<section class="detail-grid">
|
|
<article class="detail-card">
|
|
<h4>{{ t("workflowBatch.scoreDistribution") }}</h4>
|
|
<el-table :data="courseReport.distribution" size="small" stripe>
|
|
<el-table-column
|
|
prop="label"
|
|
:label="t('courseStats.scoreBand')"
|
|
/>
|
|
<el-table-column
|
|
prop="studentCount"
|
|
:label="t('businessLabels.count')"
|
|
align="right"
|
|
/>
|
|
<el-table-column
|
|
:label="t('workflowBatch.percentage')"
|
|
align="right"
|
|
><template #default="scope"
|
|
>{{
|
|
number(
|
|
(scope.row.studentCount /
|
|
courseReport.summary.studentCount) *
|
|
100,
|
|
1,
|
|
)
|
|
}}%</template
|
|
></el-table-column
|
|
>
|
|
</el-table>
|
|
</article>
|
|
<article class="detail-card">
|
|
<h4>{{ t("workflowBatch.trendsByTerm") }}</h4>
|
|
<el-table :data="courseReport.terms" size="small" stripe>
|
|
<el-table-column
|
|
prop="termName"
|
|
:label="t('businessLabels.term')"
|
|
min-width="110"
|
|
/>
|
|
<el-table-column
|
|
prop="studentCount"
|
|
:label="t('businessLabels.count')"
|
|
align="right"
|
|
/>
|
|
<el-table-column :label="t('courseStats.average')" align="right"
|
|
><template #default="scope">{{
|
|
number(scope.row.averageScore)
|
|
}}</template></el-table-column
|
|
>
|
|
<el-table-column
|
|
:label="t('courseStats.passRate')"
|
|
align="right"
|
|
><template #default="scope"
|
|
>{{ number(scope.row.passRate) }}%</template
|
|
></el-table-column
|
|
>
|
|
</el-table>
|
|
</article>
|
|
<article class="detail-card">
|
|
<h4>{{ t("workflowBatch.studentsByCollege") }}</h4>
|
|
<el-table :data="courseReport.studentOrigins" size="small" stripe>
|
|
<el-table-column
|
|
prop="collegeName"
|
|
:label="t('businessLabels.college')"
|
|
min-width="110"
|
|
/>
|
|
<el-table-column
|
|
prop="studentCount"
|
|
:label="t('businessLabels.count')"
|
|
align="right"
|
|
/>
|
|
<el-table-column :label="t('courseStats.average')" align="right"
|
|
><template #default="scope">{{
|
|
number(scope.row.averageScore)
|
|
}}</template></el-table-column
|
|
>
|
|
<el-table-column
|
|
:label="t('courseStats.passRate')"
|
|
align="right"
|
|
><template #default="scope"
|
|
>{{ number(scope.row.passRate) }}%</template
|
|
></el-table-column
|
|
>
|
|
</el-table>
|
|
</article>
|
|
</section>
|
|
<section class="detail-card teaching-class-detail">
|
|
<h4>{{ t("workflowBatch.teachingClassComparison") }}</h4>
|
|
<el-table
|
|
:data="courseReport.teachingClasses"
|
|
size="small"
|
|
stripe
|
|
max-height="360"
|
|
>
|
|
<el-table-column
|
|
prop="termName"
|
|
:label="t('businessLabels.term')"
|
|
width="110"
|
|
/>
|
|
<el-table-column
|
|
prop="taskNumber"
|
|
:label="t('batchBusiness.teachingClass')"
|
|
width="115"
|
|
/>
|
|
<el-table-column
|
|
prop="teacherNames"
|
|
:label="t('batchBusiness.instructor')"
|
|
min-width="110"
|
|
/>
|
|
<el-table-column
|
|
prop="studentCount"
|
|
:label="t('businessLabels.count')"
|
|
align="right"
|
|
width="70"
|
|
/>
|
|
<el-table-column
|
|
:label="t('courseStats.average')"
|
|
align="right"
|
|
width="85"
|
|
><template #default="scope">{{
|
|
number(scope.row.averageScore)
|
|
}}</template></el-table-column
|
|
>
|
|
<el-table-column
|
|
:label="t('workflowBatch.median')"
|
|
align="right"
|
|
width="85"
|
|
><template #default="scope">{{
|
|
number(scope.row.medianScore)
|
|
}}</template></el-table-column
|
|
>
|
|
<el-table-column
|
|
:label="t('workflowBatch.standardDeviation')"
|
|
align="right"
|
|
width="85"
|
|
><template #default="scope">{{
|
|
number(scope.row.standardDeviation, 2)
|
|
}}</template></el-table-column
|
|
>
|
|
<el-table-column
|
|
:label="t('courseStats.passRate')"
|
|
align="right"
|
|
width="85"
|
|
><template #default="scope"
|
|
>{{ number(scope.row.passRate) }}%</template
|
|
></el-table-column
|
|
>
|
|
<el-table-column
|
|
:label="t('workflowBatch.excellentRate')"
|
|
align="right"
|
|
width="85"
|
|
><template #default="scope"
|
|
>{{ number(scope.row.excellentRate) }}%</template
|
|
></el-table-column
|
|
>
|
|
</el-table>
|
|
</section>
|
|
</template>
|
|
</main>
|
|
</section>
|
|
|
|
<section
|
|
v-if="commentCourseId"
|
|
class="analytics-comments"
|
|
v-loading="commentsLoading"
|
|
>
|
|
<header>
|
|
<div>
|
|
<span>DISCUSSION</span>
|
|
<h3>
|
|
{{
|
|
t("gradeAnalysisTemplate.nameCourseDiscussion", {
|
|
name: commentCourseName,
|
|
})
|
|
}}
|
|
</h3>
|
|
<p>
|
|
{{
|
|
t(
|
|
"workflowBatch.commentsBelongToThisCourseAnonymousCommentsHideTheNameButTheSystemRetainsTheAuthorForSelfDeletionAndAdministration",
|
|
)
|
|
}}
|
|
</p>
|
|
</div>
|
|
<el-button
|
|
:icon="Refresh"
|
|
circle
|
|
:aria-label="t('workflowBatch.refreshComments')"
|
|
@click="loadComments(true)"
|
|
/>
|
|
</header>
|
|
<el-input
|
|
v-model="commentContent"
|
|
type="textarea"
|
|
:rows="3"
|
|
maxlength="1000"
|
|
show-word-limit
|
|
:placeholder="
|
|
t(
|
|
'workflowBatch.shareThoughtsOnGradeTrendsTeachingImprovementsOrStatistics',
|
|
)
|
|
"
|
|
/>
|
|
<div class="comment-compose-actions">
|
|
<el-checkbox v-model="commentAnonymous">{{
|
|
t("discussion.anonymousPublish")
|
|
}}</el-checkbox>
|
|
<el-button
|
|
type="primary"
|
|
:loading="commentSubmitting"
|
|
@click="submitComment"
|
|
>{{ t("discussion.publish") }}</el-button
|
|
>
|
|
</div>
|
|
<el-empty
|
|
v-if="!commentsLoading && !comments.length"
|
|
:image-size="64"
|
|
:description="t('discussion.empty')"
|
|
/>
|
|
<ol v-else class="comment-list">
|
|
<li v-for="comment in comments" :key="comment.id">
|
|
<div class="comment-meta">
|
|
<strong>{{
|
|
comment.authorName || t("gradeAnalysisTemplate.unnamedUser")
|
|
}}</strong
|
|
><span v-if="comment.isAnonymous">{{
|
|
t("discussion.anonymous")
|
|
}}</span
|
|
><time>{{
|
|
new Date(comment.createdAt).toLocaleString(getDisplayLocale())
|
|
}}</time>
|
|
</div>
|
|
<p>{{ comment.content }}</p>
|
|
<div class="comment-actions">
|
|
<el-button
|
|
text
|
|
size="small"
|
|
:type="comment.hasLiked ? 'primary' : 'default'"
|
|
@click="toggleReaction(comment, 'Like')"
|
|
>{{ t("discussion.reactions.Like") }}
|
|
{{ comment.likeCount }}</el-button
|
|
>
|
|
<el-button
|
|
text
|
|
size="small"
|
|
:type="comment.hasInsightful ? 'primary' : 'default'"
|
|
@click="toggleReaction(comment, 'Insightful')"
|
|
>{{ t("discussion.reactions.Insightful") }}
|
|
{{ comment.insightfulCount }}</el-button
|
|
>
|
|
<el-button
|
|
text
|
|
size="small"
|
|
:type="comment.hasAgreed ? 'primary' : 'default'"
|
|
@click="toggleReaction(comment, 'Agree')"
|
|
>{{ t("discussion.reactions.Agree") }}
|
|
{{ comment.agreeCount }}</el-button
|
|
>
|
|
<el-button text size="small" @click="toggleReplies(comment)"
|
|
>{{ t("discussion.reply")
|
|
}}{{
|
|
comment.replyCount ? ` (${comment.replyCount})` : ""
|
|
}}</el-button
|
|
>
|
|
<el-button
|
|
v-if="comment.canDelete"
|
|
text
|
|
type="danger"
|
|
size="small"
|
|
:icon="Delete"
|
|
@click="deleteComment(comment)"
|
|
>{{ t("businessLabels.delete") }}</el-button
|
|
>
|
|
</div>
|
|
<div
|
|
v-if="replyOpen[comment.id]"
|
|
class="reply-panel"
|
|
v-loading="replyLoading[comment.id]"
|
|
>
|
|
<ol v-if="comment.replies?.length" class="reply-list">
|
|
<li v-for="reply in comment.replies" :key="reply.id">
|
|
<div class="comment-meta">
|
|
<strong>{{ reply.authorName }}</strong
|
|
><span v-if="reply.isAnonymous">{{
|
|
t("discussion.anonymous")
|
|
}}</span
|
|
><time>{{
|
|
new Date(reply.createdAt).toLocaleString(getDisplayLocale())
|
|
}}</time>
|
|
</div>
|
|
<p>{{ reply.content }}</p>
|
|
<el-button
|
|
v-if="reply.canDelete"
|
|
text
|
|
type="danger"
|
|
size="small"
|
|
@click="deleteComment(reply)"
|
|
>{{ t("businessLabels.delete") }}</el-button
|
|
>
|
|
</li>
|
|
</ol>
|
|
<el-button
|
|
v-if="comment.repliesHasMore"
|
|
text
|
|
size="small"
|
|
:loading="replyLoading[comment.id]"
|
|
@click="loadReplies(comment)"
|
|
>{{ t("discussion.loadMoreReplies") }}</el-button
|
|
>
|
|
<el-input
|
|
v-model="replyDrafts[comment.id]"
|
|
type="textarea"
|
|
:rows="2"
|
|
maxlength="1000"
|
|
show-word-limit
|
|
:placeholder="t('discussion.replyPlaceholder')"
|
|
/>
|
|
<div class="reply-compose">
|
|
<el-checkbox v-model="replyAnonymous[comment.id]">{{
|
|
t("discussion.anonymousReply")
|
|
}}</el-checkbox
|
|
><el-button
|
|
type="primary"
|
|
size="small"
|
|
@click="submitReply(comment)"
|
|
>{{ t("discussion.reply") }}</el-button
|
|
>
|
|
</div>
|
|
</div>
|
|
</li>
|
|
</ol>
|
|
<div v-if="commentsHasMore" class="comment-load-more">
|
|
<el-button :loading="commentsLoading" @click="loadComments()">{{
|
|
t("discussion.loadMoreComments")
|
|
}}</el-button>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.grade-analytics {
|
|
--ink: #18324f;
|
|
--blue: #204f87;
|
|
--line: #dce3ec;
|
|
}
|
|
.analytics-intro {
|
|
align-items: flex-end;
|
|
}
|
|
.analysis-mode {
|
|
margin-top: -6px;
|
|
}
|
|
.filter-bar {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 12px;
|
|
align-items: center;
|
|
padding: 16px 18px;
|
|
background: #f7f9fc;
|
|
border: 1px solid var(--line);
|
|
}
|
|
.filter-bar > :deep(.el-input) {
|
|
width: min(100%, 280px);
|
|
}
|
|
.filter-bar > :deep(.el-checkbox) {
|
|
margin-right: 4px;
|
|
}
|
|
.analytics-shell {
|
|
display: grid;
|
|
grid-template-columns: 292px minmax(0, 1fr);
|
|
gap: 18px;
|
|
align-items: start;
|
|
}
|
|
.class-rail {
|
|
position: sticky;
|
|
top: 18px;
|
|
max-height: calc(100vh - 36px);
|
|
overflow: auto;
|
|
background: #f6f8fb;
|
|
border: 1px solid var(--line);
|
|
}
|
|
.class-rail > header {
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: 2;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
gap: 8px;
|
|
padding: 15px 16px;
|
|
background: #eef2f7;
|
|
border-bottom: 1px solid var(--line);
|
|
}
|
|
.class-rail > header small {
|
|
color: #667085;
|
|
}
|
|
.class-option {
|
|
width: 100%;
|
|
padding: 15px 16px;
|
|
border: 0;
|
|
border-bottom: 1px solid #e1e6ed;
|
|
background: transparent;
|
|
color: #475467;
|
|
text-align: left;
|
|
cursor: pointer;
|
|
transition:
|
|
background 0.18s ease,
|
|
box-shadow 0.18s ease;
|
|
}
|
|
.class-option:hover {
|
|
background: #fff;
|
|
}
|
|
.class-option.active {
|
|
background: #fff;
|
|
box-shadow: inset 4px 0 var(--blue);
|
|
}
|
|
.class-option:focus-visible {
|
|
outline: 2px solid var(--blue);
|
|
outline-offset: -3px;
|
|
}
|
|
.class-option > * {
|
|
display: block;
|
|
}
|
|
.class-option strong {
|
|
margin: 5px 0;
|
|
color: var(--ink);
|
|
font-size: 14px;
|
|
}
|
|
.class-option small {
|
|
overflow: hidden;
|
|
color: #667085;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
.course-code {
|
|
color: #5e6e82;
|
|
font:
|
|
11px Consolas,
|
|
monospace;
|
|
}
|
|
.option-metrics {
|
|
margin-top: 9px;
|
|
color: #667085;
|
|
font-size: 11px;
|
|
}
|
|
.option-metrics b {
|
|
color: var(--blue);
|
|
font:
|
|
700 13px Consolas,
|
|
monospace;
|
|
}
|
|
.class-rail :deep(.el-pagination) {
|
|
justify-content: center;
|
|
padding: 14px 4px;
|
|
}
|
|
.analysis-canvas {
|
|
min-width: 0;
|
|
}
|
|
.report-heading {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
gap: 20px;
|
|
padding: 22px 24px;
|
|
color: #fff;
|
|
background: var(--ink);
|
|
}
|
|
.report-heading span {
|
|
color: #b9c9da;
|
|
font:
|
|
11px Consolas,
|
|
monospace;
|
|
}
|
|
.report-heading h3 {
|
|
margin: 7px 0 5px;
|
|
font-size: 24px;
|
|
}
|
|
.report-heading p {
|
|
margin: 0;
|
|
color: #cbd5e1;
|
|
font-size: 12px;
|
|
}
|
|
.sample-stamp {
|
|
display: flex;
|
|
flex-direction: column;
|
|
min-width: 94px;
|
|
justify-content: center;
|
|
padding-left: 22px;
|
|
border-left: 1px solid rgb(255 255 255 / 20%);
|
|
}
|
|
.report-actions {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 18px;
|
|
}
|
|
.sample-stamp b {
|
|
font:
|
|
700 34px/1 Consolas,
|
|
monospace;
|
|
}
|
|
.sample-stamp span {
|
|
margin-top: 5px;
|
|
color: #b9c9da;
|
|
font-size: 11px;
|
|
}
|
|
.kpi-strip {
|
|
display: grid;
|
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
background: #fff;
|
|
border: 1px solid var(--line);
|
|
border-top: 0;
|
|
}
|
|
.kpi-strip article {
|
|
min-height: 112px;
|
|
padding: 17px 20px;
|
|
border-right: 1px solid var(--line);
|
|
border-bottom: 1px solid var(--line);
|
|
}
|
|
.kpi-strip article:nth-child(3n) {
|
|
border-right: 0;
|
|
}
|
|
.kpi-strip span,
|
|
.kpi-strip small {
|
|
display: block;
|
|
color: #667085;
|
|
}
|
|
.kpi-strip span {
|
|
font-size: 11px;
|
|
font-weight: 700;
|
|
}
|
|
.kpi-strip strong {
|
|
display: block;
|
|
margin: 10px 0 7px;
|
|
overflow-wrap: anywhere;
|
|
color: var(--ink);
|
|
font:
|
|
700 24px/1 Consolas,
|
|
monospace;
|
|
}
|
|
.kpi-strip small {
|
|
font-size: 10px;
|
|
}
|
|
.benchmark-note {
|
|
display: flex;
|
|
align-items: center;
|
|
flex-wrap: wrap;
|
|
gap: 12px 20px;
|
|
padding: 14px 18px;
|
|
background: #edf3fa;
|
|
border: 1px solid #ccd9e9;
|
|
border-top: 0;
|
|
}
|
|
.benchmark-note > span {
|
|
color: var(--ink);
|
|
font-weight: 700;
|
|
}
|
|
.benchmark-note strong {
|
|
color: var(--blue);
|
|
font:
|
|
700 13px Consolas,
|
|
monospace;
|
|
}
|
|
.benchmark-note strong.negative {
|
|
color: #9a5b28;
|
|
}
|
|
.benchmark-note small {
|
|
margin-left: auto;
|
|
color: #667085;
|
|
}
|
|
.chart-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
gap: 18px;
|
|
margin-top: 18px;
|
|
}
|
|
.chart-card {
|
|
min-width: 0;
|
|
padding: 20px 22px;
|
|
background: #fff;
|
|
border: 1px solid var(--line);
|
|
box-shadow: 0 10px 28px rgb(24 50 79 / 5%);
|
|
}
|
|
.chart-card-wide {
|
|
grid-column: 1 / -1;
|
|
}
|
|
.chart-card header {
|
|
display: flex;
|
|
min-width: 0;
|
|
align-items: end;
|
|
justify-content: space-between;
|
|
gap: 18px;
|
|
}
|
|
.chart-card header span {
|
|
color: #5e6e82;
|
|
font:
|
|
10px Consolas,
|
|
monospace;
|
|
letter-spacing: 0.08em;
|
|
}
|
|
.chart-card h4 {
|
|
margin: 5px 0 0;
|
|
color: var(--ink);
|
|
font-size: 16px;
|
|
}
|
|
.chart-card header p,
|
|
.chart-caption {
|
|
min-width: 0;
|
|
margin: 0;
|
|
color: #667085;
|
|
font-size: 11px;
|
|
text-align: right;
|
|
}
|
|
.chart-caption {
|
|
margin-top: 9px;
|
|
text-align: left;
|
|
}
|
|
.schedule-unit {
|
|
margin-left: 10px;
|
|
color: #667085;
|
|
font-size: 12px;
|
|
}
|
|
.schedule-status {
|
|
display: grid;
|
|
gap: 3px;
|
|
color: #667085;
|
|
font-size: 12px;
|
|
}
|
|
.chart {
|
|
height: 310px;
|
|
margin-top: 10px;
|
|
}
|
|
.chart-large {
|
|
height: 360px;
|
|
}
|
|
.detail-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
gap: 18px;
|
|
margin-top: 18px;
|
|
}
|
|
.detail-card {
|
|
min-width: 0;
|
|
padding: 18px;
|
|
background: #fff;
|
|
border: 1px solid var(--line);
|
|
box-shadow: 0 10px 28px rgb(24 50 79 / 5%);
|
|
}
|
|
.detail-card h4 {
|
|
margin: 0 0 14px;
|
|
color: var(--ink);
|
|
font-size: 15px;
|
|
}
|
|
.teaching-class-detail {
|
|
margin-top: 18px;
|
|
}
|
|
.date-metric {
|
|
font-size: 17px !important;
|
|
}
|
|
.analytics-comments {
|
|
margin-top: 26px;
|
|
padding: 22px;
|
|
background: #fff;
|
|
border: 1px solid var(--line);
|
|
box-shadow: 0 10px 28px rgb(24 50 79 / 5%);
|
|
}
|
|
.analytics-comments > header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
gap: 18px;
|
|
margin-bottom: 16px;
|
|
}
|
|
.analytics-comments header span {
|
|
color: #5e6e82;
|
|
font:
|
|
10px Consolas,
|
|
monospace;
|
|
letter-spacing: 0.08em;
|
|
}
|
|
.analytics-comments h3 {
|
|
margin: 5px 0;
|
|
color: var(--ink);
|
|
font-size: 17px;
|
|
}
|
|
.analytics-comments header p {
|
|
margin: 0;
|
|
color: #667085;
|
|
font-size: 12px;
|
|
}
|
|
.comment-compose-actions {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 12px;
|
|
margin-top: 10px;
|
|
}
|
|
.comment-list {
|
|
display: grid;
|
|
gap: 0;
|
|
margin: 18px 0 0;
|
|
padding: 0;
|
|
list-style: none;
|
|
border-top: 1px solid var(--line);
|
|
}
|
|
.comment-list li {
|
|
padding: 15px 0;
|
|
border-bottom: 1px solid var(--line);
|
|
}
|
|
.comment-meta {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
align-items: center;
|
|
gap: 8px;
|
|
color: #667085;
|
|
font-size: 12px;
|
|
}
|
|
.comment-meta strong {
|
|
color: var(--ink);
|
|
font-size: 13px;
|
|
}
|
|
.comment-meta span {
|
|
padding: 2px 6px;
|
|
color: #75511d;
|
|
background: #fff6e7;
|
|
border-radius: 10px;
|
|
font-size: 10px;
|
|
}
|
|
.comment-meta time {
|
|
margin-left: auto;
|
|
}
|
|
.comment-list p {
|
|
margin: 9px 0 6px;
|
|
color: #344054;
|
|
white-space: pre-wrap;
|
|
word-break: break-word;
|
|
}
|
|
.comment-actions,
|
|
.reply-compose {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
align-items: center;
|
|
gap: 4px;
|
|
}
|
|
.reply-panel {
|
|
margin-top: 12px;
|
|
padding: 12px;
|
|
background: #f7f9fc;
|
|
border-left: 3px solid #ccd9e9;
|
|
}
|
|
.reply-list {
|
|
display: grid;
|
|
gap: 10px;
|
|
margin: 0 0 12px;
|
|
padding: 0;
|
|
list-style: none;
|
|
}
|
|
.reply-list li {
|
|
padding-bottom: 10px;
|
|
}
|
|
.reply-compose {
|
|
justify-content: space-between;
|
|
margin-top: 8px;
|
|
}
|
|
.comment-load-more {
|
|
margin-top: 16px;
|
|
text-align: center;
|
|
}
|
|
@media (max-width: 1180px) {
|
|
.analytics-shell {
|
|
grid-template-columns: 240px minmax(0, 1fr);
|
|
}
|
|
.chart-grid {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
.chart-card-wide {
|
|
grid-column: auto;
|
|
}
|
|
.detail-grid {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
}
|
|
@media (max-width: 820px) {
|
|
.filter-bar {
|
|
display: grid;
|
|
grid-template-columns: 1fr;
|
|
}
|
|
.filter-bar :deep(.el-select) {
|
|
width: 100% !important;
|
|
}
|
|
.analytics-shell {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
.class-rail {
|
|
position: static;
|
|
max-height: 390px;
|
|
}
|
|
.kpi-strip {
|
|
grid-template-columns: repeat(2, 1fr);
|
|
}
|
|
.kpi-strip article:nth-child(3n) {
|
|
border-right: 1px solid var(--line);
|
|
}
|
|
.kpi-strip article:nth-child(2n) {
|
|
border-right: 0;
|
|
}
|
|
.history-heading,
|
|
.chart-card header {
|
|
align-items: flex-start;
|
|
flex-direction: column;
|
|
}
|
|
.chart-card header p {
|
|
text-align: left;
|
|
}
|
|
.analytics-comments {
|
|
padding: 18px 14px;
|
|
}
|
|
}
|
|
@media (max-width: 520px) {
|
|
.report-heading {
|
|
flex-direction: column;
|
|
}
|
|
.report-actions {
|
|
width: 100%;
|
|
align-items: stretch;
|
|
flex-direction: column-reverse;
|
|
}
|
|
.sample-stamp {
|
|
padding: 14px 0 0;
|
|
border: 0;
|
|
border-top: 1px solid rgb(255 255 255 / 20%);
|
|
}
|
|
.kpi-strip {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
.kpi-strip article {
|
|
border-right: 0 !important;
|
|
}
|
|
.chart-card {
|
|
padding: 17px 14px;
|
|
}
|
|
}
|
|
</style>
|