<commit_before>Staff Graded Assignment XBlock
==============================

This package provides an XBlock for use with the edX platform which
provides a staff graded assignment. Students are invited to upload files
which encapsulate their work on the assignment. Instructors are then
able to download the files and enter grades for the assignment.

Note that this package is both an XBlock and a Django application. 

Installation
============


1. Install Package 

   with pip for evaluation and testing:

   -  ``sudo su - edxapp -s /bin/bash``
   -  ``. edxapp_env``
   -  ``pip install -e git+https://github.com/mitodl/edx-sga@release#egg=edx-sga``

   in production:
	
   - In ``/edx/app/edxapp/edx-platform/requirements/edx/github.txt``, add:
   
     .. code:: sh
   
          -e git+https://github.com/mitodl/edx-sga@release#egg=edx-sga

2. Enable advanced components in LMS and Studio (CMS).

   -  In ``edx-platform/lms/envs/common.py``, uncomment:

      .. code:: sh

          # from xmodule.x_module import prefer_xmodules  
          # XBLOCK_SELECT_FUNCTION = prefer_xmodules  

   -  In ``edx-platform/cms/envs/common.py``, uncomment:

      .. code:: sh

          # from xmodule.x_module import prefer_xmodules  
          # XBLOCK_SELECT_FUNCTION = prefer_xmodules  

   -  In ``edx-platform/cms/envs/common.py``, change:

      .. code:: sh

          'ALLOW_ALL_ADVANCED_COMPONENTS': False,

      to

      .. code:: sh

          'ALLOW_ALL_ADVANCED_COMPONENTS': True,
          
3. Configure file storage

   devstack defaults to local storage, but fullstack defaults to S3. You have 
   two options in fullstack:
   
   1. Use local storage (useful for evaluation and testing)
   
      In ``edx-platform/lms/envs/aws.py`` after:
      
      .. code:: sh

          DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
      
      add:
      
      .. code:: sh

          del DEFAULT_FILE_STORAGE
          MEDIA_ROOT = "/edx/var/edxapp/uploads"
   
   2. Use S3 storage (default)
   
      - TBD directions for changing S3 settings


Course Authoring in edX Studio
==============================

1. Change Advanced Settings

   1. Open a course you are authoring and select "Settings" ⇒ "Advanced
      Settings
   2. Navigate to the section titled "Advanced Module List"
   3. Add "edx\_sga" to module list.
   4. Studio should save your changes automatically.
   
.. figure:: https://github.com/mitodl/edx-sga/blob/screenshots/img/screenshot-studio-advanced-settings.png<commit_msg>making file paths root relative<commit_after>Staff Graded Assignment XBlock
==============================

This package provides an XBlock for use with the edX platform which
provides a staff graded assignment. Students are invited to upload files
which encapsulate their work on the assignment. Instructors are then
able to download the files and enter grades for the assignment.

Note that this package is both an XBlock and a Django application. 

Installation
============


1. Install Package 

   with pip for evaluation and testing:

   -  ``sudo su - edxapp -s /bin/bash``
   -  ``. edxapp_env``
   -  ``pip install -e git+https://github.com/mitodl/edx-sga@release#egg=edx-sga``

   in production:
	
   - In ``/edx/app/edxapp/edx-platform/requirements/edx/github.txt``, add:
   
     .. code:: sh
   
          -e git+https://github.com/mitodl/edx-sga@release#egg=edx-sga

2. Enable advanced components in LMS and Studio (CMS).

   -  In ``/edx/app/edxapp/edx-platform/lms/envs/common.py``, uncomment:

      .. code:: sh

          # from xmodule.x_module import prefer_xmodules  
          # XBLOCK_SELECT_FUNCTION = prefer_xmodules  

   -  In ``/edx/app/edxapp/edx-platform/cms/envs/common.py``, uncomment:

      .. code:: sh

          # from xmodule.x_module import prefer_xmodules  
          # XBLOCK_SELECT_FUNCTION = prefer_xmodules  

   -  In ``/edx/app/edxapp/edx-platform/cms/envs/common.py``, change:

      .. code:: sh

          'ALLOW_ALL_ADVANCED_COMPONENTS': False,

      to

      .. code:: sh

          'ALLOW_ALL_ADVANCED_COMPONENTS': True,
          
3. Configure file storage

   devstack defaults to local storage, but fullstack defaults to S3. You have 
   two options in fullstack:
   
   1. Use local storage (useful for evaluation and testing)
   
      In ``/edx/app/edxapp/edx-platform/lms/envs/aws.py`` after:
      
      .. code:: sh

          DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
      
      add:
      
      .. code:: sh

          del DEFAULT_FILE_STORAGE
          MEDIA_ROOT = "/edx/var/edxapp/uploads"
   
   2. Use S3 storage (default)
   
      - TBD directions for changing S3 settings


Course Authoring in edX Studio
==============================

1. Change Advanced Settings

   1. Open a course you are authoring and select "Settings" ⇒ "Advanced
      Settings
   2. Navigate to the section titled "Advanced Module List"
   3. Add "edx\_sga" to module list.
   4. Studio should save your changes automatically.
   
.. figure:: https://github.com/mitodl/edx-sga/blob/screenshots/img/screenshot-studio-advanced-settings.png
{'fraction_non_alphanumeric': 0.11892732219199378, 'fraction_numerical': 0.0058297706956859695, 'mean_word_length': 2.596785464709993, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7334206', 'n_tokens_mistral': 1709, 'n_tokens_neox': 1604, 'n_words': 467}