From ea383e29ec9ea6bf772ac5cdc993fe92ab300f4d Mon Sep 17 00:00:00 2001 From: Braden MacDonald Date: Wed, 1 Apr 2015 11:45:10 -0700 Subject: [PATCH] Rename mentoring to problem builder to allow simultaneous installation --- .gitignore | 2 +- .travis.yml | 8 +-- README.md | 67 +++++++++--------- mentoring/migrations/0001_initial.py | 44 ------------ ..._course_id__chg_field_answer_student_id.py | 39 ---------- ..._id_name__add_unique_answer_course_id_s.py | 37 ---------- ...ue_lightchild_student_id_course_id_name.py | 56 --------------- .../0005_auto__chg_field_lightchild_name.py | 43 ----------- mentoring/v1/tests/__init__.py | 0 {mentoring => problem_builder}/__init__.py | 0 {mentoring => problem_builder}/answer.py | 0 {mentoring => problem_builder}/choice.py | 0 {mentoring => problem_builder}/locale | 0 {mentoring => problem_builder}/mcq.py | 0 {mentoring => problem_builder}/mentoring.py | 2 +- {mentoring => problem_builder}/message.py | 0 {mentoring => problem_builder}/models.py | 26 +------ {mentoring => problem_builder}/mrq.py | 0 .../public/css/answer.css | 0 .../public/css/mentoring-table.css | 0 .../public/css/mentoring.css | 0 .../public/css/mentoring_edit.css | 0 .../public/css/questionnaire-edit.css | 0 .../public/css/questionnaire.css | 0 .../img/immunity-map-assumptions-bg.png | Bin .../public/img/immunity-map-bg.png | Bin .../public/js/answer.js | 0 .../public/js/mentoring-table.js | 0 .../public/js/mentoring.js | 0 .../public/js/mentoring_assessment_view.js | 0 .../public/js/mentoring_edit.js | 0 .../public/js/mentoring_standard_view.js | 0 .../public/js/questionnaire.js | 0 .../public/js/vendor/jquery-shorten.js | 0 .../public/js/vendor/underscore-min.js | 0 .../public/themes/apros.css | 0 .../public/themes/lms.css | 0 .../questionnaire.py | 0 .../text/table-immunity-map-assumptions.txt | 0 .../static/text/table-immunity-map.txt | 0 {mentoring => problem_builder}/step.py | 0 {mentoring => problem_builder}/table.py | 0 .../templates/html/answer_editable.html | 0 .../templates/html/answer_read_only.html | 0 .../templates/html/mcqblock.html | 0 .../html/mentoring-column-add-button.html | 0 .../html/mentoring-table-add-button.html | 0 .../templates/html/mentoring-table.html | 0 .../templates/html/mentoring.html | 0 .../templates/html/mentoring_add_buttons.html | 0 .../templates/html/mentoring_attempts.html | 0 .../templates/html/mentoring_grade.html | 0 .../templates/html/mentoring_url_name.html | 0 .../templates/html/mrqblock.html | 0 .../html/questionnaire_add_buttons.html | 0 .../templates/html/ratingblock.html | 0 .../html/ratingblock_edit_preview.html | 0 .../templates/html/tip.html | 0 .../templates/html/tip_choice_group.html | 0 .../templates/xml/mentoring_assessment.xml | 0 .../templates/xml/mentoring_default.xml | 0 .../templates/xml/mentoring_demo.xml | 0 .../xml/mentoring_with_only_one_step.xml | 0 .../tests}/__init__.py | 0 .../tests/integration}/__init__.py | 0 .../tests/integration/base_test.py | 2 +- .../tests/integration/test_answer.py | 0 .../tests/integration/test_assessment.py | 0 .../tests/integration/test_mcq.py | 4 +- .../tests/integration/test_mentoring.py | 4 +- .../tests/integration/test_progression.py | 0 .../tests/integration/test_table.py | 0 .../xml/answer_blank_read_only.xml | 0 .../tests/integration/xml/answer_edit_1.xml | 0 .../tests/integration/xml/answer_edit_2.xml | 0 .../tests/integration/xml/assessment_1.xml | 0 .../tests/integration/xml/assessment_2.xml | 0 .../tests/integration/xml/mcq_1.xml | 0 .../integration/xml/mcq_with_comments_1.xml | 0 .../integration/xml/mcq_with_html_choices.xml | 0 .../integration/xml/mrq_with_html_choices.xml | 0 .../integration/xml/no_display_submit.xml | 0 .../tests/integration/xml/progression_1.xml | 0 .../tests/integration/xml/progression_2.xml | 0 .../tests/integration/xml/progression_3.xml | 0 .../tests/integration/xml/table_1.xml | 0 .../tests/integration/xml/table_2.xml | 0 .../tests/integration/xml/theme_1.xml | 0 .../tests/unit}/__init__.py | 0 .../tests/unit/test_mentoring.py | 12 ++-- .../tests/unit/test_migration.py | 2 +- .../tests/unit/test_step.py | 2 +- {mentoring => problem_builder}/tip.py | 0 .../unit => problem_builder/v1}/__init__.py | 0 .../v1/studio_xml_utils.py | 0 .../v1/tests}/__init__.py | 0 .../v1/tests/test_upgrade.py | 6 +- .../v1/tests/xml/v1_upgrade_a_new.xml | 0 .../v1/tests/xml/v1_upgrade_a_old.xml | 0 .../v1/tests/xml/v1_upgrade_b_new.xml | 0 .../v1/tests/xml/v1_upgrade_b_old.xml | 0 .../v1/tests/xml/v1_upgrade_c_new.xml | 0 .../v1/tests/xml/v1_upgrade_c_old.xml | 0 {mentoring => problem_builder}/v1/upgrade.py | 0 .../v1/xml_changes.py | 0 run_tests.py | 6 +- setup.py | 61 ++++++++-------- 107 files changed, 91 insertions(+), 332 deletions(-) delete mode 100644 mentoring/migrations/0001_initial.py delete mode 100644 mentoring/migrations/0002_auto__add_field_answer_course_id__chg_field_answer_student_id.py delete mode 100644 mentoring/migrations/0003_auto__del_unique_answer_student_id_name__add_unique_answer_course_id_s.py delete mode 100644 mentoring/migrations/0004_auto__add_lightchild__add_unique_lightchild_student_id_course_id_name.py delete mode 100644 mentoring/migrations/0005_auto__chg_field_lightchild_name.py delete mode 100644 mentoring/v1/tests/__init__.py rename {mentoring => problem_builder}/__init__.py (100%) rename {mentoring => problem_builder}/answer.py (100%) rename {mentoring => problem_builder}/choice.py (100%) rename {mentoring => problem_builder}/locale (100%) rename {mentoring => problem_builder}/mcq.py (100%) rename {mentoring => problem_builder}/mentoring.py (99%) rename {mentoring => problem_builder}/message.py (100%) rename {mentoring => problem_builder}/models.py (64%) rename {mentoring => problem_builder}/mrq.py (100%) rename {mentoring => problem_builder}/public/css/answer.css (100%) rename {mentoring => problem_builder}/public/css/mentoring-table.css (100%) rename {mentoring => problem_builder}/public/css/mentoring.css (100%) rename {mentoring => problem_builder}/public/css/mentoring_edit.css (100%) rename {mentoring => problem_builder}/public/css/questionnaire-edit.css (100%) rename {mentoring => problem_builder}/public/css/questionnaire.css (100%) rename {mentoring => problem_builder}/public/img/immunity-map-assumptions-bg.png (100%) rename {mentoring => problem_builder}/public/img/immunity-map-bg.png (100%) rename {mentoring => problem_builder}/public/js/answer.js (100%) rename {mentoring => problem_builder}/public/js/mentoring-table.js (100%) rename {mentoring => problem_builder}/public/js/mentoring.js (100%) rename {mentoring => problem_builder}/public/js/mentoring_assessment_view.js (100%) rename {mentoring => problem_builder}/public/js/mentoring_edit.js (100%) rename {mentoring => problem_builder}/public/js/mentoring_standard_view.js (100%) rename {mentoring => problem_builder}/public/js/questionnaire.js (100%) rename {mentoring => problem_builder}/public/js/vendor/jquery-shorten.js (100%) rename {mentoring => problem_builder}/public/js/vendor/underscore-min.js (100%) rename {mentoring => problem_builder}/public/themes/apros.css (100%) rename {mentoring => problem_builder}/public/themes/lms.css (100%) rename {mentoring => problem_builder}/questionnaire.py (100%) rename {mentoring => problem_builder}/static/text/table-immunity-map-assumptions.txt (100%) rename {mentoring => problem_builder}/static/text/table-immunity-map.txt (100%) rename {mentoring => problem_builder}/step.py (100%) rename {mentoring => problem_builder}/table.py (100%) rename {mentoring => problem_builder}/templates/html/answer_editable.html (100%) rename {mentoring => problem_builder}/templates/html/answer_read_only.html (100%) rename {mentoring => problem_builder}/templates/html/mcqblock.html (100%) rename {mentoring => problem_builder}/templates/html/mentoring-column-add-button.html (100%) rename {mentoring => problem_builder}/templates/html/mentoring-table-add-button.html (100%) rename {mentoring => problem_builder}/templates/html/mentoring-table.html (100%) rename {mentoring => problem_builder}/templates/html/mentoring.html (100%) rename {mentoring => problem_builder}/templates/html/mentoring_add_buttons.html (100%) rename {mentoring => problem_builder}/templates/html/mentoring_attempts.html (100%) rename {mentoring => problem_builder}/templates/html/mentoring_grade.html (100%) rename {mentoring => problem_builder}/templates/html/mentoring_url_name.html (100%) rename {mentoring => problem_builder}/templates/html/mrqblock.html (100%) rename {mentoring => problem_builder}/templates/html/questionnaire_add_buttons.html (100%) rename {mentoring => problem_builder}/templates/html/ratingblock.html (100%) rename {mentoring => problem_builder}/templates/html/ratingblock_edit_preview.html (100%) rename {mentoring => problem_builder}/templates/html/tip.html (100%) rename {mentoring => problem_builder}/templates/html/tip_choice_group.html (100%) rename {mentoring => problem_builder}/templates/xml/mentoring_assessment.xml (100%) rename {mentoring => problem_builder}/templates/xml/mentoring_default.xml (100%) rename {mentoring => problem_builder}/templates/xml/mentoring_demo.xml (100%) rename {mentoring => problem_builder}/templates/xml/mentoring_with_only_one_step.xml (100%) rename {mentoring/migrations => problem_builder/tests}/__init__.py (100%) rename {mentoring/tests => problem_builder/tests/integration}/__init__.py (100%) rename {mentoring => problem_builder}/tests/integration/base_test.py (98%) rename {mentoring => problem_builder}/tests/integration/test_answer.py (100%) rename {mentoring => problem_builder}/tests/integration/test_assessment.py (100%) rename {mentoring => problem_builder}/tests/integration/test_mcq.py (99%) rename {mentoring => problem_builder}/tests/integration/test_mentoring.py (95%) rename {mentoring => problem_builder}/tests/integration/test_progression.py (100%) rename {mentoring => problem_builder}/tests/integration/test_table.py (100%) rename {mentoring => problem_builder}/tests/integration/xml/answer_blank_read_only.xml (100%) rename {mentoring => problem_builder}/tests/integration/xml/answer_edit_1.xml (100%) rename {mentoring => problem_builder}/tests/integration/xml/answer_edit_2.xml (100%) rename {mentoring => problem_builder}/tests/integration/xml/assessment_1.xml (100%) rename {mentoring => problem_builder}/tests/integration/xml/assessment_2.xml (100%) rename {mentoring => problem_builder}/tests/integration/xml/mcq_1.xml (100%) rename {mentoring => problem_builder}/tests/integration/xml/mcq_with_comments_1.xml (100%) rename {mentoring => problem_builder}/tests/integration/xml/mcq_with_html_choices.xml (100%) rename {mentoring => problem_builder}/tests/integration/xml/mrq_with_html_choices.xml (100%) rename {mentoring => problem_builder}/tests/integration/xml/no_display_submit.xml (100%) rename {mentoring => problem_builder}/tests/integration/xml/progression_1.xml (100%) rename {mentoring => problem_builder}/tests/integration/xml/progression_2.xml (100%) rename {mentoring => problem_builder}/tests/integration/xml/progression_3.xml (100%) rename {mentoring => problem_builder}/tests/integration/xml/table_1.xml (100%) rename {mentoring => problem_builder}/tests/integration/xml/table_2.xml (100%) rename {mentoring => problem_builder}/tests/integration/xml/theme_1.xml (100%) rename {mentoring/tests/integration => problem_builder/tests/unit}/__init__.py (100%) rename {mentoring => problem_builder}/tests/unit/test_mentoring.py (91%) rename {mentoring => problem_builder}/tests/unit/test_migration.py (97%) rename {mentoring => problem_builder}/tests/unit/test_step.py (97%) rename {mentoring => problem_builder}/tip.py (100%) rename {mentoring/tests/unit => problem_builder/v1}/__init__.py (100%) rename {mentoring => problem_builder}/v1/studio_xml_utils.py (100%) rename {mentoring/v1 => problem_builder/v1/tests}/__init__.py (100%) rename {mentoring => problem_builder}/v1/tests/test_upgrade.py (95%) rename {mentoring => problem_builder}/v1/tests/xml/v1_upgrade_a_new.xml (100%) rename {mentoring => problem_builder}/v1/tests/xml/v1_upgrade_a_old.xml (100%) rename {mentoring => problem_builder}/v1/tests/xml/v1_upgrade_b_new.xml (100%) rename {mentoring => problem_builder}/v1/tests/xml/v1_upgrade_b_old.xml (100%) rename {mentoring => problem_builder}/v1/tests/xml/v1_upgrade_c_new.xml (100%) rename {mentoring => problem_builder}/v1/tests/xml/v1_upgrade_c_old.xml (100%) rename {mentoring => problem_builder}/v1/upgrade.py (100%) rename {mentoring => problem_builder}/v1/xml_changes.py (100%) diff --git a/.gitignore b/.gitignore index 8b7c8970..767c1df8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ *~ *.pyc /.coverage -/xblock_mentoring.egg-info +/xblock_problem_builder.egg-info /workbench.* /dist /templates diff --git a/.travis.yml b/.travis.yml index 0af70bb2..31de016f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,11 +9,11 @@ install: - "pip install -r $VIRTUAL_ENV/src/xblock-sdk/requirements.txt" - "pip install -r $VIRTUAL_ENV/src/xblock-sdk/test-requirements.txt" - "pip install -r requirements.txt" - - "pip uninstall -y xblock-mentoring && python setup.py sdist && pip install dist/xblock-mentoring-2.0.tar.gz" + - "pip uninstall -y xblock-problem-builder && python setup.py sdist && pip install dist/xblock-problem-builder-2.0.tar.gz" script: - - pep8 mentoring --max-line-length=120 - - pylint mentoring --disable=all --enable=function-redefined,undefined-variable,unused-variable - - python run_tests.py --with-coverage --cover-package=mentoring + - pep8 problem_builder --max-line-length=120 + - pylint problem_builder --disable=all --enable=function-redefined,undefined-variable,unused-variable + - python run_tests.py --with-coverage --cover-package=problem_builder notifications: email: false branches: diff --git a/README.md b/README.md index e40f6e86..0e6e18b1 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -Mentoring XBlock ----------------- +Problem Builder XBlock +---------------------- -[![Build Status](https://travis-ci.org/open-craft/xblock-mentoring.svg?branch=master)](https://travis-ci.org/open-craft/xblock-mentoring) +[![Build Status](https://travis-ci.org/open-craft/xblock-problem-builder.svg?branch=master)](https://travis-ci.org/open-craft/xblock-problem-builder) -This XBlock allows to automate the workflow of real-life mentoring, -within an edX course. +This XBlock allows creation of questions of various types and simulating the +workflow of real-life mentoring, within an edX course. It supports: @@ -24,10 +24,10 @@ It supports: * **Tables**, which allow to present answers from the student to free-form answers in a concise way. Supports custom headers. -The screenshot shows an example of a mentoring block containing a +The screenshot shows an example of a problem builder block containing a free-form question, two MCQs and one MRQ. -![Mentoring Example](doc/img/mentoring-example.png) +![Problem Builder Example](doc/img/mentoring-example.png) Installation ------------ @@ -43,23 +43,23 @@ $ pip install -r requirements.txt Enabling in Studio ------------------ -You can enable the Mentoring XBlock in studio through the advanced +You can enable the Problem Builder XBlock in studio through the advanced settings. 1. From the main page of a specific course, navigate to `Settings -> Advanced Settings` from the top menu. -2. Check for the `advanced_modules` policy key, and add `"mentoring"` +2. Check for the `advanced_modules` policy key, and add `"problem-builder"` to the policy value list. 3. Click the "Save changes" button. Usage ----- -When you add the `Mentoring` component to a course in the studio, the +When you add the `Problem Builder` component to a course in the studio, the built-in editing tools guide you through the process of configuring the block and adding individual questions. -### Mentoring modes +### Problem Builder modes There are 2 mentoring modes available: @@ -71,7 +71,7 @@ There are 2 mentoring modes available: students don't get tips or feedback, but only know if their answer was correct. Assessment mode comes with a default `max_attempts` of `2`. -Below are some LMS screenshots of a mentoring block in assessment mode. +Below are some LMS screenshots of a problem builder block in assessment mode. Question before submitting an answer: @@ -101,7 +101,7 @@ Screenshot after answering the question: ![Answer Complete](doc/img/answer-2.png) -You can add "Long Answer Recap" components to mentoring blocks later on +You can add "Long Answer Recap" components to problem builder blocks later on in the course to provide a read-only view of any answer that the student entered earlier. @@ -111,14 +111,14 @@ The read-only answer is rendered as a quote in the LMS: ### Multiple Choice Questions (MCQ) -Multiple Choice Questions can be added to a mentoring component and +Multiple Choice Questions can be added to a problem builder component and have the following configurable options: * Question - The question to ask the student * Message - A feedback message to display to the student after they have made their choice. * Weight - The weight is used when computing total grade/score of - the mentoring block. The larger the weight, the more influence this + the problem builder block. The larger the weight, the more influence this question will have on the grade. Value of zero means this question has no influence on the grade (float, defaults to `1`). * Correct Choice - Specify which choice[s] is considered correct. If @@ -175,7 +175,7 @@ MRQ questions have these configurable settings: * Message - A feedback message to display to the student after they have made their choice. * Weight - The weight is used when computing total grade/score of - the mentoring block. The larger the weight, the more influence this + the problem builder block. The larger the weight, the more influence this question will have on the grade. Value of zero means this question has no influence on the grade (float, defaults to `1`). * Hide Result - If set to True, the feedback icons next to each @@ -202,7 +202,7 @@ After successfully completing the questions: ### Tables -The mentoring table allows you to present answers to multiple +The problem builder table allows you to present answers to multiple free-form questions in a concise way. Once you create an "Answer Recap Table" inside a Mentoring component in Studio, you will be able to add columns to the table. Each column has an optional @@ -212,7 +212,7 @@ well as HTML components. Screenshot: -![Mentoring Table](doc/img/mentoring-table.png) +![Table Screenshot](doc/img/mentoring-table.png) ### Maximum Attempts @@ -236,19 +236,20 @@ be valid CSS (e.g. `50px`). Workbench installation and settings ----------------------------------- -Install to the workbench's virtualenv by running the following command form the mentoring repo root: +Install to the workbench's virtualenv by running the following command from the +problem builder repo root: ```bash pip install -r requirements.txt ``` In the main XBlock repository, create the following configuration file -in `workbench/settings_mentoring.py` in the XBlock repository: +in `workbench/settings_pb.py` in the XBlock repository: ```python from settings import * -INSTALLED_APPS += ('mentoring',) +INSTALLED_APPS += ('problem_builder',) DATABASES['default']['NAME'] = 'workbench.sqlite' ``` @@ -257,14 +258,14 @@ before starting the workbench. Run this from the XBlock repository root: ```bash -$ ./manage.py syncdb --settings=workbench.settings_mentoring +$ ./manage.py syncdb --settings=workbench.settings_pb ``` Running the workbench --------------------- ```bash -$ ./manage.py runserver 8000 --settings=workbench.settings_mentoring +$ ./manage.py runserver 8000 --settings=workbench.settings_pb ``` Access it at [http://localhost:8000/](http://localhost:8000). @@ -273,9 +274,9 @@ Running tests ------------- First, make sure the [XBlock SDK (Workbench)](https://github.com/edx/xblock-sdk) -is installed in the same virtual environment as xblock-mentoring. +is installed in the same virtual environment as xblock-problem-builder. -From the xblock-mentoring repository root, run the tests with the +From the xblock-problem-builder repository root, run the tests with the following command: ```bash @@ -285,7 +286,7 @@ $ ./run_tests.py If you want to run only the integration or the unit tests, append the directory to the command. You can also run separate modules in this manner. ```bash -$ ./run_tests.py mentoring/tests/unit +$ ./run_tests.py problem_builder/tests/unit ``` Extracting Translatable Strings @@ -308,13 +309,13 @@ i18n_tool dummy && i18n_tool generate Adding custom scenarios to the workbench ---------------------------------------- -Within the xblock-mentoring repository, create the `templates/xml` and +Within the xblock-problem-builder repository, create the `templates/xml` and add XML scenarios to it - all files with the `*.xml` extension will be automatically loaded by the workbench: ```bash $ mkdir templates/xml -$ cat > templates/xml/my_mentoring_scenario.xml +$ cat > templates/xml/my_pb_scenario.xml ``` Restart the workbench to take the new scenarios into account. @@ -322,16 +323,16 @@ Restart the workbench to take the new scenarios into account. Upgrading from Version 1 ------------------------ -To upgrade a course from the earlier version of this XBlock, run the following -command on a system with edx-platform and xblock-mentoring installed: +To upgrade a course from xblock-mentoring ("v1") to xblock-problem-builder +("v2"), run the following command on a system with edx-platform, +xblock-mentoring, and xblock-problem-builder installed: ```bash -$ SERVICE_VARIANT=cms DJANGO_SETTINGS_MODULE="cms.envs.devstack" python -m mentoring.v1.upgrade "Org/Course/Run" +$ SERVICE_VARIANT=cms DJANGO_SETTINGS_MODULE="cms.envs.devstack" python -m problem_builder.v1.upgrade "Org/Course/Run" ``` Where "Org/Course/Run" is replaced with the ID of the course to upgrade. License ------- -The Mentoring XBlock is available under the GNU Affero General -Public License (AGPLv3). +This XBlock is available under the GNU Affero General Public License (AGPLv3). diff --git a/mentoring/migrations/0001_initial.py b/mentoring/migrations/0001_initial.py deleted file mode 100644 index d494ff09..00000000 --- a/mentoring/migrations/0001_initial.py +++ /dev/null @@ -1,44 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'Answer' - db.create_table('mentoring_answer', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('name', self.gf('django.db.models.fields.CharField')(max_length=50, db_index=True)), - ('student_id', self.gf('django.db.models.fields.CharField')(max_length=20, db_index=True)), - ('student_input', self.gf('django.db.models.fields.TextField')(default='', blank=True)), - ('created_on', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('modified_on', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)), - )) - db.send_create_signal('mentoring', ['Answer']) - - # Adding unique constraint on 'Answer', fields ['student_id', 'name'] - db.create_unique('mentoring_answer', ['student_id', 'name']) - - def backwards(self, orm): - # Removing unique constraint on 'Answer', fields ['student_id', 'name'] - db.delete_unique('mentoring_answer', ['student_id', 'name']) - - # Deleting model 'Answer' - db.delete_table('mentoring_answer') - - models = { - 'mentoring.answer': { - 'Meta': {'unique_together': "(('student_id', 'name'),)", 'object_name': 'Answer'}, - 'created_on': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified_on': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'student_id': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'}), - 'student_input': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}) - } - } - - complete_apps = ['mentoring'] diff --git a/mentoring/migrations/0002_auto__add_field_answer_course_id__chg_field_answer_student_id.py b/mentoring/migrations/0002_auto__add_field_answer_course_id__chg_field_answer_student_id.py deleted file mode 100644 index 14e29b01..00000000 --- a/mentoring/migrations/0002_auto__add_field_answer_course_id__chg_field_answer_student_id.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding field 'Answer.course_id' - db.add_column('mentoring_answer', 'course_id', - self.gf('django.db.models.fields.CharField')(default='default', max_length=50, db_index=True), - keep_default=False) - - # Changing field 'Answer.student_id' - db.alter_column('mentoring_answer', 'student_id', self.gf('django.db.models.fields.CharField')(max_length=32)) - - def backwards(self, orm): - # Deleting field 'Answer.course_id' - db.delete_column('mentoring_answer', 'course_id') - - # Changing field 'Answer.student_id' - db.alter_column('mentoring_answer', 'student_id', self.gf('django.db.models.fields.CharField')(max_length=20)) - - models = { - 'mentoring.answer': { - 'Meta': {'unique_together': "(('student_id', 'name'),)", 'object_name': 'Answer'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'created_on': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified_on': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'student_id': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'student_input': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}) - } - } - - complete_apps = ['mentoring'] diff --git a/mentoring/migrations/0003_auto__del_unique_answer_student_id_name__add_unique_answer_course_id_s.py b/mentoring/migrations/0003_auto__del_unique_answer_student_id_name__add_unique_answer_course_id_s.py deleted file mode 100644 index fa206d20..00000000 --- a/mentoring/migrations/0003_auto__del_unique_answer_student_id_name__add_unique_answer_course_id_s.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Removing unique constraint on 'Answer', fields ['student_id', 'name'] - db.delete_unique('mentoring_answer', ['student_id', 'name']) - - # Adding unique constraint on 'Answer', fields ['course_id', 'student_id', 'name'] - db.create_unique('mentoring_answer', ['course_id', 'student_id', 'name']) - - def backwards(self, orm): - # Removing unique constraint on 'Answer', fields ['course_id', 'student_id', 'name'] - db.delete_unique('mentoring_answer', ['course_id', 'student_id', 'name']) - - # Adding unique constraint on 'Answer', fields ['student_id', 'name'] - db.create_unique('mentoring_answer', ['student_id', 'name']) - - models = { - 'mentoring.answer': { - 'Meta': {'unique_together': "(('student_id', 'course_id', 'name'),)", 'object_name': 'Answer'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'created_on': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified_on': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'student_id': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'student_input': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}) - } - } - - complete_apps = ['mentoring'] diff --git a/mentoring/migrations/0004_auto__add_lightchild__add_unique_lightchild_student_id_course_id_name.py b/mentoring/migrations/0004_auto__add_lightchild__add_unique_lightchild_student_id_course_id_name.py deleted file mode 100644 index b43d22c3..00000000 --- a/mentoring/migrations/0004_auto__add_lightchild__add_unique_lightchild_student_id_course_id_name.py +++ /dev/null @@ -1,56 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'LightChild' - db.create_table('mentoring_lightchild', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('name', self.gf('django.db.models.fields.CharField')(max_length=50, db_index=True)), - ('student_id', self.gf('django.db.models.fields.CharField')(max_length=32, db_index=True)), - ('course_id', self.gf('django.db.models.fields.CharField')(max_length=50, db_index=True)), - ('student_data', self.gf('django.db.models.fields.TextField')(default='', blank=True)), - ('created_on', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('modified_on', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)), - )) - db.send_create_signal('mentoring', ['LightChild']) - - # Adding unique constraint on 'LightChild', fields ['student_id', 'course_id', 'name'] - db.create_unique('mentoring_lightchild', ['student_id', 'course_id', 'name']) - - def backwards(self, orm): - # Removing unique constraint on 'LightChild', fields ['student_id', 'course_id', 'name'] - db.delete_unique('mentoring_lightchild', ['student_id', 'course_id', 'name']) - - # Deleting model 'LightChild' - db.delete_table('mentoring_lightchild') - - models = { - 'mentoring.answer': { - 'Meta': {'unique_together': "(('student_id', 'course_id', 'name'),)", 'object_name': 'Answer'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'created_on': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified_on': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'student_id': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'student_input': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}) - }, - 'mentoring.lightchild': { - 'Meta': {'unique_together': "(('student_id', 'course_id', 'name'),)", 'object_name': 'LightChild'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'created_on': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'student_data': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified_on': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'student_id': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}) - } - } - - complete_apps = ['mentoring'] diff --git a/mentoring/migrations/0005_auto__chg_field_lightchild_name.py b/mentoring/migrations/0005_auto__chg_field_lightchild_name.py deleted file mode 100644 index dfcd75a3..00000000 --- a/mentoring/migrations/0005_auto__chg_field_lightchild_name.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Changing field 'LightChild.name' - db.alter_column('mentoring_lightchild', 'name', self.gf('django.db.models.fields.CharField')(max_length=100)) - - def backwards(self, orm): - - # Changing field 'LightChild.name' - db.alter_column('mentoring_lightchild', 'name', self.gf('django.db.models.fields.CharField')(max_length=50)) - - models = { - 'mentoring.answer': { - 'Meta': {'unique_together': "(('student_id', 'course_id', 'name'),)", 'object_name': 'Answer'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'created_on': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified_on': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'student_id': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), - 'student_input': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}) - }, - 'mentoring.lightchild': { - 'Meta': {'unique_together': "(('student_id', 'course_id', 'name'),)", 'object_name': 'LightChild'}, - 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'created_on': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'modified_on': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'db_index': 'True'}), - 'student_data': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}), - 'student_id': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}) - } - } - - complete_apps = ['mentoring'] diff --git a/mentoring/v1/tests/__init__.py b/mentoring/v1/tests/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/mentoring/__init__.py b/problem_builder/__init__.py similarity index 100% rename from mentoring/__init__.py rename to problem_builder/__init__.py diff --git a/mentoring/answer.py b/problem_builder/answer.py similarity index 100% rename from mentoring/answer.py rename to problem_builder/answer.py diff --git a/mentoring/choice.py b/problem_builder/choice.py similarity index 100% rename from mentoring/choice.py rename to problem_builder/choice.py diff --git a/mentoring/locale b/problem_builder/locale similarity index 100% rename from mentoring/locale rename to problem_builder/locale diff --git a/mentoring/mcq.py b/problem_builder/mcq.py similarity index 100% rename from mentoring/mcq.py rename to problem_builder/mcq.py diff --git a/mentoring/mentoring.py b/problem_builder/mentoring.py similarity index 99% rename from mentoring/mentoring.py rename to problem_builder/mentoring.py index e606f1c9..5a72d0a1 100644 --- a/mentoring/mentoring.py +++ b/problem_builder/mentoring.py @@ -48,7 +48,7 @@ loader = ResourceLoader(__name__) _default_theme_config = { - 'package': 'mentoring', + 'package': 'problem_builder', 'locations': ['public/themes/lms.css'] } diff --git a/mentoring/message.py b/problem_builder/message.py similarity index 100% rename from mentoring/message.py rename to problem_builder/message.py diff --git a/mentoring/models.py b/problem_builder/models.py similarity index 64% rename from mentoring/models.py rename to problem_builder/models.py index fd7decd8..5b5e9fc0 100644 --- a/mentoring/models.py +++ b/problem_builder/models.py @@ -32,7 +32,7 @@ class Answer(models.Model): """ class Meta: - app_label = 'mentoring' + db_table = 'mentoring_answer' unique_together = (('student_id', 'course_id', 'name'),) name = models.CharField(max_length=50, db_index=True) @@ -46,27 +46,3 @@ def save(self, *args, **kwargs): # Force validation of max_length self.full_clean() super(Answer, self).save(*args, **kwargs) - - -class LightChild(models.Model): - """ - DEPRECATED. - Django model previously used to store LightChild student data. - - This is not used at all by any of the mentoring blocks but will - be kept here for the purpose of migrating data for other - LightChildren that are converted to XBlocks and need to migrate - data from Django to native XBlock fields. - """ - - class Meta: - app_label = 'mentoring' - managed = False # Don't create this table. This class is only to migrate data from an existing table. - unique_together = (('student_id', 'course_id', 'name'),) - - name = models.CharField(max_length=100, db_index=True) - student_id = models.CharField(max_length=32, db_index=True) - course_id = models.CharField(max_length=50, db_index=True) - student_data = models.TextField(blank=True, default='') - created_on = models.DateTimeField('created on', auto_now_add=True) - modified_on = models.DateTimeField('modified on', auto_now=True) diff --git a/mentoring/mrq.py b/problem_builder/mrq.py similarity index 100% rename from mentoring/mrq.py rename to problem_builder/mrq.py diff --git a/mentoring/public/css/answer.css b/problem_builder/public/css/answer.css similarity index 100% rename from mentoring/public/css/answer.css rename to problem_builder/public/css/answer.css diff --git a/mentoring/public/css/mentoring-table.css b/problem_builder/public/css/mentoring-table.css similarity index 100% rename from mentoring/public/css/mentoring-table.css rename to problem_builder/public/css/mentoring-table.css diff --git a/mentoring/public/css/mentoring.css b/problem_builder/public/css/mentoring.css similarity index 100% rename from mentoring/public/css/mentoring.css rename to problem_builder/public/css/mentoring.css diff --git a/mentoring/public/css/mentoring_edit.css b/problem_builder/public/css/mentoring_edit.css similarity index 100% rename from mentoring/public/css/mentoring_edit.css rename to problem_builder/public/css/mentoring_edit.css diff --git a/mentoring/public/css/questionnaire-edit.css b/problem_builder/public/css/questionnaire-edit.css similarity index 100% rename from mentoring/public/css/questionnaire-edit.css rename to problem_builder/public/css/questionnaire-edit.css diff --git a/mentoring/public/css/questionnaire.css b/problem_builder/public/css/questionnaire.css similarity index 100% rename from mentoring/public/css/questionnaire.css rename to problem_builder/public/css/questionnaire.css diff --git a/mentoring/public/img/immunity-map-assumptions-bg.png b/problem_builder/public/img/immunity-map-assumptions-bg.png similarity index 100% rename from mentoring/public/img/immunity-map-assumptions-bg.png rename to problem_builder/public/img/immunity-map-assumptions-bg.png diff --git a/mentoring/public/img/immunity-map-bg.png b/problem_builder/public/img/immunity-map-bg.png similarity index 100% rename from mentoring/public/img/immunity-map-bg.png rename to problem_builder/public/img/immunity-map-bg.png diff --git a/mentoring/public/js/answer.js b/problem_builder/public/js/answer.js similarity index 100% rename from mentoring/public/js/answer.js rename to problem_builder/public/js/answer.js diff --git a/mentoring/public/js/mentoring-table.js b/problem_builder/public/js/mentoring-table.js similarity index 100% rename from mentoring/public/js/mentoring-table.js rename to problem_builder/public/js/mentoring-table.js diff --git a/mentoring/public/js/mentoring.js b/problem_builder/public/js/mentoring.js similarity index 100% rename from mentoring/public/js/mentoring.js rename to problem_builder/public/js/mentoring.js diff --git a/mentoring/public/js/mentoring_assessment_view.js b/problem_builder/public/js/mentoring_assessment_view.js similarity index 100% rename from mentoring/public/js/mentoring_assessment_view.js rename to problem_builder/public/js/mentoring_assessment_view.js diff --git a/mentoring/public/js/mentoring_edit.js b/problem_builder/public/js/mentoring_edit.js similarity index 100% rename from mentoring/public/js/mentoring_edit.js rename to problem_builder/public/js/mentoring_edit.js diff --git a/mentoring/public/js/mentoring_standard_view.js b/problem_builder/public/js/mentoring_standard_view.js similarity index 100% rename from mentoring/public/js/mentoring_standard_view.js rename to problem_builder/public/js/mentoring_standard_view.js diff --git a/mentoring/public/js/questionnaire.js b/problem_builder/public/js/questionnaire.js similarity index 100% rename from mentoring/public/js/questionnaire.js rename to problem_builder/public/js/questionnaire.js diff --git a/mentoring/public/js/vendor/jquery-shorten.js b/problem_builder/public/js/vendor/jquery-shorten.js similarity index 100% rename from mentoring/public/js/vendor/jquery-shorten.js rename to problem_builder/public/js/vendor/jquery-shorten.js diff --git a/mentoring/public/js/vendor/underscore-min.js b/problem_builder/public/js/vendor/underscore-min.js similarity index 100% rename from mentoring/public/js/vendor/underscore-min.js rename to problem_builder/public/js/vendor/underscore-min.js diff --git a/mentoring/public/themes/apros.css b/problem_builder/public/themes/apros.css similarity index 100% rename from mentoring/public/themes/apros.css rename to problem_builder/public/themes/apros.css diff --git a/mentoring/public/themes/lms.css b/problem_builder/public/themes/lms.css similarity index 100% rename from mentoring/public/themes/lms.css rename to problem_builder/public/themes/lms.css diff --git a/mentoring/questionnaire.py b/problem_builder/questionnaire.py similarity index 100% rename from mentoring/questionnaire.py rename to problem_builder/questionnaire.py diff --git a/mentoring/static/text/table-immunity-map-assumptions.txt b/problem_builder/static/text/table-immunity-map-assumptions.txt similarity index 100% rename from mentoring/static/text/table-immunity-map-assumptions.txt rename to problem_builder/static/text/table-immunity-map-assumptions.txt diff --git a/mentoring/static/text/table-immunity-map.txt b/problem_builder/static/text/table-immunity-map.txt similarity index 100% rename from mentoring/static/text/table-immunity-map.txt rename to problem_builder/static/text/table-immunity-map.txt diff --git a/mentoring/step.py b/problem_builder/step.py similarity index 100% rename from mentoring/step.py rename to problem_builder/step.py diff --git a/mentoring/table.py b/problem_builder/table.py similarity index 100% rename from mentoring/table.py rename to problem_builder/table.py diff --git a/mentoring/templates/html/answer_editable.html b/problem_builder/templates/html/answer_editable.html similarity index 100% rename from mentoring/templates/html/answer_editable.html rename to problem_builder/templates/html/answer_editable.html diff --git a/mentoring/templates/html/answer_read_only.html b/problem_builder/templates/html/answer_read_only.html similarity index 100% rename from mentoring/templates/html/answer_read_only.html rename to problem_builder/templates/html/answer_read_only.html diff --git a/mentoring/templates/html/mcqblock.html b/problem_builder/templates/html/mcqblock.html similarity index 100% rename from mentoring/templates/html/mcqblock.html rename to problem_builder/templates/html/mcqblock.html diff --git a/mentoring/templates/html/mentoring-column-add-button.html b/problem_builder/templates/html/mentoring-column-add-button.html similarity index 100% rename from mentoring/templates/html/mentoring-column-add-button.html rename to problem_builder/templates/html/mentoring-column-add-button.html diff --git a/mentoring/templates/html/mentoring-table-add-button.html b/problem_builder/templates/html/mentoring-table-add-button.html similarity index 100% rename from mentoring/templates/html/mentoring-table-add-button.html rename to problem_builder/templates/html/mentoring-table-add-button.html diff --git a/mentoring/templates/html/mentoring-table.html b/problem_builder/templates/html/mentoring-table.html similarity index 100% rename from mentoring/templates/html/mentoring-table.html rename to problem_builder/templates/html/mentoring-table.html diff --git a/mentoring/templates/html/mentoring.html b/problem_builder/templates/html/mentoring.html similarity index 100% rename from mentoring/templates/html/mentoring.html rename to problem_builder/templates/html/mentoring.html diff --git a/mentoring/templates/html/mentoring_add_buttons.html b/problem_builder/templates/html/mentoring_add_buttons.html similarity index 100% rename from mentoring/templates/html/mentoring_add_buttons.html rename to problem_builder/templates/html/mentoring_add_buttons.html diff --git a/mentoring/templates/html/mentoring_attempts.html b/problem_builder/templates/html/mentoring_attempts.html similarity index 100% rename from mentoring/templates/html/mentoring_attempts.html rename to problem_builder/templates/html/mentoring_attempts.html diff --git a/mentoring/templates/html/mentoring_grade.html b/problem_builder/templates/html/mentoring_grade.html similarity index 100% rename from mentoring/templates/html/mentoring_grade.html rename to problem_builder/templates/html/mentoring_grade.html diff --git a/mentoring/templates/html/mentoring_url_name.html b/problem_builder/templates/html/mentoring_url_name.html similarity index 100% rename from mentoring/templates/html/mentoring_url_name.html rename to problem_builder/templates/html/mentoring_url_name.html diff --git a/mentoring/templates/html/mrqblock.html b/problem_builder/templates/html/mrqblock.html similarity index 100% rename from mentoring/templates/html/mrqblock.html rename to problem_builder/templates/html/mrqblock.html diff --git a/mentoring/templates/html/questionnaire_add_buttons.html b/problem_builder/templates/html/questionnaire_add_buttons.html similarity index 100% rename from mentoring/templates/html/questionnaire_add_buttons.html rename to problem_builder/templates/html/questionnaire_add_buttons.html diff --git a/mentoring/templates/html/ratingblock.html b/problem_builder/templates/html/ratingblock.html similarity index 100% rename from mentoring/templates/html/ratingblock.html rename to problem_builder/templates/html/ratingblock.html diff --git a/mentoring/templates/html/ratingblock_edit_preview.html b/problem_builder/templates/html/ratingblock_edit_preview.html similarity index 100% rename from mentoring/templates/html/ratingblock_edit_preview.html rename to problem_builder/templates/html/ratingblock_edit_preview.html diff --git a/mentoring/templates/html/tip.html b/problem_builder/templates/html/tip.html similarity index 100% rename from mentoring/templates/html/tip.html rename to problem_builder/templates/html/tip.html diff --git a/mentoring/templates/html/tip_choice_group.html b/problem_builder/templates/html/tip_choice_group.html similarity index 100% rename from mentoring/templates/html/tip_choice_group.html rename to problem_builder/templates/html/tip_choice_group.html diff --git a/mentoring/templates/xml/mentoring_assessment.xml b/problem_builder/templates/xml/mentoring_assessment.xml similarity index 100% rename from mentoring/templates/xml/mentoring_assessment.xml rename to problem_builder/templates/xml/mentoring_assessment.xml diff --git a/mentoring/templates/xml/mentoring_default.xml b/problem_builder/templates/xml/mentoring_default.xml similarity index 100% rename from mentoring/templates/xml/mentoring_default.xml rename to problem_builder/templates/xml/mentoring_default.xml diff --git a/mentoring/templates/xml/mentoring_demo.xml b/problem_builder/templates/xml/mentoring_demo.xml similarity index 100% rename from mentoring/templates/xml/mentoring_demo.xml rename to problem_builder/templates/xml/mentoring_demo.xml diff --git a/mentoring/templates/xml/mentoring_with_only_one_step.xml b/problem_builder/templates/xml/mentoring_with_only_one_step.xml similarity index 100% rename from mentoring/templates/xml/mentoring_with_only_one_step.xml rename to problem_builder/templates/xml/mentoring_with_only_one_step.xml diff --git a/mentoring/migrations/__init__.py b/problem_builder/tests/__init__.py similarity index 100% rename from mentoring/migrations/__init__.py rename to problem_builder/tests/__init__.py diff --git a/mentoring/tests/__init__.py b/problem_builder/tests/integration/__init__.py similarity index 100% rename from mentoring/tests/__init__.py rename to problem_builder/tests/integration/__init__.py diff --git a/mentoring/tests/integration/base_test.py b/problem_builder/tests/integration/base_test.py similarity index 98% rename from mentoring/tests/integration/base_test.py rename to problem_builder/tests/integration/base_test.py index c089ccb7..4b90884f 100644 --- a/mentoring/tests/integration/base_test.py +++ b/problem_builder/tests/integration/base_test.py @@ -24,7 +24,7 @@ # Studio adds a url_name property to each XBlock but Workbench doesn't. # Since we rely on it, we need to mock url_name support so it can be set via XML and # accessed like a normal field. -from mentoring import MentoringBlock +from problem_builder import MentoringBlock MentoringBlock.url_name = String() diff --git a/mentoring/tests/integration/test_answer.py b/problem_builder/tests/integration/test_answer.py similarity index 100% rename from mentoring/tests/integration/test_answer.py rename to problem_builder/tests/integration/test_answer.py diff --git a/mentoring/tests/integration/test_assessment.py b/problem_builder/tests/integration/test_assessment.py similarity index 100% rename from mentoring/tests/integration/test_assessment.py rename to problem_builder/tests/integration/test_assessment.py diff --git a/mentoring/tests/integration/test_mcq.py b/problem_builder/tests/integration/test_mcq.py similarity index 99% rename from mentoring/tests/integration/test_mcq.py rename to problem_builder/tests/integration/test_mcq.py index 69ad2c5d..9cfc1680 100644 --- a/mentoring/tests/integration/test_mcq.py +++ b/problem_builder/tests/integration/test_mcq.py @@ -23,7 +23,7 @@ import ddt from mock import patch, Mock -from mentoring import MentoringBlock +from problem_builder import MentoringBlock from .base_test import MentoringBaseTest @@ -262,7 +262,7 @@ def test_questionnaire_html_choices(self, page): self.assertIn('Congratulations!', messages.text) -@patch.object(MentoringBlock, 'get_theme', Mock(return_value={'package': 'mentoring', +@patch.object(MentoringBlock, 'get_theme', Mock(return_value={'package': 'problem_builder', 'locations': ['public/themes/lms.css']})) class MCQBlockAprosThemeTest(MCQBlockTest): """ diff --git a/mentoring/tests/integration/test_mentoring.py b/problem_builder/tests/integration/test_mentoring.py similarity index 95% rename from mentoring/tests/integration/test_mentoring.py rename to problem_builder/tests/integration/test_mentoring.py index 14b551a1..2f3863ef 100644 --- a/mentoring/tests/integration/test_mentoring.py +++ b/problem_builder/tests/integration/test_mentoring.py @@ -33,7 +33,7 @@ def test_display_submit_false_does_not_display_submit(self): def _get_mentoring_theme_settings(theme): return { - 'package': 'mentoring', + 'package': 'problem_builder', 'locations': ['public/themes/{}.css'.format(theme)] } @@ -69,6 +69,6 @@ def assert_status_icon_color(self, color): ('apros', "#ff0000") ) def test_lms_theme_applied(self, theme, expected_color): - with mock.patch("mentoring.MentoringBlock.get_theme") as patched_theme: + with mock.patch("problem_builder.MentoringBlock.get_theme") as patched_theme: patched_theme.return_value = _get_mentoring_theme_settings(theme) self.assert_status_icon_color(expected_color) diff --git a/mentoring/tests/integration/test_progression.py b/problem_builder/tests/integration/test_progression.py similarity index 100% rename from mentoring/tests/integration/test_progression.py rename to problem_builder/tests/integration/test_progression.py diff --git a/mentoring/tests/integration/test_table.py b/problem_builder/tests/integration/test_table.py similarity index 100% rename from mentoring/tests/integration/test_table.py rename to problem_builder/tests/integration/test_table.py diff --git a/mentoring/tests/integration/xml/answer_blank_read_only.xml b/problem_builder/tests/integration/xml/answer_blank_read_only.xml similarity index 100% rename from mentoring/tests/integration/xml/answer_blank_read_only.xml rename to problem_builder/tests/integration/xml/answer_blank_read_only.xml diff --git a/mentoring/tests/integration/xml/answer_edit_1.xml b/problem_builder/tests/integration/xml/answer_edit_1.xml similarity index 100% rename from mentoring/tests/integration/xml/answer_edit_1.xml rename to problem_builder/tests/integration/xml/answer_edit_1.xml diff --git a/mentoring/tests/integration/xml/answer_edit_2.xml b/problem_builder/tests/integration/xml/answer_edit_2.xml similarity index 100% rename from mentoring/tests/integration/xml/answer_edit_2.xml rename to problem_builder/tests/integration/xml/answer_edit_2.xml diff --git a/mentoring/tests/integration/xml/assessment_1.xml b/problem_builder/tests/integration/xml/assessment_1.xml similarity index 100% rename from mentoring/tests/integration/xml/assessment_1.xml rename to problem_builder/tests/integration/xml/assessment_1.xml diff --git a/mentoring/tests/integration/xml/assessment_2.xml b/problem_builder/tests/integration/xml/assessment_2.xml similarity index 100% rename from mentoring/tests/integration/xml/assessment_2.xml rename to problem_builder/tests/integration/xml/assessment_2.xml diff --git a/mentoring/tests/integration/xml/mcq_1.xml b/problem_builder/tests/integration/xml/mcq_1.xml similarity index 100% rename from mentoring/tests/integration/xml/mcq_1.xml rename to problem_builder/tests/integration/xml/mcq_1.xml diff --git a/mentoring/tests/integration/xml/mcq_with_comments_1.xml b/problem_builder/tests/integration/xml/mcq_with_comments_1.xml similarity index 100% rename from mentoring/tests/integration/xml/mcq_with_comments_1.xml rename to problem_builder/tests/integration/xml/mcq_with_comments_1.xml diff --git a/mentoring/tests/integration/xml/mcq_with_html_choices.xml b/problem_builder/tests/integration/xml/mcq_with_html_choices.xml similarity index 100% rename from mentoring/tests/integration/xml/mcq_with_html_choices.xml rename to problem_builder/tests/integration/xml/mcq_with_html_choices.xml diff --git a/mentoring/tests/integration/xml/mrq_with_html_choices.xml b/problem_builder/tests/integration/xml/mrq_with_html_choices.xml similarity index 100% rename from mentoring/tests/integration/xml/mrq_with_html_choices.xml rename to problem_builder/tests/integration/xml/mrq_with_html_choices.xml diff --git a/mentoring/tests/integration/xml/no_display_submit.xml b/problem_builder/tests/integration/xml/no_display_submit.xml similarity index 100% rename from mentoring/tests/integration/xml/no_display_submit.xml rename to problem_builder/tests/integration/xml/no_display_submit.xml diff --git a/mentoring/tests/integration/xml/progression_1.xml b/problem_builder/tests/integration/xml/progression_1.xml similarity index 100% rename from mentoring/tests/integration/xml/progression_1.xml rename to problem_builder/tests/integration/xml/progression_1.xml diff --git a/mentoring/tests/integration/xml/progression_2.xml b/problem_builder/tests/integration/xml/progression_2.xml similarity index 100% rename from mentoring/tests/integration/xml/progression_2.xml rename to problem_builder/tests/integration/xml/progression_2.xml diff --git a/mentoring/tests/integration/xml/progression_3.xml b/problem_builder/tests/integration/xml/progression_3.xml similarity index 100% rename from mentoring/tests/integration/xml/progression_3.xml rename to problem_builder/tests/integration/xml/progression_3.xml diff --git a/mentoring/tests/integration/xml/table_1.xml b/problem_builder/tests/integration/xml/table_1.xml similarity index 100% rename from mentoring/tests/integration/xml/table_1.xml rename to problem_builder/tests/integration/xml/table_1.xml diff --git a/mentoring/tests/integration/xml/table_2.xml b/problem_builder/tests/integration/xml/table_2.xml similarity index 100% rename from mentoring/tests/integration/xml/table_2.xml rename to problem_builder/tests/integration/xml/table_2.xml diff --git a/mentoring/tests/integration/xml/theme_1.xml b/problem_builder/tests/integration/xml/theme_1.xml similarity index 100% rename from mentoring/tests/integration/xml/theme_1.xml rename to problem_builder/tests/integration/xml/theme_1.xml diff --git a/mentoring/tests/integration/__init__.py b/problem_builder/tests/unit/__init__.py similarity index 100% rename from mentoring/tests/integration/__init__.py rename to problem_builder/tests/unit/__init__.py diff --git a/mentoring/tests/unit/test_mentoring.py b/problem_builder/tests/unit/test_mentoring.py similarity index 91% rename from mentoring/tests/unit/test_mentoring.py rename to problem_builder/tests/unit/test_mentoring.py index 8cbe28ad..7f7c800d 100644 --- a/mentoring/tests/unit/test_mentoring.py +++ b/problem_builder/tests/unit/test_mentoring.py @@ -2,8 +2,8 @@ import ddt from mock import MagicMock, Mock, patch from xblock.field_data import DictFieldData -from mentoring import MentoringBlock -from mentoring.mentoring import _default_theme_config +from problem_builder import MentoringBlock +from problem_builder.mentoring import _default_theme_config class TestMentoringBlock(unittest.TestCase): @@ -78,13 +78,13 @@ def test_theme_files_are_loaded_from_correct_package(self): package_name = 'some_package' theme_config = {MentoringBlock.theme_key: {'package': package_name, 'locations': ['lms.css']}} self.service_mock.get_settings_bucket = Mock(return_value=theme_config) - with patch("mentoring.mentoring.ResourceLoader") as patched_resource_loader: + with patch("problem_builder.mentoring.ResourceLoader") as patched_resource_loader: self.block.include_theme_files(fragment) patched_resource_loader.assert_called_with(package_name) @ddt.data( - ('mentoring', ['public/themes/lms.css']), - ('mentoring', ['public/themes/lms.css', 'public/themes/lms.part2.css']), + ('problem_builder', ['public/themes/lms.css']), + ('problem_builder', ['public/themes/lms.css', 'public/themes/lms.part2.css']), ('my_app.my_rules', ['typography.css', 'icons.css']), ) @ddt.unpack @@ -92,7 +92,7 @@ def test_theme_files_are_added_to_fragment(self, package_name, locations): fragment = MagicMock() theme_config = {MentoringBlock.theme_key: {'package': package_name, 'locations': locations}} self.service_mock.get_settings_bucket = Mock(return_value=theme_config) - with patch("mentoring.mentoring.ResourceLoader.load_unicode") as patched_load_unicode: + with patch("problem_builder.mentoring.ResourceLoader.load_unicode") as patched_load_unicode: self.block.include_theme_files(fragment) for location in locations: patched_load_unicode.assert_any_call(location) diff --git a/mentoring/tests/unit/test_migration.py b/problem_builder/tests/unit/test_migration.py similarity index 97% rename from mentoring/tests/unit/test_migration.py rename to problem_builder/tests/unit/test_migration.py index fb849a2e..412027ae 100644 --- a/mentoring/tests/unit/test_migration.py +++ b/problem_builder/tests/unit/test_migration.py @@ -1,5 +1,5 @@ import copy -from mentoring import MentoringBlock +from problem_builder import MentoringBlock from mock import MagicMock, Mock import unittest from xblock.field_data import DictFieldData diff --git a/mentoring/tests/unit/test_step.py b/problem_builder/tests/unit/test_step.py similarity index 97% rename from mentoring/tests/unit/test_step.py rename to problem_builder/tests/unit/test_step.py index 7f117d31..a428ccaf 100644 --- a/mentoring/tests/unit/test_step.py +++ b/problem_builder/tests/unit/test_step.py @@ -1,6 +1,6 @@ import unittest -from mentoring.step import StepMixin, StepParentMixin +from problem_builder.step import StepMixin, StepParentMixin from mock import Mock diff --git a/mentoring/tip.py b/problem_builder/tip.py similarity index 100% rename from mentoring/tip.py rename to problem_builder/tip.py diff --git a/mentoring/tests/unit/__init__.py b/problem_builder/v1/__init__.py similarity index 100% rename from mentoring/tests/unit/__init__.py rename to problem_builder/v1/__init__.py diff --git a/mentoring/v1/studio_xml_utils.py b/problem_builder/v1/studio_xml_utils.py similarity index 100% rename from mentoring/v1/studio_xml_utils.py rename to problem_builder/v1/studio_xml_utils.py diff --git a/mentoring/v1/__init__.py b/problem_builder/v1/tests/__init__.py similarity index 100% rename from mentoring/v1/__init__.py rename to problem_builder/v1/tests/__init__.py diff --git a/mentoring/v1/tests/test_upgrade.py b/problem_builder/v1/tests/test_upgrade.py similarity index 95% rename from mentoring/v1/tests/test_upgrade.py rename to problem_builder/v1/tests/test_upgrade.py index 3a7bbe42..bc2143f2 100644 --- a/mentoring/v1/tests/test_upgrade.py +++ b/problem_builder/v1/tests/test_upgrade.py @@ -18,11 +18,12 @@ # "AGPLv3". If not, see . # """ -Test that we can upgrade from mentoring v1 to mentoring v2. +Test that we can upgrade from mentoring v1 to problem builder (v2). """ import ddt from lxml import etree -from mentoring.v1.xml_changes import convert_xml_v1_to_v2 +from problem_builder import MentoringBlock +from problem_builder.v1.xml_changes import convert_xml_v1_to_v2 import os.path from StringIO import StringIO import unittest @@ -53,6 +54,7 @@ def setUp(self): "v1_upgrade_c", ) @XBlock.register_temp_plugin(HtmlBlock, "html") + @XBlock.register_temp_plugin(MentoringBlock, "mentoring") def test_xml_upgrade(self, file_name): """ Convert a v1 mentoring block to v2 and then compare the resulting block to a diff --git a/mentoring/v1/tests/xml/v1_upgrade_a_new.xml b/problem_builder/v1/tests/xml/v1_upgrade_a_new.xml similarity index 100% rename from mentoring/v1/tests/xml/v1_upgrade_a_new.xml rename to problem_builder/v1/tests/xml/v1_upgrade_a_new.xml diff --git a/mentoring/v1/tests/xml/v1_upgrade_a_old.xml b/problem_builder/v1/tests/xml/v1_upgrade_a_old.xml similarity index 100% rename from mentoring/v1/tests/xml/v1_upgrade_a_old.xml rename to problem_builder/v1/tests/xml/v1_upgrade_a_old.xml diff --git a/mentoring/v1/tests/xml/v1_upgrade_b_new.xml b/problem_builder/v1/tests/xml/v1_upgrade_b_new.xml similarity index 100% rename from mentoring/v1/tests/xml/v1_upgrade_b_new.xml rename to problem_builder/v1/tests/xml/v1_upgrade_b_new.xml diff --git a/mentoring/v1/tests/xml/v1_upgrade_b_old.xml b/problem_builder/v1/tests/xml/v1_upgrade_b_old.xml similarity index 100% rename from mentoring/v1/tests/xml/v1_upgrade_b_old.xml rename to problem_builder/v1/tests/xml/v1_upgrade_b_old.xml diff --git a/mentoring/v1/tests/xml/v1_upgrade_c_new.xml b/problem_builder/v1/tests/xml/v1_upgrade_c_new.xml similarity index 100% rename from mentoring/v1/tests/xml/v1_upgrade_c_new.xml rename to problem_builder/v1/tests/xml/v1_upgrade_c_new.xml diff --git a/mentoring/v1/tests/xml/v1_upgrade_c_old.xml b/problem_builder/v1/tests/xml/v1_upgrade_c_old.xml similarity index 100% rename from mentoring/v1/tests/xml/v1_upgrade_c_old.xml rename to problem_builder/v1/tests/xml/v1_upgrade_c_old.xml diff --git a/mentoring/v1/upgrade.py b/problem_builder/v1/upgrade.py similarity index 100% rename from mentoring/v1/upgrade.py rename to problem_builder/v1/upgrade.py diff --git a/mentoring/v1/xml_changes.py b/problem_builder/v1/xml_changes.py similarity index 100% rename from mentoring/v1/xml_changes.py rename to problem_builder/v1/xml_changes.py diff --git a/run_tests.py b/run_tests.py index 06d6a534..c4b17c38 100755 --- a/run_tests.py +++ b/run_tests.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- """ -Run tests for the Mentoring XBlock +Run tests for the Problem Builder XBlock This script is required to run our selenium tests inside the xblock-sdk workbench because the workbench SDK's settings file is not inside any python module. @@ -17,12 +17,12 @@ os.environ.setdefault("DJANGO_LIVE_TEST_SERVER_ADDRESS", "localhost:8081-8099") from django.conf import settings - settings.INSTALLED_APPS += ("mentoring", ) + settings.INSTALLED_APPS += ("problem_builder", ) from django.core.management import execute_from_command_line args = sys.argv[1:] paths = [arg for arg in args if arg[0] != '-'] if not paths: - paths = ["mentoring/tests/", "mentoring/v1/tests/"] + paths = ["problem_builder/tests/", "problem_builder/v1/tests/"] options = [arg for arg in args if arg not in paths] execute_from_command_line([sys.argv[0], "test"] + paths + options) diff --git a/setup.py b/setup.py index 23fd70cd..2af34c62 100644 --- a/setup.py +++ b/setup.py @@ -40,49 +40,48 @@ def package_data(pkg, root_list): # Main ############################################################## BLOCKS = [ - 'problem-builder = mentoring:MentoringBlock', - 'mentoring = mentoring:MentoringBlock', # Deprecated alias for problem-builder. Required to import older blocks. + 'problem-builder = problem_builder:MentoringBlock', - 'pb-table = mentoring:MentoringTableBlock', - 'pb-column = mentoring:MentoringTableColumn', - 'pb-answer = mentoring:AnswerBlock', - 'pb-answer-recap = mentoring:AnswerRecapBlock', - 'pb-mcq = mentoring:MCQBlock', - 'pb-rating = mentoring:RatingBlock', - 'pb-mrq = mentoring:MRQBlock', - 'pb-message = mentoring:MentoringMessageBlock', - 'pb-tip = mentoring:TipBlock', - 'pb-choice = mentoring:ChoiceBlock', + 'pb-table = problem_builder:MentoringTableBlock', + 'pb-column = problem_builder:MentoringTableColumn', + 'pb-answer = problem_builder:AnswerBlock', + 'pb-answer-recap = problem_builder:AnswerRecapBlock', + 'pb-mcq = problem_builder:MCQBlock', + 'pb-rating = problem_builder:RatingBlock', + 'pb-mrq = problem_builder:MRQBlock', + 'pb-message = problem_builder:MentoringMessageBlock', + 'pb-tip = problem_builder:TipBlock', + 'pb-choice = problem_builder:ChoiceBlock', # Deprecated. You can temporarily uncomment and run 'python setup.py develop' if you have these blocks # installed from testing mentoring v2 and need to get past an error message. - #'answer = mentoring:AnswerBlock', - #'mentoring-answer = mentoring:AnswerBlock', - #'answer-recap = mentoring:AnswerRecapBlock', - #'mentoring-answer-recap = mentoring:AnswerRecapBlock', - #'mcq = mentoring:MCQBlock', - #'mentoring-mcq = mentoring:MCQBlock', - #'rating = mentoring:RatingBlock', - #'mentoring-rating = mentoring:RatingBlock', - #'mrq = mentoring:MRQBlock', - #'mentoring-mrq = mentoring:MRQBlock', - #'tip = mentoring:TipBlock', - #'mentoring-tip = mentoring:TipBlock', - #'choice = mentoring:ChoiceBlock', - #'mentoring-choice = mentoring:ChoiceBlock', + #'mentoring = problem_builder:MentoringBlock', # Deprecated alias for problem-builder + #'answer = problem_builder:AnswerBlock', + #'mentoring-answer = problem_builder:AnswerBlock', + #'answer-recap = problem_builder:AnswerRecapBlock', + #'mentoring-answer-recap = problem_builder:AnswerRecapBlock', + #'mcq = problem_builder:MCQBlock', + #'mentoring-mcq = problem_builder:MCQBlock', + #'rating = problem_builder:RatingBlock', + #'mentoring-rating = problem_builder:RatingBlock', + #'mrq = problem_builder:MRQBlock', + #'mentoring-mrq = problem_builder:MRQBlock', + #'tip = problem_builder:TipBlock', + #'mentoring-tip = problem_builder:TipBlock', + #'choice = problem_builder:ChoiceBlock', + #'mentoring-choice = problem_builder:ChoiceBlock', ] setup( - name='xblock-mentoring', + name='xblock-problem-builder', version='2.0', - description='XBlock - Mentoring', - packages=['mentoring', 'mentoring.v1'], + description='XBlock - Problem Builder', + packages=['problem_builder', 'problem_builder.v1'], install_requires=[ 'XBlock', 'xblock-utils', ], - dependency_links = ['https://github.com/edx-solutions/xblock-utils/tarball/master#egg=xblock-utils'], entry_points={ 'xblock.v1': BLOCKS, }, - package_data=package_data("mentoring", ["templates", "public", "migrations"]), + package_data=package_data("problem_builder", ["templates", "public", "migrations"]), )