openzim / openedx

Open edX (to zim) scraper
GNU General Public License v3.0
8 stars 7 forks source link

Accordion element does not work on extra annexed pages in openedx #132

Closed satyamtg closed 4 years ago

satyamtg commented 4 years ago

The accordion element which expands into a dropdown fails to work on extra annexed pages. This might be a bug with the template structure.

satyamtg commented 4 years ago

This is actually due to recursive scraping of scripts from the instance to apply style and make custom components work. Now in these extra annexed pages, we extract everything (including scripts) again and this leads to the scripts being present two times, which leads to the jQuery function getting undefined.

There can be two ways to fix this -

  1. do not scrape sctipts in the extra annexed pages and use only the recursively scraped ones
  2. do not scrape scripts recursively to have style intact but in turn have scripts and links scraped elementwise in verticals (till we reach the div from where xblock handling happens).

I think that the second way is the proper way to do it.