From 83b118178ecb24724d9e16400d2a18f3ba0fcd0d Mon Sep 17 00:00:00 2001 From: "J. Cliff Dyer" Date: Tue, 30 Oct 2018 11:18:23 -0400 Subject: [PATCH 1/2] Make it complete on submission instead of on view. --- image_explorer/image_explorer.py | 5 +++++ setup.py | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/image_explorer/image_explorer.py b/image_explorer/image_explorer.py index 02238d6..9cd89e8 100644 --- a/image_explorer/image_explorer.py +++ b/image_explorer/image_explorer.py @@ -12,6 +12,7 @@ from django.conf import settings +from xblock.completable import XBlockCompletionMode from xblock.core import XBlock from xblock.fragment import Fragment from xblock.fields import List, Scope, String, Boolean @@ -28,6 +29,10 @@ class ImageExplorerBlock(XBlock): # pylint: disable=no-init """ XBlock that renders an image with tooltips """ + + has_score = True + completion_mode = XBlockCompletionMode.COMPLETABLE + display_name = String( display_name=_("Display Name"), help=_("This name appears in the horizontal navigation at the top of the page."), diff --git a/setup.py b/setup.py index 154707c..527e915 100644 --- a/setup.py +++ b/setup.py @@ -23,11 +23,11 @@ def package_data(pkg, root_list): setup( name='xblock-image-explorer', - version='1.0.1', + version='1.1.0', description='XBlock - Image Explorer', packages=['image_explorer'], install_requires=[ - 'XBlock', + 'XBlock>=1.2', ], entry_points={ 'xblock.v1': 'image-explorer = image_explorer:ImageExplorerBlock', From 5b9174f0485a40e77a107ce79cf7972772f17fc0 Mon Sep 17 00:00:00 2001 From: "J. Cliff Dyer" Date: Wed, 31 Oct 2018 14:41:50 -0400 Subject: [PATCH 2/2] Add max_score --- image_explorer/image_explorer.py | 1 + 1 file changed, 1 insertion(+) diff --git a/image_explorer/image_explorer.py b/image_explorer/image_explorer.py index 9cd89e8..3e4861e 100644 --- a/image_explorer/image_explorer.py +++ b/image_explorer/image_explorer.py @@ -31,6 +31,7 @@ class ImageExplorerBlock(XBlock): # pylint: disable=no-init """ has_score = True + max_score = 1.0 completion_mode = XBlockCompletionMode.COMPLETABLE display_name = String(