XBlock Poll

raw JSON →
1.15.1 verified Fri May 01 auth: no python

An XBlock for creating polls and surveys in Open edX. Version 1.15.1, maintained by Open Craft. Release cadence is irregular, roughly 1-2 minor versions per year.

pip install xblock-poll
error ImportError: No module named poll
cause The package installs as 'xblock-poll' but the Python module is 'poll'.
fix
Ensure you have installed xblock-poll via pip, then import using 'from poll import PollXBlock'.
error django.core.exceptions.ImproperlyConfigured: 'XBlock' is not a registered widget
cause Missing XBlock SDK or misconfigured Django settings for XBlock workbench.
fix
Install xblock-sdk and run with DJANGO_SETTINGS_MODULE=workbench.settings:run or as part of an Open edX environment.
deprecated Django 2.2 support was dropped; Django 3.2+ required in recent versions.
fix Upgrade Django to 3.2 or later.
breaking Celery upgrade (>=5.0) required for async tasks in v1.12.0+. The old celery 4.x API is no longer supported.
fix Ensure your project uses Celery 5.0+.
deprecated Python 2.7 support removed after v1.9.x.
fix Use Python 3.6+ (preferably 3.8+).
gotcha If you use the 'poll' block in an Open edX course, you must also enable the Poll XBlock in the advanced settings (Advanced Module List) of the course or globally via XBLOCK_SELECTION in settings.
fix Add 'poll' to advanced_modules list in course settings or set XBLOCK_SELECTION in Django settings.

Minimal instantiation of PollXBlock (for testing/development with XBlock SDK).

from poll import PollXBlock
from workbench.runtime import WorkbenchRuntime

runtime = WorkbenchRuntime()
block = PollXBlock(runtime, scope_ids=runtime.id_generator.create_definition('poll'))
print(type(block).__name__)