Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

ANNOUNCEMENT: Staff Graded Assignment (SGA) XBlock

1,811 views
Skip to first unread message

Peter Pinch

unread,
Jun 20, 2014, 10:17:39 AM6/20/14
to edx-...@googlegroups.com
MIT's Office of Digital learning has released an XBlock for a Staff Graded Assignment (SGA). When placed in a course, this XBlock allows students to upload documents which can be viewed and graded by course staff. While this approach does not scale well for MOOC-sized courses, we have found it useful for small courses where there time to review and grade every student submission. 


Installation instructions and (minimal) course author instructions are available in the readme. 


We are planning some enhancements to SGA this summer:
- refactoring to use the new submissions app
- roles support and workflow, so instructors can approve staff grades

Special thanks to Jazkarta and Chris Rossi who did the coding for MIT.  

If you have any questions or suggestions, please let us know on this list. 

- Peter Pinch

Peter Pinch |  Production Manager, Office of Digital Learning
Massachusetts Institute of Technology
11 Cambridge Center  |  Cambridge MA 02142
pdp...@mit.edu | T 617-253-6256C 617-652-0183



Sarina Canelake

unread,
Jun 20, 2014, 10:28:31 AM6/20/14
to edx-code
This is awesome!! 

Miki Goyal

unread,
Jun 20, 2014, 12:21:48 PM6/20/14
to edx-...@googlegroups.com
Peter,

Nice work! Looking forward to see it land. Where are the documents stored? Can I ask you to Sync up with Steve Sanchez on the ORA team who is working on something related?

Thanks,
Miki

Peter Pinch

unread,
Jun 20, 2014, 3:58:15 PM6/20/14
to edx-...@googlegroups.com
On Jun 20, 2014, at 12:21 PM, Miki Goyal <mi...@edx.org> wrote:
Where are the documents stored?

It's a django app, so it will store them wherever your install of Open edX is configured to store them. We're using S3 on campus. 

Can I ask you to Sync up with Steve Sanchez on the ORA team who is working on something related?

Absolutely. We had some internal discussion about how this function overlapped with ORA at the time we started development, but we were in a rush and it was too early in the ORA2 development cycle.

Trinh Nguyen

unread,
Jun 20, 2014, 10:18:49 PM6/20/14
to edx-...@googlegroups.com
Awesome! It's pretty helpful for my school!

Thanks!

Trinh Nguyen

unread,
Jun 23, 2014, 4:20:03 AM6/23/14
to edx-...@googlegroups.com
Hi Peter,

I'm trying to use the edx-sga but have no luck. What I have done so far are:

+ Installed edx-sga (install from source) and added it to the /edx/app/edxapp/edx-platform/cms/envs/common.py
+ Added edx_sga to advanced_modules in Settings

But I could not find the Staff Grade Assignment:




Am I missing something?


Thanks,

Trinh

Sarina Canelake

unread,
Jun 23, 2014, 8:47:32 AM6/23/14
to edx-code
Yes - the "Advanced" section you are looking for will not be under "problem", it will be its own green button:



See the "Advanced" green button there? That's what you'll want to click.

Peter Pinch

unread,
Jun 23, 2014, 9:21:58 AM6/23/14
to edx-...@googlegroups.com
Thanks Sarina. I added your screenshot to the README.

- Peter




Peter Pinch |  Production Manager, Office of Digital Learning
Massachusetts Institute of Technology
11 Cambridge Center  |  Cambridge MA 02142
pdp...@mit.edu | T 617-253-6256C 617-652-0183



On Jun 23, 2014, at 8:47 AM, Sarina Canelake <sar...@edx.org> wrote:

Yes - the "Advanced" section you are looking for will not be under "problem", it will be its own green button:

<Screen Shot 2014-06-23 at 8.46.36 AM.png>

See the "Advanced" green button there? That's what you'll want to click.
On Mon, Jun 23, 2014 at 4:19 AM, Trinh Nguyen <dangt...@gmail.com> wrote:
Hi Peter,

I'm trying to use the edx-sga but have no luck. What I have done so far are:

+ Installed edx-sga (install from source) and added it to the /edx/app/edxapp/edx-platform/cms/envs/common.py
+ Added edx_sga to advanced_modules in Settings

But I could not find the Staff Grade Assignment:

<edx_sga.png>

Trinh Nguyen

unread,
Jun 23, 2014, 10:24:36 AM6/23/14
to edx-...@googlegroups.com
Hi Sarina,

I could not see that Advanced button either:




BTW, I added edx_sga to both these files:

+ /edx/app/edxapp/edx-platform/cms/envs/common.py
+ /edx/app/edxapp/edx-platform/lms/envs/common.py


And extended the "advanced_modules" key as following:



Is there anything wrong?


Carson Gee

unread,
Jun 23, 2014, 10:30:05 AM6/23/14
to edx-...@googlegroups.com
Have you added the feature flag to enable the advanced problem types? Per https://github.com/edx/edx-platform/blob/master/docs/en_us/developers/source/xblocks.rst#deploying-your-xblock You may need to add:
'ALLOW_ALL_ADVANCED_COMPONENTS': True,
To your FEATURE dictionary.

Carson

Trinh Nguyen

unread,
Jun 23, 2014, 10:33:31 AM6/23/14
to edx-...@googlegroups.com
Oh, totally forgot that part. Thank Carson a lot!

Ned Batchelder

unread,
Jun 23, 2014, 10:34:02 AM6/23/14
to edx-...@googlegroups.com
Peter (and Carson, etc): Thanks so much for adding to the Open edX ecosystem.  There's a little-known page on the wiki (I just re-found it!) listing XBlocks: https://github.com/edx/edx-platform/wiki/List-of-XBlocks     This block is already there (thanks Paul!), but we should remember to keep this up-to-date.

It would be great to add a description to the wiki page so we can start to build an interesting catalog there.

--Ned.

Trinh Nguyen

unread,
Jun 23, 2014, 10:40:41 AM6/23/14
to edx-...@googlegroups.com
Awesome! I got it to work! Thanks again!

Trinh Nguyen

unread,
Jun 23, 2014, 11:02:48 AM6/23/14
to edx-...@googlegroups.com
FYI, I got this error when trying to create a Staff Graded Assignment:

TemplateDoesNotExist: staff_graded_assignment/show.html

That is because I installed edx_sga using the setup.py file (pip could not find edx_sga). It turned out that the templates folder was not copied, so to solve this issue I have to copy it to /edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/edx_sga-0.1-py2.7.egg/edx_sga manually.

And everything is fine now!

Carson Gee

unread,
Jun 23, 2014, 2:04:44 PM6/23/14
to edx-...@googlegroups.com

Yeah, I think we had to install it with the -e flag to get around that (I added an issue to the repo to fix setup.py so that won’t be needed in the future). So the command is

pip install -e git+https://github.com/mitodl/edx-sga#egg=edx-sga

I also added it to PyPi, but again until the setup.py file is fixed up, that won’t work right as you pointed out.

Tinko Minko

unread,
Jun 25, 2014, 6:09:29 PM6/25/14
to edx-...@googlegroups.com
Hi Peter,

I was trying to install edx-sga. I installed it to "/edx/app/edxapp/venvs/edxapp/lib/python2.7/site-packages". I also added "edx_sga" to  /edx/app/edxapp/edx-platform/cms/envs/common.py and /edx/app/edxapp/edx-platform/lms/envs/common.py, and set ALLOW_ALL_ADVANCED_COMPONENTS to True

But in Studio when I try to add "Staff Graded Assignment", I get an error. The screenshot is attached.

edx_sga-error.png

Tinko Minko

unread,
Jun 25, 2014, 7:22:40 PM6/25/14
to edx-...@googlegroups.com
cmd error log is attached.
error_log.txt

Trinh Nguyen

unread,
Jun 25, 2014, 7:45:22 PM6/25/14
to edx-...@googlegroups.com
How about the "advanced_modules"?



Tinko Minko

unread,
Jun 26, 2014, 5:59:52 AM6/26/14
to edx-...@googlegroups.com
I also did that, but still get the same error when I try to create SGA.  Trinh, can you tell me how did you install edx-sga (the command that you used and installation location)?

Thanks.

Carson Gee

unread,
Jun 26, 2014, 11:54:17 AM6/26/14
to edx-...@googlegroups.com

Ah, this error is related to the opaque-keys change and we haven’t caught up yet. You will need to use release tag release-2014-05-20 or earlier for this xblock to work until we can get it updated. The command for installing on an ansible built system is

sudo -u edxapp /edx/bin/pip.edxapp install -e git+[https://github.com/mitodl/edx-sga#egg=edx-sga](https://github.com/mitodl/edx-sga#egg=edx-sga)

However I would recommend making a change in the edx-platform repo adding -e git+[https://github.com/mitodl/edx-sga#egg=edx-sga](https://github.com/mitodl/edx-sga#egg=edx-sga) to requirements/edx/github.txt so that it gets picked up by the configuration and paver commands.

Carson Gee

unread,
Jun 26, 2014, 12:05:48 PM6/26/14
to edx-...@googlegroups.com
Sorry about the weird formatting there...should be:
sudo -u edxapp /edx/bin/pip.edxapp install -e git+https://github.com/mitodl/edx-sga#egg=edx-sga

and
-e git+https://github.com/mitodl/edx-sga#egg=edx-sga

Anas El Hadj Amor

unread,
Jun 27, 2014, 6:33:39 AM6/27/14
to edx-...@googlegroups.com
Hi guys. 

I tried to install SGA using only the command Carson suggested. The installation seemed to work. However, whenever I try to use SGA (when I create a unit in a course) I get the same error as Tinko, the exact same thing. 

Anyone has any ideas ?

Regards, 

Anas

Prabhanshu Pandit

unread,
Jun 27, 2014, 7:42:01 AM6/27/14
to edx-...@googlegroups.com
Thank you very much for this SGA xblock, just want to know is there any limitation on filetypes which is going to be uploaded (I mean what are the filestype supported for the file uplaod)

Carson Gee

unread,
Jun 27, 2014, 9:34:41 AM6/27/14
to edx-...@googlegroups.com
There aren't any file type limitations, but it would be a nice feature to be able to configure it in studio per problem.

Carson Gee

unread,
Jul 2, 2014, 1:54:42 PM7/2/14
to edx-...@googlegroups.com
I just wanted to update this that thanks to the coding efforts of David Adams, SGA now works off of the edx-platform master branch /post opaque-keys.  I have tagged the release that worked pre opaque keys as 0.1.0 in case you are still on older edx-platform code and created a new release in the repo as 0.2.0 that is the latest.  Thanks again to David for the help.


Anas El Hadj Amor

unread,
Jul 3, 2014, 6:38:38 AM7/3/14
to edx-...@googlegroups.com
Hi, it is far better now ! 

I do not get the " 'Location' is not iterable " error anymore (the update was great and fast, thank you guys).

However, I still get an error, and I can't upload files. I used the "inspect element" of Chrome to try to understand what happened. I get this : 



When I try to upload something this is what happens :
I click on the "Select a file" button, I pick my file, I click on the "Upload name_of_the_file".
The "Uploading..." message appears, and then it get stuck at 100%. The console prompts then the error of the attached file above.
Nothing else happens. 
If I refresh the page the "No file has been uploaded." message is still here.

Sorry to bring you bad news (again)... I hope it's just a small error.

Best Regards,

Anas

Prathibha B

unread,
Jul 3, 2014, 6:59:28 AM7/3/14
to edx-...@googlegroups.com
I'm getting the following error:

We're having trouble rendering your component

Students will not be able to access this component. Re-edit your component to fix the error.

Error: staff_graded_assignment/show.html         



Peter Pinch

unread,
Jul 3, 2014, 7:20:09 AM7/3/14
to edx-...@googlegroups.com
Hi Anas. How big is the file you are trying to upload? We have seen this behavior when the uploaded file is larger than the nginx limit. I forget what the default configuration is in the production stack, but I think it's on the order of a few MB. 

One of the things on our todo list is better feedback to users when and why the upload fails. 

Please try a smaller file and let us know if that is successful. 

- Peter



Peter Pinch |  Production Manager, Office of Digital Learning
Massachusetts Institute of Technology
11 Cambridge Center  |  Cambridge MA 02142
pdp...@mit.edu | T 617-253-6256C 617-652-0183



Peter Pinch

unread,
Jul 3, 2014, 7:21:20 AM7/3/14
to edx-...@googlegroups.com
I haven't seen that particular error. Is that in Studio (CMS)? Do you get a stack trace in the log files?

- Peter



Peter Pinch |  Production Manager, Office of Digital Learning
Massachusetts Institute of Technology
11 Cambridge Center  |  Cambridge MA 02142
pdp...@mit.edu | T 617-253-6256C 617-652-0183



Prathibha B

unread,
Jul 3, 2014, 7:30:11 AM7/3/14
to edx-...@googlegroups.com
Its in studio. It shows 

Prathibha B

unread,
Jul 3, 2014, 7:30:26 AM7/3/14
to edx-...@googlegroups.com
it shows TemplateDoesNotExist: staff_graded_assignment/show.html

Prathibha B

unread,
Jul 3, 2014, 7:50:40 AM7/3/14
to edx-...@googlegroups.com
As mentioned Trinh, I've copied the template. Still I'm getting the same error.

Anas El Hadj Amor

unread,
Jul 3, 2014, 8:08:40 AM7/3/14
to edx-...@googlegroups.com
Hi Peter,

I tried three files : 19ko, 2,5Mo, 7ko.
They were .txt or .odt files.
None of them worked.

But you're right,  I do not get the same error for the 2,5Mo file and the others. 

This is the error for a small file (7ko) :


For a big one, I get the error that I posted (I just tried with a 7Mo file), it is totally normal.

Sorry I didn't post the right error the first time.

Best Regards,

Anas

Anas El Hadj Amor

unread,
Jul 3, 2014, 8:09:19 AM7/3/14
to edx-...@googlegroups.com
Hi Prathibha, to install it I suggest you to do this :

First uninstall edx-sga.
Then (if you're not on vagrant, if you are I think the two first commands are useless) do this :

  • sudo -H -u edxapp bash
  • source /edx/app/edxapp/edxapp_env
  • cd /edx/app/edxapp/edx-platform
  • git clone https://github.com/mitodl/edx-sga
  • cd edx-sga
  • python setup.py install 
  • cp -R templates/ /edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/edx_sga-0.2.0-py2.7.egg/

This should work. I did the same thing and restarted the cms/lms just to be sure, but I do not know Python and it is probably overkill.

Best Regards,

Anas

Yarko Tymciurak

unread,
Jul 3, 2014, 4:02:05 PM7/3/14
to edx-...@googlegroups.com
On Thu, Jul 3, 2014 at 7:09 AM, Anas El Hadj Amor <anaselh...@gmail.com> wrote:
Hi Prathibha, to install it I suggest you to do this :

First uninstall edx-sga.
Then (if you're not on vagrant, if you are I think the two first commands are useless) do this :

  • sudo -H -u edxapp bash
  • source /edx/app/edxapp/edxapp_env
  • cd /edx/app/edxapp/edx-platform
  • git clone https://github.com/mitodl/edx-sga
  • cd edx-sga
  • python setup.py install 
  • cp -R templates/ /edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/edx_sga-0.2.0-py2.7.egg/

This should work. I did the same thing and restarted the cms/lms just to be sure, but I do not know Python and it is probably overkill.

... something is wrong - if you ned to copy "templates" manually into installed python site-packages;

either there is some process step missing / not completed, or the setup for edx-sga is missing something;

... or...

You should, in general, not be messing manually with python package installation space.
(got the chills reading this, even more so when I started about others starting to muck around in that space).

Hope someone nails down the problem here.

Trinh Nguyen

unread,
Jul 3, 2014, 7:34:04 PM7/3/14
to edx-...@googlegroups.com
I believe the setup for edx-sga is missing the templates part.

John Swope

unread,
Jul 8, 2014, 3:24:40 PM7/8/14
to edx-...@googlegroups.com
I am getting the same error as Anas. Files upload to 100%, but aren't submitted for grading. Chrome Inspect shows a 500 error. I am testing with small plain text files. I am pasting my server log, if it helps. Many thanks in advance!

Jul  8 19:16:34 ip-172-31-19-193 [service_variant=lms][courseware.module_render][env:sandbox] ERROR [ip-172-31-19-193  27515] [module_render.py:634] - error executing xblock handler

Traceback (most recent call last):

  File "/edx/app/edxapp/edx-platform/lms/djangoapps/courseware/module_render.py", line 615, in _invoke_xblock_handler

    resp = instance.handle(handler, req, suffix)

  File "/edx/app/edxapp/venvs/edxapp/src/xblock/xblock/core.py", line 284, in handle

    return self.runtime.handle(self, handler_name, request, suffix)

  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 960, in handle

    return super(MetricsMixin, self).handle(block, handler_name, request, suffix=suffix)

  File "/edx/app/edxapp/venvs/edxapp/src/xblock/xblock/runtime.py", line 643, in handle

    results = handler(request, suffix)

  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/edx_sga-0.2.0-py2.7.egg/edx_sga/sga.py", line 252, in upload_assignment

    self.location.to_deprecated_string(), self.uploaded_sha1, self.uploaded_filename)

AttributeError: 'Location' object has no attribute 'to_deprecated_string'

Jul  8 19:16:34 ip-172-31-19-193 [service_variant=lms][root][env:sandbox] ERROR [ip-172-31-19-193  27515] [exceptions.py:9] - Uncaught exception from <class 'django.core.handlers.wsgi.WSGIHandler'>

Traceback (most recent call last):

  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response

    response = callback(request, *callback_args, **callback_kwargs)

  File "/edx/app/edxapp/edx-platform/lms/djangoapps/courseware/module_render.py", line 545, in handle_xblock_callback

    return _invoke_xblock_handler(request, course_id, usage_id, handler, suffix, request.user)

  File "/edx/app/edxapp/edx-platform/lms/djangoapps/courseware/module_render.py", line 615, in _invoke_xblock_handler

    resp = instance.handle(handler, req, suffix)

  File "/edx/app/edxapp/venvs/edxapp/src/xblock/xblock/core.py", line 284, in handle

    return self.runtime.handle(self, handler_name, request, suffix)

  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 960, in handle

    return super(MetricsMixin, self).handle(block, handler_name, request, suffix=suffix)

File "/edx/app/edxapp/venvs/edxapp/src/xblock/xblock/runtime.py", line 643, in handle

    results = handler(request, suffix)

  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/edx_sga-0.2.0-py2.7.egg/edx_sga/sga.py", line 252, in upload_assignment

    self.location.to_deprecated_string(), self.uploaded_sha1, self.uploaded_filename)

AttributeError: 'Location' object