Open robertovergallo opened 9 years ago
It seems solved by putting the whole content of scorm_commit in scorm_set_value Now I can see the SCORM apis setting successfully the variables in the Dict. Unfortunately, user's selections get not selected in the quiz GUI when he returns to the quiz
Hello! This is just to let you know that this issue is not being ignored. I'm just returning from a vacation, and have to catch up with my day-job work first, though, but I will investigate this as soon as I can. In the mean-time, please keep experimenting and let me know if you find any other problems.
This project is still in very early stages, but especially if there are people out there who want to use it, I would love to keep trying to make it work!
I spent some time on this this evening, but to be honest I haven't had time to work with this code for a while, and I have not had much insight except to remember that when I was last working on it I'd encountered some kind of roadblock around the way xblocks store data not being easily compatible with the way SCORM models it.
In the mean-time, @ihowson has been working more recently on his own fork of this xblock, which is focused on xAPI support but may also support SCORM. You might wish to look there and see if you get better results.
Hi Brad! Thank you for your kind replies! I've also tried ihowson's fork, but it asked me for Tin Can API files which I don't have and don't need at all right now. I like your code because it's very clean. I'm going to experiment more in the next days, if I have news I'll let you know. Bye! Roberto
Hi Brad, thank you for your work. I'm trying to configure your scorm xblock using a scorm quiz. I know this is a work in progress and I'd like to help. When I submit the answer, the local js tells perfectly the score, but I see a 500 error in the network console. Is it the same problem you face? Thanks Roberto
AttributeError at /handler/xblockscorm.xb_scorm.d0.u0/scorm_set_value/ 'dict' object has no attribute 'method'
Request Method: POST Request URL: http://127.0.0.1:8000/handler/xblockscorm.xb_scorm.d0.u0/scorm_set_value/?student=student_1& Django Version: 1.4.19 Python Executable: /usr/bin/python Python Version: 2.7.5 Python Path: ['/Users/soulpower/Desktop/xblock-sdk-master', '/Users/soulpower/Desktop/xblock-sdk-master/src/djpyfs', '/Users/soulpower/Desktop/xblock-sdk-master/src/acid-xblock', '/Users/soulpower/Desktop/xblock-sdk-master/src/xblock', '/Library/Python/2.7/site-packages/pip-6.0.8-py2.7.egg', '/Library/Python/2.7/site-packages/requests-2.5.1-py2.7.egg', '/Library/Python/2.7/site-packages/nose-1.3.4-py2.7.egg', '/Library/Python/2.7/site-packages/six-1.9.0-py2.7.egg', '/Library/Python/2.7/site-packages/myxblock_xblock-0.1-py2.7.egg', '/Users/soulpower/Desktop/Lavoro/GSALab/MOOC/selfAssessmentXBlock/selfassessmentxblock', '/Users/soulpower/Desktop/Lavoro/GSALab/MOOC/xb_scorm', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', '/Library/Python/2.7/site-packages'] Server time: Sat, 28 Feb 2015 11:35:38 -0500 Installed Applications: ('django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'djpyfs', 'workbench', 'django_nose', 'django.contrib.admin') Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware')
Traceback: File "/Library/Python/2.7/site-packages/django/core/handlers/base.py" in get_response
Exception Type: AttributeError at /handler/xblockscorm.xb_scorm.d0.u0/scorm_set_value/ Exception Value: 'dict' object has no attribute 'method' Request information: GET: student = u'student_1'
POST: {"cmi.core.session_time":"00:00:07.06","cmi.interactions.0.id":"key0b0","cmi.interactions.0.type":"choice","cmi.interactions.0.correct_responses.0.pattern":"3","cmi.interactions.0.student_response":"3","cmi.interactions.1.id":"key1b0","cmi.interactions.1.type":"choice","cmi.interactions.1.correct_responses.0.pattern":"1","cmi.interactions.1.student_response":"1","cmi.interactions.0.result":"correct","cmi.interactions.1.result":"correct","cmi.core.score.raw":"100","cmi.core.lesson_status":"passed","cmi.core.exit":""} = u''
FILES: No FILES data
COOKIES: csrftoken = 'wE6hhaM8MSIAkZzstTSxb6vYRHcSJzmF' hide_captions = 'true'
META: wsgi.multiprocess = False RUN_MAIN = 'true' HTTP_REFERER = 'http://127.0.0.1:8000/scenario/xb_scorm.0/' VERSIONER_PYTHON_PREFER_32_BIT = 'no' SERVER_SOFTWARE = 'WSGIServer/0.1 Python/2.7.5' LC_CTYPE = 'UTF-8' SCRIPT_NAME = u'' HTTP_X_CSRFTOKEN = 'wE6hhaM8MSIAkZzstTSxb6vYRHcSJzmF' REQUEST_METHOD = 'POST' LOGNAME = 'root' USER = 'root' HTTP_ORIGIN = 'http://127.0.0.1:8000' HOME = '/Users/soulpower' QUERY_STRING = 'student=student_1&' PATH = '/Users/soulpower/bin/Sencha/Cmd/5.0.1.231:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/soulpower/Desktop/Lavoro/GSALab/Android/adt-bundle-mac-x86_64-20130522/sdk/tools:/Users/soulpower/Desktop/Lavoro/GSALab/Android/adt-bundle-mac-x86_64-20130522/sdk/platform-tools' CONTENT_LENGTH = '521' TERM = 'xterm-256color' SHELL = '/bin/bash' TZ = 'America/New_York' HTTP_COOKIE = 'hide_captions=true; csrftoken=wE6hhaM8MSIAkZzstTSxb6vYRHcSJzmF' SERVER_NAME = '1.0.0.127.in-addr.arpa' VERSIONER_PYTHON_VERSION = '2.7' SERVER_PROTOCOL = 'HTTP/1.1' wsgi.url_scheme = 'http' SERVER_PORT = '8000' SUDO_USER = 'soulpower' USERNAME = 'root' HTTP_X_REQUESTED_WITH = 'XMLHttpRequest' SSH_AUTH_SOCK = '/tmp/launch-0Mdwu0/Listeners' SUDO_UID = '501' wsgi.input = <socket._fileobject object at 0x102744a50> HTTP_USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36' HTTP_HOST = '127.0.0.1:8000' wsgi.multithread = True HTTP_CONNECTION = 'keep-alive' HTTPACCEPT = '/_' SUDO_COMMAND = '/usr/bin/python manage.py runserver' SUDO_GID = '20' wsgi.version = GATEWAY_INTERFACE = 'CGI/1.1' wsgi.run_once = False CSRF_COOKIE = 'wE6hhaM8MSIAkZzstTSxb6vYRHcSJzmF' wsgi.errors = <open file '', mode 'w' at 0x100f111e0>
REMOTE_ADDR = '127.0.0.1'
HTTP_ACCEPT_LANGUAGE = 'en-US,en;q=0.8,it;q=0.6'
__CF_USER_TEXT_ENCODING = '0x0:0:0'
DJANGO_SETTINGS_MODULE = 'workbench.settings'
CONTENT_TYPE = 'application/x-www-form-urlencoded; charset=UTF-8'
MAIL = '/var/mail/root'
wsgi.file_wrapper = "<MISSING VARIABLE '%s'>"
REMOTE_HOST = '1.0.0.127.in-addr.arpa'
HTTP_ACCEPT_ENCODING = 'gzip, deflate'
PATH_INFO = u'/handler/xblockscorm.xb_scorm.d0.u0/scorm_set_value/'
Settings: Using settings module workbench.settings USE_L10N = True USE_THOUSAND_SEPARATOR = False CSRF_COOKIE_SECURE = False LANGUAGE_CODE = 'en-us' ROOT_URLCONF = 'workbench.urls' MANAGERS = BASE_DIR = '/Users/soulpower/Desktop/xblock-sdk-master' DEFAULT_CHARSET = 'utf-8' STATIC_ROOT = '' ALLOWEDHOSTS = [''] MESSAGE_STORAGE = 'django.contrib.messages.storage.fallback.FallbackStorage' EMAIL_SUBJECT_PREFIX = '[Django] ' FILE_UPLOAD_PERMISSIONS = None URL_VALIDATOR_USER_AGENT = 'Django/1.4.19 (https://www.djangoproject.com)' STATICFILES_FINDERS = SESSION_COOKIE_DOMAIN = None SESSION_COOKIE_NAME = 'sessionid' ADMIN_FOR = TIME_INPUT_FORMATS = DATABASES = {'default': {'ENGINE': 'django.db.backends.sqlite3', 'TEST_MIRROR': None, 'NAME': 'workbench.db', 'TEST_CHARSET': None, 'TIME_ZONE': 'UTC', 'TEST_COLLATION': None, 'OPTIONS': {}, 'HOST': '', 'USER': '', 'TESTNAME': None, 'PASSWORD': u'**_', 'PORT': ''}} SERVER_EMAIL = 'root@localhost' FILE_UPLOAD_HANDLERS = DEFAULT_CONTENT_TYPE = 'text/html' APPEND_SLASH = True FIRST_DAY_OF_WEEK = 0 DATABASE_ROUTERS = [] YEAR_MONTH_FORMAT = 'F Y' STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage' CACHES = {'default': {'LOCATION': 'unique-snowflake', 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}} SESSION_COOKIE_PATH = '/' MIDDLEWARE_CLASSES = USE_I18N = True THOUSAND_SEPARATOR = ',' SECRETKEY = u'******_' LANGUAGE_COOKIE_NAME = 'django_language' WORKBENCH = {'reset_state_on_restart': False} DEFAULT_INDEX_TABLESPACE = '' TRANSACTIONS_MANAGED = False LOGGING_CONFIG = 'django.utils.log.dictConfig' SEND_BROKEN_LINK_EMAILS = False TEMPLATE_LOADERS = WSGI_APPLICATION = 'workbench.wsgi.application' TEMPLATE_DEBUG = True X_FRAME_OPTIONS = 'SAMEORIGIN' CSRF_COOKIE_NAME = 'csrftoken' FORCE_SCRIPT_NAME = None USE_X_FORWARDED_HOST = False SIGNING_BACKEND = 'django.core.signing.TimestampSigner' SESSION_COOKIE_SECURE = False CACHE_MIDDLEWARE_KEYPREFIX = u'******_' CSRF_COOKIE_DOMAIN = None FILE_CHARSET = 'utf-8' DEBUG = True SESSION_FILE_PATH = None DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage' INSTALLED_APPS = LANGUAGES = COMMENTS_ALLOW_PROFANITIES = False STATICFILES_DIRS = PREPEND_WWW = False SECURE_PROXY_SSL_HEADER = None SESSION_COOKIE_HTTPONLY = True DEBUG_PROPAGATE_EXCEPTIONS = False MONTH_DAY_FORMAT = 'F j' LOGIN_URL = '/accounts/login/' SESSION_EXPIRE_AT_BROWSER_CLOSE = False TIME_FORMAT = 'P' DATE_INPUT_FORMATS = AUTHENTICATION_BACKENDS = 'django.contrib.auth.backends.ModelBackend' EMAIL_HOSTPASSWORD = u'******_' PASSWORD_RESET_TIMEOUTDAYS = u'******_' CACHE_MIDDLEWARE_ALIAS = 'default' SESSION_SAVE_EVERY_REQUEST = False NUMBER_GROUPING = 0 SESSION_ENGINE = 'django.contrib.sessions.backends.db' CSRF_FAILURE_VIEW = 'django.views.csrf.csrf_failure' CSRF_COOKIE_PATH = '/' LOGIN_REDIRECT_URL = '/accounts/profile/' LOGGING = {'loggers': {'django.request': {'handlers': ['logfile'], 'propagate': True, 'level': 'DEBUG'}, 'django': {'level': 'DEBUG', 'handlers': ['logfile']}}, 'version': 1, 'disable_existing_loggers': False, 'filters': {'require_debug_false': {'()': 'django.utils.log.RequireDebugFalse'}}, 'handlers': {'logfile': {'level': 'DEBUG', 'maxBytes': 50000, 'backupCount': 2, 'class': 'logging.handlers.RotatingFileHandler', 'filename': 'workbench.log'}, 'null': {'class': 'django.utils.log.NullHandler', 'level': 'DEBUG'}}} IGNORABLE_404_URLS = LOCALE_PATHS = TEMPLATE_STRING_IF_INVALID = "<MISSING VARIABLE '%s'>" LOGOUT_URL = '/accounts/logout/' EMAIL_USE_TLS = False FIXTURE_DIRS = EMAIL_HOST = 'localhost' DATE_FORMAT = 'N j, Y' MEDIA_ROOT = '' DEFAULT_EXCEPTION_REPORTER_FILTER = 'django.views.debug.SafeExceptionReporterFilter' ADMINS = FORMAT_MODULE_PATH = None DEFAULT_FROM_EMAIL = 'webmaster@localhost' MEDIA_URL = '' DATETIME_FORMAT = 'N j, Y, P' TEMPLATE_DIRS = SITE_ID = 1 DISALLOWED_USER_AGENTS = ALLOWED_INCLUDE_ROOTS = DECIMAL_SEPARATOR = '.' SHORT_DATE_FORMAT = 'm/d/Y' TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' DJFS = {'directory_root': 'workbench/static/djpyfs', 'type': 'osfs', 'url_root': '/static/djpyfs'} TIME_ZONE = 'America/New_York' FILE_UPLOAD_MAX_MEMORY_SIZE = 2621440 EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' DEFAULT_TABLESPACE = '' TEMPLATE_CONTEXT_PROCESSORS = SESSION_COOKIE_AGE = 1209600 SETTINGS_MODULE = 'workbench.settings' USE_ETAGS = False LANGUAGES_BIDI = FILE_UPLOAD_TEMP_DIR = None INTERNAL_IPS = STATIC_URL = '/static/' EMAIL_PORT = 25 USE_TZ = True SHORT_DATETIME_FORMAT = 'm/d/Y P' PASSWORDHASHERS = u'******_' ABSOLUTE_URL_OVERRIDES = {} CACHE_MIDDLEWARE_SECONDS = 600 DATETIME_INPUT_FORMATS = EMAIL_HOST_USER = '' PROFANITIESLIST = u'*******'
You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 500 page.