diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 0000000..5008ddf
Binary files /dev/null and b/.DS_Store differ
diff --git a/.gitignore b/.gitignore
index 7f6b817..91e7ded 100644
--- a/.gitignore
+++ b/.gitignore
@@ -115,7 +115,7 @@ venv.bak/
.spyproject
# Rope project settings
-.ropeproject
+.ropeprojectig
# mkdocs documentation
/site
@@ -129,3 +129,4 @@ dmypy.json
.pyre/
.DS_Store
+.idea/
diff --git a/README.md b/README.md
index 131e5e3..205a0e2 100644
--- a/README.md
+++ b/README.md
@@ -2,15 +2,37 @@
An XBlock for Empowr's course platform that allows for the input and checking of any programming language.
+![Code Editor Screenshot](code-editor.png)
+
+
+* [CodeEditorXblock](#codeeditorxblock)
+ * [TODO](#todo)
+ * [Installation](#installation)
+ * [Run the Django development server](#run-the-django-development-server)
+ * [Supported Languages](#supported-languages)
+ * [Adding support for a language](#adding-support-for-a-language)
+ * [To find the mime-type](#to-find-the-mime-type)
+ * [To find the url](#to-find-the-url)
+
+
+
+## TODO
+
+ - Fix Solution Tab. Most work for a solution tab is done, however it doesn't properly display.
+ - Add support for all CodeMirror languages. This is an easy task, just tedious.
+
## Installation
1. Make sure you have have Python 3.8 installed on your computer.
-2. Clone the repo with `git clone --recurse-submodules git@github.com:EmpowrOrg/CodeEditorXblock.git`. This will give you the repo including the xblock-sdk submodule.
+2. Clone the repo with `git clone --recurse-submodules git@github.com:EmpowrOrg/CodeEditorXblock.git`. This will give
+ you the repo including the xblock-sdk submodule.
3. Create and Activate the Virtual Environment:
-You must have a virtual environment tool installed on your computer. For more information, see [Install XBlock Prerequisites](https://edx.readthedocs.io/projects/xblock-tutorial/en/latest/getting_started/prereqs.html).
+You must have a virtual environment tool installed on your computer. For more information,
+see [Install XBlock Prerequisites](https://edx.readthedocs.io/projects/xblock-tutorial/en/latest/getting_started/prereqs.html)
+.
Then create the virtual environment in your CodeEditorXblock directory.
@@ -22,11 +44,15 @@ Run the following command to activate the virtual environment.
`source venv/bin/activate`
+Install the plugin with
+
+`pip install -e swiftplugin`
+
4. Navigate to the xblock-sdk directory and run the following command to install the requirements.
`pip install -r requirements/base.txt`
-## Run the Django development server
+### Run the Django development server
Navigate to the xblock-sdk directory and run the following commands.
@@ -35,3 +61,65 @@ Navigate to the xblock-sdk directory and run the following commands.
`python manage.py migrate`
`python manage.py runserver`
+
+## Supported Languages
+
+When specifying a language you must put in the correct mime-type for the plugin. Here all the supported languages and
+their mime-types
+
+| Language Name | Mime-Type |
+|---------------|-------------------|
+| APL | text/apl |
+| ASN.1 | text/x-ttcn-asn |
+| C | text/x-csrc |
+| C++ | text/x-c++src |
+| C# | text/x-csharp |
+| Java | text/x-java |
+| Kotlin | text/x-kotlin |
+| Python | text/x-python |
+| Scala | text/x-scala |
+| Squirrel | text/x-squirrel |
+| Swift | text/x-swift |
+| Objective-C | text/x-objectivec |
+
+
+Code Mirror supports many more languages. If you do not see your language supported just check out the
+[doc](https://codemirror.net/5/mode/).
+
+### Adding support for a language
+
+It's really simple to add plugin support for
+any [language already supported by CodeMirror](https://codemirror.net/5/mode/).
+Open ![swiftplugin.py](/swiftplugin/swiftplugin/swiftplugin.py) and scroll down to the dictionary of mime-types and
+urls.
+
+To add support you need both the mime-type and the url.
+
+#### To find the mime-type
+Add the mime-type you wish to add support for. You can find this by looking at the list of supported languages, clicking
+on the langauge you want, and then scrolling to the bottom of the page.
+Ex: `text/x-kotlin`
+
+#### To find the url
+You can find the url needed by going to
+the [CodeMirror git folder for their supported modes](https://github.com/codemirror/codemirror5/blob/master/mode/index.html)
+
+Look for the folder name of the language you wish to support.
+
+Ex: If you want to add Kotlin, then you search for Kotlin in the file, and see it's folder name
+is `clike`.
+Ex:`
`
+
+Go [here](https://github.com/codemirror/codemirror5/tree/master/mode) and click into the folder name you just discovered
+of the language you wish to support.
+
+Notice the name of the `.js` file in this folder.
+Ex: If you were adding Kotlin, the js is `clike.js`
+
+Now just append the folder name and the .js name to this
+path `https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.2/mode/`
+
+The final Url for Kotlin would look like: `https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.2/mode/clike/clike.js`
+
+And now you can just add the mime-type and url to the dictionary like
+`"text/x-kotlin": "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.2/mode/clike/clike.js",`
diff --git a/code-editor.png b/code-editor.png
new file mode 100644
index 0000000..175cd42
Binary files /dev/null and b/code-editor.png differ
diff --git a/codingxblock/codingxblock/__init__.py b/codingxblock/codingxblock/__init__.py
deleted file mode 100644
index c68ff9e..0000000
--- a/codingxblock/codingxblock/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from .codingxblock import CodeEditorXBlock
diff --git a/codingxblock/codingxblock/codingxblock.py b/codingxblock/codingxblock/codingxblock.py
deleted file mode 100644
index 8253c38..0000000
--- a/codingxblock/codingxblock/codingxblock.py
+++ /dev/null
@@ -1,82 +0,0 @@
-"""
-This plugin allows the students to write swift code and submit it as a problem.
-The plugin will send the code to an API that will send a correct or failure response.
-If correct, the user will see a confirmation message.
-If incorrect, the user will see the differences between their answer and the expected answer.
-The user may optionally see the solution code as well.
-
-The teacher will be able to upload what the solution code is.
-They will also be able to upload the solution answer.
-These two are both required.
-The teacher will have a toggle on whether they wish to allow the user see the solution code or not.
-"""
-
-import pkg_resources
-from web_fragments.fragment import Fragment
-from xblock.core import XBlock
-from xblock.fields import String, Scope
-
-
-class CodeEditorXBlock(XBlock):
- """
- Students can write and submit code in response to a problem.
- Teachers can upload and allow students to view solution code.
- """
-
- # Fields are defined on the class. You can access them in your code as
- # self..
-
- # TO-DO: delete count, and define your own fields.
- placeholder_text = String(
- default="", scope=Scope.user_state,
- help="Some text to test as a field",
- )
-
- def resource_string(self, path):
- """Handy helper for getting resources from our kit."""
- data = pkg_resources.resource_string(__name__, path)
- return data.decode("utf8")
-
- # TO-DO: change this view to display your data your own way.
- def student_view(self, context=None):
- """
- The primary view of the CodeEditorXBlock, shown to students
- when viewing courses.
- """
- html = self.resource_string("static/html/codingxblock.html")
- frag = Fragment(html.format(self=self))
- frag.add_css(self.resource_string("static/css/codingxblock.css"))
- frag.add_javascript(self.resource_string("static/js/src/codingxblock.js"))
- frag.initialize_js('CodeEditorXBlock')
- return frag
-
- # TO-DO: change this handler to perform your own actions. You may need more
- # than one handler, or you may not need any handlers at all.
- @XBlock.json_handler
- def increment_count(self, data, suffix=''):
- """
- An example handler, which increments the data.
- """
- # Just to show data coming in...
- assert data['hello'] == 'world'
-
- self.count += 1
- return {"count": self.count}
-
- # TO-DO: change this to create the scenarios you'd like to see in the
- # workbench while developing your XBlock.
- @staticmethod
- def workbench_scenarios():
- """A canned scenario for display in the workbench."""
- return [
- ("CodeEditorXBlock",
- """
- """),
- ("Multiple CodeEditorXBlock",
- """
-
-
-
-
- """),
- ]
diff --git a/codingxblock/codingxblock/static/css/codingxblock.css b/codingxblock/codingxblock/static/css/codingxblock.css
deleted file mode 100644
index 7b3c99b..0000000
--- a/codingxblock/codingxblock/static/css/codingxblock.css
+++ /dev/null
@@ -1 +0,0 @@
-/* CSS for CodeEditorXBlock */
diff --git a/codingxblock/codingxblock/static/html/codingxblock.html b/codingxblock/codingxblock/static/html/codingxblock.html
deleted file mode 100644
index 43da393..0000000
--- a/codingxblock/codingxblock/static/html/codingxblock.html
+++ /dev/null
@@ -1,4 +0,0 @@
-