Commit b1e09c82 by David Ormsbee

Move openassessment_compose to openassessment.xblock, include XBlock workbench at /workbench

parent 3246b816
...@@ -42,6 +42,3 @@ nosetests.xml ...@@ -42,6 +42,3 @@ nosetests.xml
# some mac thing # some mac thing
.DS_Store .DS_Store
# If the XBlock repo is checked out here, ignore it
XBlock
XBlock/*
...@@ -12,12 +12,16 @@ from xblock.fragment import Fragment ...@@ -12,12 +12,16 @@ from xblock.fragment import Fragment
mako_default_filters = ['unicode', 'h', 'trim'] mako_default_filters = ['unicode', 'h', 'trim']
class openassessmentComposeXBlock(XBlock): class OpenAssessmentBlock(XBlock):
""" """
Displays a question and gives an area where students can compose a response. Displays a question and gives an area where students can compose a response.
""" """
question = String(default=u"Undefined question", scope=Scope.content, help="A question to display to a student") question = String(
default=u"Undefined question",
scope=Scope.content,
help="A question to display to a student"
)
def _get_xblock_trace(self): def _get_xblock_trace(self):
"""Uniquely identify this xblock by context. """Uniquely identify this xblock by context.
...@@ -50,8 +54,8 @@ class openassessmentComposeXBlock(XBlock): ...@@ -50,8 +54,8 @@ class openassessmentComposeXBlock(XBlock):
frag.add_css(load("static/css/openassessment_compose.css")) frag.add_css(load("static/css/openassessment_compose.css"))
# XXX: I'm sure there's a more socially acceptable way to get our values # XXX: I'm sure there's a more socially acceptable way to get our values
# into the js. But once we've invoked mako it's so tempting.... # into the js. But once we've invoked mako it's so tempting....
#frag.add_javascript(Template(load("static/js/src/openassessment_compose.js"), #frag.add_javascript(Template(load("static/js/src/openassessment_compose.js"),
# default_filters=mako_default_filters, # default_filters=mako_default_filters,
# output_encoding='utf-8' # output_encoding='utf-8'
# ).render(xblock_trace=trace)) # ).render(xblock_trace=trace))
frag.add_javascript(load("static/js/src/openassessment_compose.js")) frag.add_javascript(load("static/js/src/openassessment_compose.js"))
...@@ -74,9 +78,9 @@ class openassessmentComposeXBlock(XBlock): ...@@ -74,9 +78,9 @@ class openassessmentComposeXBlock(XBlock):
def workbench_scenarios(): def workbench_scenarios():
"""A canned scenario for display in the workbench.""" """A canned scenario for display in the workbench."""
return [ return [
("OpenassessmentComposeXBlock", ("OpenAssessmentBlock",
"""<vertical_demo> """<vertical_demo>
<openassessment_compose/> <openassessment/>
</vertical_demo> </vertical_demo>
"""), """),
] ]
from .openassessment_compose import openassessmentComposeXBlock
"""Setup for openassessment_compose XBlock."""
import os
from setuptools import setup
def package_data(pkg, root):
"""Generic function to find package_data for `pkg` under `root`."""
data = []
for dirname, _, files in os.walk(os.path.join(pkg, root)):
for fname in files:
data.append(os.path.relpath(os.path.join(dirname, fname), pkg))
return {pkg: data}
setup(
name='openassessment_compose-xblock',
version='0.1',
description='openassessment Composition XBlock',
packages=[
'openassessment_compose',
],
install_requires=[
'XBlock',
'Mako', # XXX: convert to django template, eliminate dependency
],
entry_points={
'xblock.v1': [
'openassessment_compose = openassessment_compose:openassessmentComposeXBlock',
]
},
package_data=package_data("openassessment_compose", "static"),
)
# edX Internal Requirements # edX Internal Requirements
-e git+https://github.com/edx/XBlock.git@fa88607#egg=XBlock -e git+https://github.com/edx/XBlock.git@24c8bbd6#egg=XBlock
# Third Party Requirements # Third Party Requirements
django==1.4.8 django==1.4.8
djangorestframework==2.3.5 djangorestframework==2.3.5
Mako==0.9.1
...@@ -96,7 +96,7 @@ SECRET_KEY = ')68&amp;-c!+og)cy$o9pju_$c707+fett&amp;ph%t%gqgu-@5)!cl$cr' ...@@ -96,7 +96,7 @@ SECRET_KEY = ')68&amp;-c!+og)cy$o9pju_$c707+fett&amp;ph%t%gqgu-@5)!cl$cr'
TEMPLATE_LOADERS = ( TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader', 'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader', 'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader', 'django.template.loaders.eggs.Loader',
) )
MIDDLEWARE_CLASSES = ( MIDDLEWARE_CLASSES = (
...@@ -109,8 +109,7 @@ MIDDLEWARE_CLASSES = ( ...@@ -109,8 +109,7 @@ MIDDLEWARE_CLASSES = (
# 'django.middleware.clickjacking.XFrameOptionsMiddleware', # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
) )
ROOT_URLCONF = 'common_grading.urls' ROOT_URLCONF = 'urls'
#ROOT_URLCONF = 'urls'
# Python dotted path to the WSGI application used by Django's runserver. # Python dotted path to the WSGI application used by Django's runserver.
# WSGI_APPLICATION = 'peer_grading.wsgi.application' # WSGI_APPLICATION = 'peer_grading.wsgi.application'
...@@ -130,9 +129,17 @@ INSTALLED_APPS = ( ...@@ -130,9 +129,17 @@ INSTALLED_APPS = (
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'django.contrib.admin', 'django.contrib.admin',
'django.contrib.admindocs', 'django.contrib.admindocs',
# Third party
'django_extensions',
# XBlock
'workbench',
'demo_xblocks',
# edx-tim apps
'submissions', 'submissions',
'openassessment.peer', 'openassessment.peer',
'openasssessment_compose',
) )
# A sample logging configuration. The only tangible logging # A sample logging configuration. The only tangible logging
...@@ -163,3 +170,5 @@ LOGGING = { ...@@ -163,3 +170,5 @@ LOGGING = {
}, },
} }
} }
# TODO: add config for XBLOCK_WORKBENCH { SCENARIO_CLASSES }
#!/usr/bin/env python #!/usr/bin/env python
import os
from setuptools import setup from setuptools import setup
PACKAGES = ['submissions', 'openassessment.peer', 'openassessment_compose'] PACKAGES = [
'submissions',
'openassessment.peer',
'openassessment.xblock'
]
def package_data(pkg, root):
"""Generic function to find package_data for `pkg` under `root`."""
data = []
for dirname, _, files in os.walk(os.path.join(pkg, root)):
for fname in files:
data.append(os.path.relpath(os.path.join(dirname, fname), pkg))
return {pkg: data}
def is_requirement(line): def is_requirement(line):
...@@ -41,4 +54,11 @@ setup( ...@@ -41,4 +54,11 @@ setup(
packages=PACKAGES, packages=PACKAGES,
package_dir={'': 'apps'}, package_dir={'': 'apps'},
install_requires=REQUIREMENTS, install_requires=REQUIREMENTS,
entry_points={
'xblock.v1': [
'openassessment = openassessment.xblock.openassessmentblock:OpenAssessmentBlock',
]
},
package_data=package_data("openassessment.xblock", "static"),
) )
from django.conf.urls import include, patterns, url
from django.contrib import admin
import submissions.urls
import workbench.urls
admin.autodiscover()
urlpatterns = patterns(
'',
# Django built-in
url(r'^admin/', include(admin.site.urls)),
# Provided by XBlock
url(r'^workbench/', include(workbench.urls))
# edx-tim apps
# url(r'^submissions', include(submissions.urls)),
)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment