fix(MYSY): 修正时间模板 fallback 为学校实际作息(11 节) - #8
Merged
Merged
Conversation
- generateTimeSlots() 的页面推导路径(#kbtable 的 th[rowspan] 时间块)本身正确,未改动 - fallback 兜底数组原为硬编码 13 节、08:00 起,与绵阳师范学院实际作息不符 (实际 11 节、08:15 起);页面时间块缺失时会落到该模板导致节次错位 - 改为实际作息:08:15-09:00 / 09:05-09:50 / 10:20-11:05 / 11:10-11:55 / 14:00-14:45 / 14:50-15:35 / 16:05-16:50 / 16:55-17:40 / 17:45-18:30 / 19:00-19:45 / 19:50-20:35(1-2 / 3-4 / 7-8 / 10-11 节各自相邻,节间 5 分钟) 验证:jsdom 加载脚本双路径回归(fallback 与页面推导)均为 11 节,逐条与真实作息一致。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
绵阳师范学院(MYSY)的教务课表页
#kbtable里,th[rowspan]给出的是教务口径的 13 小节(08:00–21:25),而学校作息表是11 节(08:15 起,上午 2+2、下午 2+2+1、晚上 2):两套作息节数不同、编号也错位(作息表第 5 节 = 14:00,教务第 6 节 = 14:00)。原脚本固定使用页面推导结果,想按学校作息显示课表的用户没有选择权。
改动
只动
resources/MYSY/mysy.js,+56 −1,generateTimeSlots()的页面推导与 fallback 逻辑保持不变。PRESET_TIME_SLOTS:11 节学校作息表chooseTimeSlots(pageSlots):导入时用bridgePromise.showSingleSelection弹单选number/ 字符串 /null都归一化;取消、越界、旧版桥接层没有showSingleSelection一律回落到教务系统时间表,不阻断导入。runImportFlow()里改为await chooseTimeSlots(generateTimeSlots(doc))。验证
jsdom 加载真实课表页面(
jw.mtc.edu.cn/jsxsd/xskb/xskb_list.do的 Frame0#kbtable,含 5 个th[rowspan]时间块、77 个div.kbcontent):"1"null/-1showSingleSelection)runImportFlow()node --check通过。测试脚本:work/test_mysy_choice.js(本地,未入库)。兼容性说明
showSingleSelection(title, itemsJson, selectedIndex)已在 App 端(lib/screens/course_import_screen.dart:4510注入、:4645派发、:4809处理)与浏览器扩展测试工具(tools/CourseImporterTestTool/injected_bridge.js:246)中实现,仓库内已有 20+ 学校脚本使用(AEPU / BTBU / CDUTCM / chaoxing_jiaowu 等)。