How to get current URL in XBlock

We are new in OpenEdx platform and trying to develope XBlock to get Result Summary after every section.

We are developing XBlock which will gives Result Summary for every section which will be summary of Question Type, Question Attempted.

Here we are planning to get all questions from section and show the summary of Question Type, Correct Answer, Wrong Answer etc.

we get section_id in URI but we are unable to access those through xBlock because request is not working over there.

We are using StudioEditableXBlockMixin, Please help us to get section wise questions or is there any handler which can give current url ?

Hi @Ganesh_Demo, welcome to the community :slight_smile:

You could use the Course Blocks API for this.

To get an idea of how it works, have a look at the InstructorToolBlock: This XBlock is part of the problem-builder suite of tools and its UI includes a dropdown menu listing all sections, subsections, units, and components (blocks), which is built using data from the Course Blocks API.

Relevant parts of the code: