Notes: extracted HtmlBlock is not wrapped by @edxnotes, so no HTML component is annotatable

未关闭
#39,223 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

  • #39277 来自 @florianaltendorfer —— 已关闭,未合并

评估

难度
4/5
预计耗时
3-5 天
新手友好度
32/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
backend

调研方向

Start with xmodule/html_block.py, where @edxnotes wraps only _BuiltInHtmlBlock, then read the decorator in lms.djangoapps.edxnotes.decorators and xmodule/edxnotes_utils.py. Read the diff of #38014 to see the earlier attempt. Done means an HTML component rendered with USE_EXTRACTED_HTML_BLOCK on carries the edx-notes-wrapper element, and a maintainer has chosen between reviving #38014 and adding an opt-in hook. The design choice is open, so confirm it before writing code.

由索引模型根据 Issue 内容生成。

描述

bug

With USE_EXTRACTED_HTML_BLOCK on (the default on master and release/verawood), Student Notes cannot annotate any HTML component.

Components become annotatable through the @edxnotes decorator (xmodule/edxnotes_utils.py → lms.djangoapps.edxnotes.decorators), which wraps the student view in the edx-notes-wrapper the annotator attaches to. In xmodule/html_block.py it is applied only to _BuiltInHtmlBlock. The extracted xblocks_contrib.html.HtmlBlock (now in openedx/xblocks-core) is used undecorated.

With the notes service running and ENABLE_EDXNOTES on for the course, a unit renders the notes show/hide control and loads the annotator scripts, but no component is wrapped. There is no text a learner can select to take a note on, and the course's Notes page stays empty.

Prior work: #38014 applied @edxnotes to the extracted block. Its author closed it in February in favour of setting USE_EXTRACTED_HTML_BLOCK=False, assuming notes support would land in xblocks-contrib before the toggle is removed. I found no issue tracking that, here or in xblocks-core. Since the decorator lives in the LMS, the extracted block can't apply it itself.

Expected: HTML components are annotatable with the extracted block, as they were with the built-in one. Either revive #38014's approach, or provide a hook that lets the extracted block opt in. Notes support should also be a precondition for removing the USE_EXTRACTED_HTML_BLOCK toggle.

Environment: Tutor main with the notes plugin, xblocks-contrib 1.0.6, 2026-09-23. Code unchanged on master as of 2026-10-13. Found by the Open edX end-to-end test suite.

主要语言
Python
星标
8.2k
派生
4.4k
平均合并
2 天 10 小时
30 天内合并 PR
40

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

openedx/openedx-platform 的其他 Issue

查看 openedx/openedx-platform 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。