Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InlineQuestion calls markup_to_html without a PageContext #80

Closed
inducer opened this issue Sep 13, 2015 · 3 comments
Closed

InlineQuestion calls markup_to_html without a PageContext #80

inducer opened this issue Sep 13, 2015 · 3 comments

Comments

@inducer
Copy link
Owner

inducer commented Sep 13, 2015

@dzhuang

I just discovered that you don't pass a PageContext to markup_to_html in InlineQuestion, here for example:

s = markup_to_html(

As of 882803a, this breaks caching of rendered markup. (it has to, since markup rendering depends on the course for which it is done). Could you please fix this?

@dzhuang
Copy link
Contributor

dzhuang commented Sep 14, 2015

Yes, you're right. That will cause problems, for example, course specific links and jinja macros won't be rendered correctly.

The reason I did that is, I need to use markup_to_html to validate / get question body and answer items (of each types) in __init__ of InlineQuestion. However, there's no PageContext in __init__ method.

I will try to fix it.

@dzhuang
Copy link
Contributor

dzhuang commented Sep 14, 2015

I think I know how to fix it. Validation and page rendering should be separated: use vctx in validation, and use page_context when rendering html. Need sometime to modify and test.

@dzhuang
Copy link
Contributor

dzhuang commented Sep 15, 2015

Should be fixed in #82. However, I found images and latex expressions are not rendered correctly in ChoicesAnswer choices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants