feat(MYSY): 新增「实际上课时间」时间表(上午 4 节)并换算课程节次 - #10
Merged
Conversation
绵阳师范学院实际作息与教务系统课表时间不一致:教务课表按 13 小节编号, 实际上午只上 4 节(教务第 5 节 11:35-12:20 无课),晚上 2 节, 且上午第 1 节实际 08:15 开始(教务为 08:00)。 导入时弹窗二选一(默认「教务系统课表时间」,不改变现有行为): - 教务系统课表时间(13 节):沿用页面 #kbtable 推导结果 - 实际上课时间(11 节,上午 4 节):新增实际作息时间表 选择「实际上课时间」时,按 JWC_TO_ACTUAL_SECTION 把课程节次由教务口径 换算为实际作息口径(教务 6→实际 5 等),避免节次错位;位于教务第 5/13 节 (实际作息无对应节次)的课程保留原节次并提示用户。
Owner
|
检查通过了吗这个 |
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.
背景
绵阳师范学院实际上课时间与教务系统课表时间不一致,脚本此前只能把教务课表的时间直接交给 App,课表显示的上课时间与实际作息对不上。本 PR 新增「实际上课时间」时间表,导入时让用户二选一。
教务系统课表时间(13 小节)
实际上课时间(11 节,本 PR 新增)
上午只有 4 节 —— 教务第 5 节(11:35-12:20)实际无课;晚上 2 节。
与教务口径的差异:上午 4 节 vs 5 节;下午第 1 节 14:00(教务第 6 节);晚上 2 节 vs 3 节;上午第 1 节晚 15 分钟(08:15 vs 08:00)。
改动
导入时弹窗二选一(默认「教务系统课表时间」,不改变现有行为):
ACTUAL_TIME_SLOTS:上表的 11 节实际作息JWC_TO_ACTUAL_SECTION+remapCoursesToActualSections():选择「实际上课时间」时把课程节次由教务口径换算为实际作息口径(教务 6→实际 5、7→6…),避免只换时间表导致的节次错位chooseTimeSlots()返回{useActual, slots},runImportFlow()据此决定是否换算节次showSingleSelection→ 回落「教务系统课表时间」,不阻断导入JWC_FALLBACK_TIME_SLOTS仍为教务口径兜底(#kbtable存在但读不到时间块时)验证
jsdom 加载真实课表页(
jw.mtc.edu.cn/jsxsd/xskb/xskb_list.do的#kbtable,14 门课程),22 项断言全部通过:兼容性
showSingleSelection/saveImportedCourses/savePresetTimeSlots,均已在docs/SCRIPT_API.md定义_decodeImportedSections()只取startTime/endTime(忽略number),两套表均按数组顺序生效