GithubHelp home page GithubHelp logo

Comments (3)

zaript avatar zaript commented on September 21, 2024 1

The fix seems to be to change line 77 in server.py:

			# zip = zipfile.ZipFile(file.stream)
			zip = zipfile.ZipFile(file)

The upload works normally with this fix, but then there is an issue with interpreting module archive:

Traceback (most recent call last):
  File "/Users/zaript/src/blackboard-scorm-analysis/_pyvenv/lib/python3.7/site-packages/flask/app.py", line 2309, in __call__
    return self.wsgi_app(environ, start_response)
  File "/Users/zaript/src/blackboard-scorm-analysis/_pyvenv/lib/python3.7/site-packages/flask/app.py", line 2295, in wsgi_app
    response = self.handle_exception(e)
  File "/Users/zaript/src/blackboard-scorm-analysis/_pyvenv/lib/python3.7/site-packages/flask/app.py", line 1741, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/zaript/src/blackboard-scorm-analysis/_pyvenv/lib/python3.7/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/Users/zaript/src/blackboard-scorm-analysis/_pyvenv/lib/python3.7/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/zaript/src/blackboard-scorm-analysis/_pyvenv/lib/python3.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/zaript/src/blackboard-scorm-analysis/_pyvenv/lib/python3.7/site-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/zaript/src/blackboard-scorm-analysis/_pyvenv/lib/python3.7/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/Users/zaript/src/blackboard-scorm-analysis/_pyvenv/lib/python3.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/zaript/src/blackboard-scorm-analysis/_pyvenv/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/zaript/src/blackboard-scorm-analysis/server.py", line 85, in upload_zip
    course = BlackboardCourse(extract_path)
  File "/Users/zaript/src/blackboard-scorm-analysis/blackboardscorm.py", line 228, in __init__
    self.load_hierarchy()
  File "/Users/zaript/src/blackboard-scorm-analysis/blackboardscorm.py", line 244, in load_hierarchy
    self.items = [self.load_item(item) for item in organization.xpath('item')]
  File "/Users/zaript/src/blackboard-scorm-analysis/blackboardscorm.py", line 244, in <listcomp>
    self.items = [self.load_item(item) for item in organization.xpath('item')]
  File "/Users/zaript/src/blackboard-scorm-analysis/blackboardscorm.py", line 260, in load_item
    item.subitems = [self.load_item(subelement) for subelement in element.xpath('item/item')]
  File "/Users/zaript/src/blackboard-scorm-analysis/blackboardscorm.py", line 260, in <listcomp>
    item.subitems = [self.load_item(subelement) for subelement in element.xpath('item/item')]
  File "/Users/zaript/src/blackboard-scorm-analysis/blackboardscorm.py", line 274, in load_item
    item.scorm = self.load_scorm(content_id)
  File "/Users/zaript/src/blackboard-scorm-analysis/blackboardscorm.py", line 285, in load_scorm
    scorm = SCORM(self,scorm_doc)
  File "/Users/zaript/src/blackboard-scorm-analysis/blackboardscorm.py", line 64, in __init__
    self.attempts = sorted([Attempt(self,registration) for registration in registrations],key=lambda a:a.userid)
  File "/Users/zaript/src/blackboard-scorm-analysis/blackboardscorm.py", line 64, in <listcomp>
    self.attempts = sorted([Attempt(self,registration) for registration in registrations],key=lambda a:a.userid)
  File "/Users/zaript/src/blackboard-scorm-analysis/blackboardscorm.py", line 105, in __init__
    self.objectives = sorted([Objective(self,objective) for objective in activity_run_time.xpath('ActivityRunTimeObjective')],key=lambda o: o.question)
  File "/Users/zaript/src/blackboard-scorm-analysis/blackboardscorm.py", line 105, in <listcomp>
    self.objectives = sorted([Objective(self,objective) for objective in activity_run_time.xpath('ActivityRunTimeObjective')],key=lambda o: o.question)
  File "/Users/zaript/src/blackboard-scorm-analysis/blackboardscorm.py", line 193, in __init__
    self.suspend_data = self.attempt.suspend_data['questions'][self.question-1]
TypeError: 'NoneType' object is not subscriptable

from blackboard-scorm-analysis.

zaript avatar zaript commented on September 21, 2024 1

This is not an original issue anymore, but I will update the thread just in case someone needs it. Our BlackBoard archived course with an error, that seems to prevent this Analysis tool from opening a particular SCORM package in the archive. The workaround I have used is to skip the package with an error from loading.

Changes to line 260:

# item.subitems = [self.load_item(subelement) for subelement in element.xpath('item/item')]
item.subitems = []
for subelement in element.xpath('item/item'):
	try:
		item.subitems.append(self.load_item(subelement))
	except:
		print("***** failed to load subelement ", subelement)

This way I can still load and analyse the remaining part of the course.

from blackboard-scorm-analysis.

davidhodge180 avatar davidhodge180 commented on September 21, 2024

I ran into these same issues in August 2022. I tried the bottom fix first (line 260) but it didn't work. Then I included the zip fix too (line 77) and it worked!
Thanks

from blackboard-scorm-analysis.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.