mitodl / rapid-response-xblock

a django app plug-in for edx-platform
BSD 3-Clause "New" or "Revised" License
0 stars 2 forks source link

fix: unable to open problem for responses #150

Closed Anas12091101 closed 9 months ago

Anas12091101 commented 9 months ago

What are the relevant tickets?

149

What's this PR do?

Fixed the stuck-on-loading bug for problems created through course authoring MFE. Previously the text property of choice tree in xml was being accessed which was giving None due to the presence of xml childs(like div, code etc) inside the choice. This PR changes the text property to itertext() function that iterates through all the nodes inside the choice and returns the text in a list.

How should this be manually tested?

  1. Set up course authoring MFE as mentioned in the Readme file.
  2. In Studio go to the edX Demo Course. Create a new unit which is a multiple choice problem and enable rapid response for it.
  3. In LMS go to the unit you just created and click the Open problem now button.
  4. Rapid Response is working fine now

Screenshots (if appropriate)

Screenshot 2023-12-19 at 2 18 15 PM
Anas12091101 commented 9 months ago

@arslanashraf7 thanks for reviewing this PR. Noted points 1 and 2.

Addressing point 3, while creating/editing a problem in course authoring MFE, we get some tag choices as shown below

Screenshot 2023-12-20 at 6 37 27 PM

By default, the div tag is selected and because of this, we are getting the div tag in the choice xml node. There can be a code tag inside the div tag if we want to give code as choice. Therefore, removing div tag in the MFE might not be the solution.