Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 0 additions & 46 deletions common/djangoapps/terrain/course_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
from xmodule.modulestore.django import modulestore
from xmodule.contentstore.django import contentstore
from xmodule.templates import update_templates
from bs4 import BeautifulSoup
import os.path
from urllib import quote_plus


Expand Down Expand Up @@ -76,50 +74,6 @@ def register_by_course_id(course_id, is_staff=False):
CourseEnrollment.objects.get_or_create(user=u, course_id=course_id)



@world.absorb
def save_the_course_content(path='/tmp'):
html = world.browser.html.encode('ascii', 'ignore')
soup = BeautifulSoup(html)

# get rid of the header, we only want to compare the body
soup.head.decompose()

# for now, remove the data-id attributes, because they are
# causing mismatches between cms-master and master
for item in soup.find_all(attrs={'data-id': re.compile('.*')}):
del item['data-id']

# we also need to remove them from unrendered problems,
# where they are contained in the text of divs instead of
# in attributes of tags
# Be careful of whether or not it was the last attribute
# and needs a trailing space
for item in soup.find_all(text=re.compile(' data-id=".*?" ')):
s = unicode(item.string)
item.string.replace_with(re.sub(' data-id=".*?" ', ' ', s))

for item in soup.find_all(text=re.compile(' data-id=".*?"')):
s = unicode(item.string)
item.string.replace_with(re.sub(' data-id=".*?"', ' ', s))

# prettify the html so it will compare better, with
# each HTML tag on its own line
output = soup.prettify()

# use string slicing to grab everything after 'courseware/' in the URL
u = world.browser.url
section_url = u[u.find('courseware/') + 11:]

if not os.path.exists(path):
os.makedirs(path)

filename = '%s.html' % (quote_plus(section_url))
f = open('%s/%s' % (path, filename), 'w')
f.write(output)
f.close


@world.absorb
def clear_courses():
# Flush and initialize the module store
Expand Down
63 changes: 0 additions & 63 deletions lms/djangoapps/courseware/features/smart-accordion.feature

This file was deleted.

158 changes: 0 additions & 158 deletions lms/djangoapps/courseware/features/smart-accordion.py

This file was deleted.