diff --git a/cms/envs/common.py b/cms/envs/common.py index 4b7902e80f..2d21641ec1 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -165,10 +165,6 @@ FEATURES = { 'ENABLE_DISCUSSION_SERVICE': True, 'ENABLE_TEXTBOOK': True, - # .. documented_elsewhere: true - # .. documented_elsewhere_name: ENABLE_STUDENT_NOTES - 'ENABLE_STUDENT_NOTES': True, - # DO NOT SET TO True IN THIS FILE # Doing so will cause all courses to be released on production 'DISABLE_START_DATES': False, # When True, all courses will be active, regardless of start date diff --git a/lms/djangoapps/courseware/tests/test_tabs.py b/lms/djangoapps/courseware/tests/test_tabs.py index 87480304be..c8b87f0e9e 100644 --- a/lms/djangoapps/courseware/tests/test_tabs.py +++ b/lms/djangoapps/courseware/tests/test_tabs.py @@ -640,7 +640,6 @@ class CourseTabListTestCase(TabListTestCase): @patch.dict("django.conf.settings.FEATURES", { "ENABLE_TEXTBOOK": True, "ENABLE_DISCUSSION_SERVICE": True, - "ENABLE_STUDENT_NOTES": True, "ENABLE_EDXNOTES": True, }) def test_iterate_displayable(self): diff --git a/lms/djangoapps/notes/__init__.py b/lms/djangoapps/notes/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lms/djangoapps/notes/migrations/0001_initial.py b/lms/djangoapps/notes/migrations/0001_initial.py deleted file mode 100644 index af73316723..0000000000 --- a/lms/djangoapps/notes/migrations/0001_initial.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from __future__ import absolute_import -from django.db import migrations, models -from django.conf import settings -from opaque_keys.edx.django.models import CourseKeyField - - -class Migration(migrations.Migration): - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ] - - operations = [ - migrations.CreateModel( - name='Note', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('course_id', CourseKeyField(max_length=255, db_index=True)), - ('uri', models.CharField(max_length=255, db_index=True)), - ('text', models.TextField(default=b'')), - ('quote', models.TextField(default=b'')), - ('range_start', models.CharField(max_length=2048)), - ('range_start_offset', models.IntegerField()), - ('range_end', models.CharField(max_length=2048)), - ('range_end_offset', models.IntegerField()), - ('tags', models.TextField(default=b'')), - ('created', models.DateTimeField(db_index=True, auto_now_add=True, null=True)), - ('updated', models.DateTimeField(auto_now=True, db_index=True)), - ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)), - ], - ), - ] diff --git a/lms/djangoapps/notes/migrations/0002_remove_tables.py b/lms/djangoapps/notes/migrations/0002_remove_tables.py deleted file mode 100644 index 8c19d49149..0000000000 --- a/lms/djangoapps/notes/migrations/0002_remove_tables.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.25 on 2019-10-01 18:23 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('notes', '0001_initial'), - ] - - operations = [ - migrations.RemoveField( - model_name='note', - name='user', - ), - migrations.DeleteModel( - name='Note', - ), - ] diff --git a/lms/djangoapps/notes/migrations/__init__.py b/lms/djangoapps/notes/migrations/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lms/djangoapps/notes/models.py b/lms/djangoapps/notes/models.py deleted file mode 100644 index 07fff11508..0000000000 --- a/lms/djangoapps/notes/models.py +++ /dev/null @@ -1,4 +0,0 @@ -""" -Notes models -""" -from __future__ import absolute_import diff --git a/lms/envs/common.py b/lms/envs/common.py index 28d3d37fc0..89505eda20 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -97,19 +97,6 @@ FEATURES = { 'ENABLE_DISCUSSION_SERVICE': True, 'ENABLE_TEXTBOOK': True, - # .. toggle_name: ENABLE_STUDENT_NOTES - # .. toggle_implementation: DjangoSetting - # .. toggle_default: True - # .. toggle_description: Enables the Student Notes API and UI. - # .. toggle_category: ???? - # .. toggle_use_cases: open_edx - # .. toggle_creation_date: 2014-11-13 - # .. toggle_expiration_date: None - # .. toggle_warnings: None - # .. toggle_tickets: TNL-659 - # .. toggle_status: supported - 'ENABLE_STUDENT_NOTES': True, - # discussion home panel, which includes a subscription on/off setting for discussion digest emails. # this should remain off in production until digest notifications are online. 'ENABLE_DISCUSSION_HOME_PANEL': False, @@ -1638,7 +1625,6 @@ discussion_vendor_js = [ 'js/split.js' ] -notes_js = ['js/notes.js'] instructor_dash_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'js/instructor_dashboard/**/*.js')) verify_student_js = [ @@ -1919,10 +1905,6 @@ PIPELINE['JAVASCRIPT'] = { 'source_filenames': discussion_vendor_js, 'output_filename': 'js/discussion_vendor.js', }, - 'notes': { - 'source_filenames': notes_js, - 'output_filename': 'js/notes.js', - }, 'instructor_dash': { 'source_filenames': instructor_dash_js, 'output_filename': 'js/instructor_dash.js', @@ -2339,7 +2321,6 @@ INSTALLED_APPS = [ 'openedx.core.djangoapps.django_comment_common', # Notes - 'notes', 'edxnotes', # Splash screen diff --git a/lms/static/js/notes.js b/lms/static/js/notes.js deleted file mode 100644 index 462e774509..0000000000 --- a/lms/static/js/notes.js +++ /dev/null @@ -1,168 +0,0 @@ -// Once generated by CoffeeScript 1.9.3, but now lives as pure JS -/* eslint-disable */ -(function() { - var StudentNotes, - bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; - - StudentNotes = (function() { - StudentNotes.prototype._debug = false; - - - /* - holds elements with annotator() instances - */ - - StudentNotes.prototype.targets = []; - - - /* - Adds a listener for "notes" events that may bubble up from descendants. - */ - - function StudentNotes($, el) { - this.onInitNotes = bind(this.onInitNotes, this); - var events; - if (this._debug) { - console.log('student notes init', arguments, this); - } - if (!$(el).data('notes-instance')) { - events = { - 'notes:init': this.onInitNotes - }; - $(el).delegate('*', events); - $(el).data('notes-instance', this); - } - } - - - /* - Initializes annotations on a container element in response to an init event. - */ - - StudentNotes.prototype.onInitNotes = function(event, uri, storage_url, token) { - var courseid, found, idDUdiv, idUdiv, options, ova, parts, uri_root; - if (uri == null) { - uri = null; - } - if (storage_url == null) { - storage_url = null; - } - if (token == null) { - token = null; - } - event.stopPropagation(); - found = this.targets.some(function(target) { - return target === event.target; - }); - - /* - Get uri - */ - if (uri.substring(0, 4) !== "http") { - uri_root = window.location.href.split(/#|\?/).shift() || ""; - uri = uri_root + uri.substring(1); - } - parts = window.location.href.split("/"); - courseid = parts[4] + "/" + parts[5] + "/" + parts[6]; - - /* - Get id and name user - */ - idUdiv = $(event.target).parent().find(".idU")[0]; - idDUdiv = $(event.target).parent().find(".idDU")[0]; - idUdiv = (typeof idUdiv !== "undefined" ? idUdiv.innerHTML : ""); - idDUdiv = (typeof idDUdiv !== "undefined" ? idDUdiv.innerHTML : ""); - options = { - optionsAnnotator: { - permissions: { - user: { - id: idUdiv, - name: idDUdiv - }, - userString: function(user) { - if (user && user.name) { - return user.name; - } - return user; - }, - userId: function(user) { - if (user && user.id) { - return user.id; - } - return user; - } - }, - auth: { - token: token - }, - store: { - prefix: storage_url, - annotationData: { - uri: uri - }, - urls: { - create: '/create', - read: '/read/:id', - update: '/update/:id', - destroy: '/delete/:id', - search: '/search' - }, - loadFromSearch: { - limit: 10000, - uri: uri, - user: idUdiv - } - } - }, - optionsVideoJS: { - techOrder: ["html5", "flash", "youtube"], - customControlsOnMobile: true - }, - optionsOVA: { - posBigNew: 'none', - NumAnnotations: 20 - }, - optionsRichText: { - tinymce: { - selector: "li.annotator-item textarea", - plugins: "media image insertdatetime link code", - menubar: false, - toolbar_items_size: 'small', - extended_valid_elements: "iframe[src|frameborder|style|scrolling|class|width|height|name|align|id]", - toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image media rubric | code " - } - } - }; - if (found) { - if (Annotator._instances.length !== 0) { - $(event.target).annotator("destroy"); - } - return ova = new OpenVideoAnnotation.Annotator($(event.target), options); - } else { - if (event.target.id === "annotator-viewer") { - return ova = new OpenVideoAnnotation.Annotator($(event.target), options); - } else { - return this.targets.push(event.target); - } - } - }; - - return StudentNotes; - - })(); - - - /* - Enable notes by default on the document root. - To initialize annotations on a container element in the document: - - $('#myElement').trigger('notes:init'); - - Comment this line to disable notes. - */ - - $(document).ready(function($) { - return new StudentNotes($, this); - }); - -}).call(this);