# An XBlock runtime service for \`can\_view\_answer\`, \` can\_view\_correctness\`?

**URL:** <https://discuss.openedx.org/t/an-xblock-runtime-service-for-can-view-answer-can-view-correctness/11274>\
**Category:** Development\
**Created:** [September 22, 2023, 3:42pm UTC](https://discuss.openedx.org/t/an-xblock-runtime-service-for-can-view-answer-can-view-correctness/11274 "2023-09-22T15:42:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dave](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/dave/32/263_2.png) [@dave](https://discuss.openedx.org/u/dave)\
**Post date:** [September 22, 2023, 3:42pm UTC](https://discuss.openedx.org/t/an-xblock-runtime-service-for-can-view-answer-can-view-correctness/11274/1 "2023-09-22T15:42:43Z")

</div>

I created an issue to track something that’s bugged me for a while, but I’m not sure how much of a problem it really is in practice. So to XBlock authors: would you use [this](https://github.com/openedx/edx-platform/issues/33325) if it was built?

> The ProblemBlock has some sophisticated logic for determining whether the user should be allowed to see the answer (and also whether they were correct or not):

> <https://github.com/openedx/edx-platform/blob/f9148f032fc93bd339fb0ab50afb5cb3b1cdca21/xmodule/capa_block.py#L1400-L1457>

> This has been partially re-implemented in other XBlocks over time. We should refactor this into a runtime service that will return a simple True/False for this question, so that we can get consistent behavior without other XBlock authors having to think about it.
