const assert = require("assert"); const fs = require("fs"); const path = require("path"); const root = path.resolve(__dirname, ".."); const taskPage = fs.readFileSync(path.join(root, "src/views/teacherEnd/task/index.vue"), "utf8"); assert(taskPage.includes("function sameValue(left, right)"), "task assignment must normalize class owner identifiers before comparing them"); assert.match( taskPage, /const teachingClassList = computed\(\(\) => classList\.value\.filter\(\(item\) =>[\s\S]*sameValue\(item\.createdBy, currentUserId\.value\)/, "task assignment class options must be limited to classes created by the current teacher" ); assert.match( taskPage, /const canOperateSelectedClass = computed\(\(\) => sameValue\(selectedClass\.value\?\.createdBy, currentUserId\.value\)\)/, "task assignment operations must use the same current-teacher ownership check" ); console.log("task assignment class options are scoped to the current teacher");