diff --git a/platform_plugin_turnitin/apps.py b/platform_plugin_turnitin/apps.py index 7741b9f..7c8da5c 100644 --- a/platform_plugin_turnitin/apps.py +++ b/platform_plugin_turnitin/apps.py @@ -34,12 +34,3 @@ class PlatformPluginTurnitinConfig(AppConfig): }, }, } - - def ready(self) -> None: - """ - Perform application initialization once the Django platform has been initialized. - """ - super().ready() - from platform_plugin_turnitin.turnitin import ( # no-qa pylint: disable=import-outside-toplevel,unused-import - TurnitinXBlock, - ) diff --git a/platform_plugin_turnitin/static/css/turnitin.css b/platform_plugin_turnitin/static/css/turnitin.css deleted file mode 100644 index 53a583b..0000000 --- a/platform_plugin_turnitin/static/css/turnitin.css +++ /dev/null @@ -1,225 +0,0 @@ -/* CSS for TurnitinXBlock */ - -.turnitin_block .count { - font-weight: bold; -} - -.turnitin_block p { - cursor: pointer; -} - - -/* Estilo base para todas las secciones */ -.turnitin-test-section { - padding: 20px; - margin-bottom: 20px; - display: flex; - justify-content: center; - align-items: center; - flex-direction: column; - box-sizing: border-box; - min-height: 200px; -} -/* Estilo para las secciones pares (gris claro) */ -.turnitin-test-section:nth-child(even) { - background-color: #f4f4f4; /* Gris claro */ -} - -/* Estilo para las secciones impares (blanco) */ -.turnitin-test-section:nth-child(odd) { - background-color: #ffffff; /* Blanco */ -} - - -.file-upload-container { - background-color: #ffffff; - padding: 20px 30px; - border-radius: 8px; - box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08); - max-width: 400px; - width: 100%; - text-align: center; -} - -h2 { - margin-bottom: 20px; - color: #333; -} - -.file-upload { - position: relative; - display: block; - margin: 20px 0; -} - -.file-upload input[type="file"] { - position: absolute; - width: 100%; - height: 100%; - left: 0; - top: 0; - opacity: 0; - cursor: pointer; -} - -.file-upload label { - padding: 10px 25px; - background-color: #4CAF50; - color: #fff; - border-radius: 5px; - transition: background-color 0.3s ease, transform 0.3s ease, color 0.3s ease; - cursor: pointer; - transform: scale(1); -} - -.file-upload label.file-selected { - background-color: #808080; /* Gris */ - transform: scale(1.05); -} - -/* Este selector garantiza que el cambio a rojo solo ocurra cuando se ha seleccionado un archivo */ -.file-upload label.file-selected:hover { - background-color: #00244d; /* Cambio a rojo al pasar el cursor */ - color: #FFFFFF; /* Letras blancas */ -} - -.selected-filename { - display: block; - margin-top: 10px; - font-size: 14px; - color: #555; - font-weight: bold; -} - - -button { - padding: 10px 25px; - background-color: #4CAF50; - color: #fff; - border: none; - border-radius: 5px; - transition: background-color 0.3s ease; - cursor: pointer; -} - -/* CSS PARA EL MODAL EULA */ -.modal { - display: none; - position: fixed; - top: 10%; - left: 10%; - width: 80%; - min-height: 300px; - max-height: 500px; - overflow-y: auto; - background-color: white; - z-index: 1000; - border: 1px solid #ccc; - box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); -} -.modal-content { - margin-top: 0; - padding-top: 20px; /* Ajusta segĂșn lo necesario */ -} - -/* CSS PARA STATUS*/ -.status-text { - font-size: 16px; - margin-top: 10px; - font-weight: bold; -} - -.red-text { - color: red; -} - -.yellow-text { - color: rgb(168, 168, 14); -} - -.green-text { - color: green; -} - - -.traffic-light { - width: 50px; - height: 150px; - background-color: #333; - border-radius: 15px; - display: flex; - flex-direction: column; - justify-content: space-between; - padding: 10px 0; - margin: 0 auto; -} - -.light { - width: 40px; - height: 40px; - border-radius: 50%; - background-color: #111; -} - -.red { - background-color: rgb(255, 0, 0); -} - -.yellow { - background-color: #ffee00; -} - -.green { - background-color: #00fb00; -} - -.off { - opacity: 0.3; -} - -.refresh-btn { - margin-top: 20px; - padding: 10px 20px; - border: none; - border-radius: 5px; - background-color: #0077CC; - color: #fff; - cursor: pointer; - font-size: 16px; - outline: none; - transition: background-color 0.3s; -} - -.refresh-btn:hover { - background-color: #0055AA; -} - - -.generate-btn { - margin-top: 10px; - padding: 10px 20px; - border: none; - border-radius: 5px; - background-color: #444; - color: #aaa; - cursor: not-allowed; - font-size: 16px; - outline: none; - transition: background-color 0.3s; -} - -.generate-btn.enabled { - background-color: #0077CC; - color: #fff; - cursor: pointer; -} - -.generate-btn.enabled:hover { - background-color: #0055AA; -} - -/* CSS PARA EL TEXT ASSESSMENT */ -#textsubmission{ - width: 400px; - height: 250px; -} diff --git a/platform_plugin_turnitin/static/html/cms.html b/platform_plugin_turnitin/static/html/cms.html deleted file mode 100644 index cc9fe1b..0000000 --- a/platform_plugin_turnitin/static/html/cms.html +++ /dev/null @@ -1 +0,0 @@ -

HOLA MUNDO

diff --git a/platform_plugin_turnitin/static/html/turnitin.html b/platform_plugin_turnitin/static/html/turnitin.html deleted file mode 100644 index db1053c..0000000 --- a/platform_plugin_turnitin/static/html/turnitin.html +++ /dev/null @@ -1,63 +0,0 @@ -
- -
-

EULA Viewer

- - - -
- -
-
-

File Upload

-
-
- - - No file selected -
- -
-
-
- - -
-

File Processing Status

-
-
-
-
-
-
- - -
- -
-

Similarity Processing Status

-
-
-
-
-
-
- - -
- - diff --git a/platform_plugin_turnitin/static/js/src/turnitin.js b/platform_plugin_turnitin/static/js/src/turnitin.js deleted file mode 100644 index 13ab409..0000000 --- a/platform_plugin_turnitin/static/js/src/turnitin.js +++ /dev/null @@ -1,269 +0,0 @@ -/* Javascript for TurnitinXBlock. */ -function TurnitinXBlock(runtime, element) { - - function updateCount(result) { - $('.count', element).text(result.count); - } - - function showEULA(htmlContent) { - $('#eulaModal .modal-content p').html(htmlContent); - $('#eulaModal').show(); - } - - function closeModal() { - $('#eulaModal', element).hide(); - } - - var handlerUrl = runtime.handlerUrl(element, 'increment_count'); - - $('p', element).click(function(eventObject) { - $.ajax({ - type: "POST", - url: handlerUrl, - data: JSON.stringify({"hello": "world"}), - success: updateCount - }); - }); - - $('#viewEULA', element).click(function() { - var handlerUrl = runtime.handlerUrl(element, 'get_eula_agreement'); - - $.ajax({ - type: "POST", - url: handlerUrl, - data: JSON.stringify({"hello": "world"}), - - success: function(response) { - if(response.status >= 400) { - alert(`ERROR: ${response.status} - No EULA page for the given version was found`); - } else { - showEULA(response.html); - } - }, - error: function() { - alert('Error getting EULA.'); - } - }); - }); - - $('#acceptEULA', element).click(function() { - var handlerUrl = runtime.handlerUrl(element, 'accept_eula_agreement'); - - $.ajax({ - type: "POST", - url: handlerUrl, - data: JSON.stringify({"hello": "world"}), - success: function(response) { - if(response.success === false && response.status >= 400) { - alert(`ERROR: ${response.status} - ${response.message}`); - } else { - alert('EULA successfully accepted!'); - } - }, - error: function() { - alert('Error accepting EULA.'); - } - }); - }); - - $('.modal-content button').click(closeModal); - - $('#uploadBtn', element).click(function(event) { - event.preventDefault(); - var handlerUrl = runtime.handlerUrl(element, 'upload_turnitin_submission_file'); - - var fileInput = $('#file')[0]; - var file = fileInput.files[0]; - - if (!file) { - alert('Please select .doc or .docx files.'); - return; - } - - var formData = new FormData(); - formData.append('uploaded_file', file); - - $.ajax({ - type: 'POST', - url: handlerUrl, - data: formData, - processData: false, - contentType: false, - success: function(response) { - if(response.success === false && response.status >= 400) { - alert(`ERROR: ${response.status} - ${response.message}`); - } else { - alert('File successfully uploaded to Turnitin!'); - } - }, - error: function() { - alert('Error uploading file.'); - } - }); - }); - - function updateSelectedFileName() { - var fileName = $(this).val().split('\\').pop(); - var fileExtension = fileName.split('.').pop().toLowerCase(); - var uploadButton = $('#uploadBtn'); - - if (fileExtension === 'doc' || fileExtension === 'docx') { - if (fileName) { - $(this).siblings('.selected-filename').text(fileName); - $(this).siblings('label').addClass('file-selected').text('Change File'); - uploadButton.prop('disabled', false); - } else { - $(this).siblings('.selected-filename').text('No file selected'); - $(this).siblings('label').removeClass('file-selected').text('Choose File'); - uploadButton.prop('disabled', true); - } - } else { - alert('Please, select .doc or .docx files'); - $(this).val(''); - $(this).siblings('.selected-filename').text('No file selected'); - $(this).siblings('label').removeClass('file-selected').text('Choose File'); - uploadButton.prop('disabled', true); - } - } - $('#file', element).on('change', updateSelectedFileName); - - $('#refreshBtn1', element).click(function(event) { - event.preventDefault(); - var handlerUrl = runtime.handlerUrl(element, 'get_submission_status'); - - $.ajax({ - type: "POST", - url: handlerUrl, - data: JSON.stringify({"hello": "world"}), - success: function(response) { - if(response.success === false && response.status >= 400) { - updateTrafficLightState('1', 'ERROR'); - alert(`ERROR: ${response.status} - ${response.message}`); - } else { - updateTrafficLightState('1', response['status']); - } - }, - error: function() { - alert('Error getting report status.'); - } - }); - }); - - - $('#generateReportBtn1', element).click(function(event) { - event.preventDefault(); - var handlerUrl = runtime.handlerUrl(element, 'generate_similarity_report'); - - $.ajax({ - type: "POST", - url: handlerUrl, - data: JSON.stringify({"hello": "world"}), - success: function(response) { - if(response.success === false && response.status >= 400) { - alert(`ERROR: ${response.status} - ${response.message}`); - } else { - alert('Successfully scheduled similarity report generation.'); - } - }, - error: function() { - alert('Error in similarity report generation.'); - } - }); - }); - - - - - $('#refreshBtn2', element).click(function(event) { - event.preventDefault(); - var handlerUrl = runtime.handlerUrl(element, 'get_similarity_report_status'); - - $.ajax({ - type: "POST", - url: handlerUrl, - data: JSON.stringify({"hello": "world"}), - success: function(response) { - if(response.success === false && response.status >= 400) { - updateTrafficLightState('2', 'ERROR'); - alert(`ERROR: ${response.status} - ${response.message}`); - } else { - updateTrafficLightState('2', response['status']); - } - }, - error: function() { - alert('Error getting report status.'); - } - }); - }); - - - $('#generateReportBtn2', element).click(function(event) { - event.preventDefault(); - var handlerUrl = runtime.handlerUrl(element, 'create_similarity_viewer'); - - $.ajax({ - type: "POST", - url: handlerUrl, - data: JSON.stringify({"hello": "world"}), - success: function(response) { - if(response.success === false && response.status >= 400) { - alert(`ERROR: ${response.status} - ${response.message}`); - } else { - alert('Redirecting...'); - openInNewTab(response.viewer_url); - } - }, - error: function() { - alert('Error getting Viewer URL.'); - } - }); - }); - - - function openInNewTab(url) { - window.open(url, '_blank'); - } - - - function updateTrafficLightState(semaphoreNumber, state) { - console.log(state); - const redLight = document.getElementById(`redLight${semaphoreNumber}`); - const yellowLight = document.getElementById(`yellowLight${semaphoreNumber}`); - const greenLight = document.getElementById(`greenLight${semaphoreNumber}`); - const generateReportBtn = document.getElementById(`generateReportBtn${semaphoreNumber}`); - const statusText = document.getElementById(`statusText${semaphoreNumber}`); - const refreshBtn2 = document.getElementById(`refreshBtn2`); - - redLight.classList.add('off'); - yellowLight.classList.add('off'); - greenLight.classList.add('off'); - generateReportBtn.disabled = true; - generateReportBtn.classList.remove('enabled'); - statusText.textContent = state; - - statusText.classList.remove('red-text', 'yellow-text', 'green-text'); - - switch (state) { - case 'ERROR': - redLight.classList.remove('off'); - statusText.classList.add('red-text'); - break; - case 'PROCESSING': - yellowLight.classList.remove('off'); - statusText.classList.add('yellow-text'); - break; - case 'COMPLETE': - greenLight.classList.remove('off'); - statusText.classList.add('green-text'); - generateReportBtn.disabled = false; - generateReportBtn.classList.add('enabled'); - refreshBtn2.disabled = false; - refreshBtn2.classList.add('enabled'); - break; - default: - redLight.classList.remove('off'); - statusText.classList.add('red-text'); - } - } - -} diff --git a/platform_plugin_turnitin/turnitin.py b/platform_plugin_turnitin/turnitin.py deleted file mode 100644 index d9fdc3e..0000000 --- a/platform_plugin_turnitin/turnitin.py +++ /dev/null @@ -1,389 +0,0 @@ -"""TO-DO: Write a description of what this XBlock is.""" - -import json -from datetime import datetime -from http import HTTPStatus - -import pkg_resources -from django.conf import settings -from django.contrib.auth import get_user_model -from django.utils import translation -from webob import Response -from xblock.core import XBlock -from xblock.fragment import Fragment -from xblockutils.resources import ResourceLoader - -from platform_plugin_turnitin.models import TurnitinSubmission -from platform_plugin_turnitin.turnitin_client.handlers import ( - get_eula_page, - get_similarity_report_info, - get_submission_info, - post_accept_eula_version, - post_create_submission, - post_create_viewer_launch_url, - put_generate_similarity_report, - put_upload_submission_file_content, -) - -User = get_user_model() - - -@XBlock.needs("user") -@XBlock.needs("user_state") -class TurnitinXBlock(XBlock): - """ - TO-DO: document what your XBlock does. - """ - - # Fields are defined on the class. You can access them in your code as - # self.. - - def resource_string(self, path): - """Handy helper for getting resources from our kit.""" - data = pkg_resources.resource_string(__name__, path) - return data.decode("utf8") - - def studio_view(self, context=None): - """ - Show primary view of the TurnitinXBlock, shown to students when viewing courses. - """ - if context: - pass # TO-DO: do something based on the context. - html = self.resource_string("static/html/cms.html") - frag = Fragment(html.format(self=self)) - frag.add_css(self.resource_string("static/css/turnitin.css")) - - # Add i18n js - statici18n_js_url = self._get_statici18n_js_url() - if statici18n_js_url: - frag.add_javascript_url( - self.runtime.local_resource_url(self, statici18n_js_url) - ) - - frag.add_javascript(self.resource_string("static/js/src/turnitin.js")) - frag.initialize_js("TurnitinXBlock") - return frag - - # TO-DO: change this view to display your data your own way. - def student_view(self, context=None): - """ - Show primary view of the TurnitinXBlock, shown to students when viewing courses. - """ - if context: - pass # TO-DO: do something based on the context. - html = self.resource_string("static/html/turnitin.html") - frag = Fragment(html.format(self=self)) - frag.add_css(self.resource_string("static/css/turnitin.css")) - - # Add i18n js - statici18n_js_url = self._get_statici18n_js_url() - if statici18n_js_url: - frag.add_javascript_url( - self.runtime.local_resource_url(self, statici18n_js_url) - ) - - frag.add_javascript(self.resource_string("static/js/src/turnitin.js")) - frag.initialize_js("TurnitinXBlock") - return frag - - def get_user_data(self): - """ - Fetch user-related data, including user ID, email, and name. - - Returns: - dict: A dictionary containing user ID, email, and name. - """ - user_service = self.runtime.service(self, "user") - current_user = user_service.get_current_user() - full_name = current_user.full_name.split() - return { - "user_id": current_user.opt_attrs["edx-platform.user_id"], - "user_email": current_user.emails[0], - "name": full_name[0] if full_name else "no_name", - "last_name": ( - " ".join(full_name[1:]) if len(full_name) > 1 else "no_last_name" - ), - } - - def get_django_user(self): - """ - Return the django user. - """ - current_user_id = self.get_user_data()["user_id"] - return User.objects.get(id=current_user_id) - - @XBlock.json_handler - def get_eula_agreement(self, data, suffix=""): # pylint: disable=unused-argument - """ - Fetch the End User License Agreement (EULA) content. - - Args: - data (dict): Input data for the request. - suffix (str, optional): Additional suffix for the request. Defaults to ''. - - Returns: - dict: A dictionary containing the HTML content of the EULA and the status code. - """ - response = get_eula_page() - return {"html": response.text, "status": response.status_code} - - @XBlock.json_handler - def accept_eula_agreement(self, data, suffix=""): # pylint: disable=unused-argument - """ - Submit acceptance of the EULA for the current user. - - Args: - data (dict): Input data for the request. - suffix (str, optional): Additional suffix for the request. Defaults to ''. - - Returns: - dict: The response after accepting the EULA. - """ - user_id = self.get_user_data()["user_id"] - date_now = datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%SZ") - payload = { - "user_id": str(user_id), - "accepted_timestamp": date_now, - "language": "en-US", - } - response = post_accept_eula_version(payload) - return response.json() - - def create_turnitin_submission_object(self): - """ - Create a Turnitin submission object based on the user's data. - - Returns: - Response: The response from the Turnitin submission API. - """ - user_data = self.get_user_data() - date_now = datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%SZ") - - payload = { - "owner": user_data["user_id"], - "title": self.location.block_id, # pylint: disable=no-member - "submitter": user_data["user_id"], - "owner_default_permission_set": "LEARNER", - "submitter_default_permission_set": "INSTRUCTOR", - "extract_text_only": False, - "metadata": { - "owners": [ - { - "id": user_data["user_id"], - "given_name": user_data["name"], - "family_name": user_data["last_name"], - "email": user_data["user_email"], - } - ], - "submitter": { - "id": user_data["user_id"], - "given_name": user_data["name"], - "family_name": user_data["last_name"], - "email": user_data["user_email"], - }, - "original_submitted_time": date_now, - }, - } - return post_create_submission(payload) - - @XBlock.handler - def upload_turnitin_submission_file( - self, data, suffix="" - ): # pylint: disable=unused-argument - """ - Handle the upload of the user's file to Turnitin. - - Args: - data (WebRequest): Web request containing the file to be uploaded. - suffix (str, optional): Additional suffix for the request. Defaults to ''. - - Returns: - Response: The response after uploading the file to Turnitin. - """ - turnitin_submission = self.create_turnitin_submission_object() - if turnitin_submission.status_code == HTTPStatus.CREATED: - turnitin_submission_id = turnitin_submission.json()["id"] - current_user = self.get_django_user() - submission = TurnitinSubmission( - user=current_user, turnitin_submission_id=turnitin_submission_id - ) - submission.save() - uploaded_file = data.params["uploaded_file"].file - response = put_upload_submission_file_content( - turnitin_submission_id, uploaded_file - ) - return Response( - json.dumps(response.json()), - ) - return Response( - json.dumps(turnitin_submission.json()), - ) - - @XBlock.json_handler - def get_submission_status(self, data, suffix=""): # pylint: disable=unused-argument - """ - Retrieve the status of the latest Turnitin submission for the user. - - Args: - data (dict): Input data for the request. - suffix (str, optional): Additional suffix for the request. Defaults to ''. - - Returns: - dict: Information related to the user's latest Turnitin submission. - """ - current_user = self.get_django_user() - try: - last_submission = TurnitinSubmission.objects.filter( - user=current_user - ).latest("created_at") - except TurnitinSubmission.DoesNotExist: - return {"success": False} - response = get_submission_info(last_submission.turnitin_submission_id) - return response.json() - - @XBlock.json_handler - def generate_similarity_report( - self, data, suffix="" - ): # pylint: disable=unused-argument - """ - Initialize the generation of a similarity report for the user's latest Turnitin submission. - - Args: - data (dict): Input data for the request. - suffix (str, optional): Additional suffix for the request. Defaults to ''. - - Returns: - dict: The status of the similarity report generation process. - """ - payload = getattr( # pylint: disable=literal-used-as-attribute - settings, "TURNITIN_SIMILARY_REPORT_PAYLOAD" - ) - current_user = self.get_django_user() - try: - last_submission = TurnitinSubmission.objects.filter( - user=current_user - ).latest("created_at") - except TurnitinSubmission.DoesNotExist: - return {"success": False} - response = put_generate_similarity_report( - last_submission.turnitin_submission_id, payload - ) - return response.json() - - @XBlock.json_handler - def get_similarity_report_status( - self, data, suffix="" - ): # pylint: disable=unused-argument - """ - Retrieve the status of the similarity report for the user's latest Turnitin submission. - - Args: - data (dict): Input data for the request. - suffix (str, optional): Additional suffix for the request. Defaults to ''. - - Returns: - dict: Information related to the status of the similarity report. - """ - current_user = self.get_django_user() - try: - last_submission = TurnitinSubmission.objects.filter( - user=current_user - ).latest("created_at") - except TurnitinSubmission.DoesNotExist: - return {"success": False} - response = get_similarity_report_info(last_submission.turnitin_submission_id) - return response.json() - - @XBlock.json_handler - def create_similarity_viewer( - self, data, suffix="" - ): # pylint: disable=unused-argument - """ - Create a Turnitin similarity viewer for the user's latest submission. - - Args: - data (dict): Input data for the request. - suffix (str, optional): Additional suffix for the request. Defaults to ''. - - Returns: - dict: Contains the URL for the similarity viewer. - """ - user_data = self.get_user_data() - payload = { - "viewer_user_id": user_data["user_id"], - "locale": "en-EN", - "viewer_default_permission_set": "INSTRUCTOR", - "viewer_permissions": { - "may_view_submission_full_source": False, - "may_view_match_submission_info": False, - "may_view_document_details_panel": False, - }, - "similarity": { - "default_mode": "match_overview", - "modes": {"match_overview": True, "all_sources": True}, - "view_settings": {"save_changes": True}, - }, - "author_metadata_override": { - "family_name": user_data["last_name"], - "given_name": user_data["name"], - }, - "sidebar": {"default_mode": "similarity"}, - } - current_user = User.objects.get(id=user_data["user_id"]) - try: - last_submission = TurnitinSubmission.objects.filter( - user=current_user - ).latest("created_at") - except TurnitinSubmission.DoesNotExist: - return {"success": False} - response = post_create_viewer_launch_url( - last_submission.turnitin_submission_id, payload - ) - return response.json() - - @staticmethod - def workbench_scenarios(): - """Define a workbench scenarios.""" - return [ - ( - "TurnitinXBlock", - """ - """, - ), - ( - "Multiple TurnitinXBlock", - """ - - - - - """, - ), - ] - - @staticmethod - def _get_statici18n_js_url(): - """ - Return the Javascript translation file for the currently selected language, if any. - - Defaults to English if available. - """ - locale_code = translation.get_language() - if locale_code is None: - return None - text_js = "public/js/translations/{locale_code}/text.js" - lang_code = locale_code.split("-")[0] - for code in (locale_code, lang_code, "en"): - loader = ResourceLoader(__name__) - if pkg_resources.resource_exists( - loader.module_name, text_js.format(locale_code=code) - ): - return text_js.format(locale_code=code) - return None - - @staticmethod - def get_dummy(): - """ - Return a dummy translation to generate initial i18n. - """ - return translation.gettext_noop("Dummy") diff --git a/platform_plugin_turnitin/turnitin_client/handlers/eula.py b/platform_plugin_turnitin/turnitin_client/handlers/eula.py index 939ccf3..b93b9e4 100644 --- a/platform_plugin_turnitin/turnitin_client/handlers/eula.py +++ b/platform_plugin_turnitin/turnitin_client/handlers/eula.py @@ -1,5 +1,5 @@ """ -EULA handlers for turnitin xblock +EULA handlers for turnitin plugin """ from .api_handler import turnitin_api_handler diff --git a/requirements/base.in b/requirements/base.in index 241d93d..3c1cbb0 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -2,8 +2,6 @@ -c constraints.txt Django # Web application framework -xblock # XBlock framework for Open edX -xblock-utils # XBlock utilities requests # HTTP requests djangorestframework # RESTful API framework edx-drf-extensions # Extensions to Django REST Framework for edX diff --git a/requirements/base.txt b/requirements/base.txt index 0592cda..e9e7a00 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -4,16 +4,8 @@ # # make upgrade # -appdirs==1.4.4 - # via fs asgiref==3.7.2 # via django -boto3==1.34.29 - # via fs-s3fs -botocore==1.34.29 - # via - # boto3 - # s3transfer certifi==2023.11.17 # via requests cffi==1.16.0 @@ -24,7 +16,7 @@ charset-normalizer==3.3.2 # via requests click==8.1.7 # via edx-django-utils -cryptography==42.0.1 +cryptography==42.0.2 # via pyjwt django==3.2.23 # via @@ -36,7 +28,6 @@ django==3.2.23 # drf-jwt # edx-django-utils # edx-drf-extensions - # openedx-django-pyfs django-crum==0.7.9 # via edx-django-utils django-waffle==4.1.0 @@ -56,35 +47,10 @@ edx-drf-extensions==10.1.0 # via -r requirements/base.in edx-opaque-keys==2.5.1 # via edx-drf-extensions -fs==2.4.16 - # via - # fs-s3fs - # openedx-django-pyfs - # xblock -fs-s3fs==1.1.1 - # via openedx-django-pyfs idna==3.6 # via requests -jmespath==1.0.1 - # via - # boto3 - # botocore -lazy==1.6 - # via xblock -lxml==5.1.0 - # via xblock -mako==1.3.0 - # via - # xblock - # xblock-utils -markupsafe==2.1.4 - # via - # mako - # xblock newrelic==9.6.0 # via edx-django-utils -openedx-django-pyfs==3.4.1 - # via xblock pbr==6.0.0 # via stevedore psutil==5.9.8 @@ -100,34 +66,16 @@ pymongo==3.13.0 # via edx-opaque-keys pynacl==1.5.0 # via edx-django-utils -python-dateutil==2.8.2 - # via - # botocore - # xblock pytz==2023.4 # via # django # djangorestframework - # xblock -pyyaml==6.0.1 - # via xblock requests==2.31.0 # via # -r requirements/base.in # edx-drf-extensions -s3transfer==0.10.0 - # via boto3 semantic-version==2.10.0 # via edx-drf-extensions -simplejson==3.19.2 - # via - # xblock - # xblock-utils -six==1.16.0 - # via - # fs - # fs-s3fs - # python-dateutil sqlparse==0.4.4 # via django stevedore==5.1.0 @@ -138,22 +86,5 @@ typing-extensions==4.9.0 # via # asgiref # edx-opaque-keys -urllib3==1.26.18 - # via - # botocore - # requests -web-fragments==2.1.0 - # via - # xblock - # xblock-utils -webob==1.8.7 - # via xblock -xblock[django]==1.10.0 - # via - # -r requirements/base.in - # xblock-utils -xblock-utils==4.0.0 - # via -r requirements/base.in - -# The following packages are considered to be unsafe in a requirements file: -# setuptools +urllib3==2.2.0 + # via requests diff --git a/requirements/dev.txt b/requirements/dev.txt index 87477b5..a7b27f0 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -4,10 +4,6 @@ # # make upgrade # -appdirs==1.4.4 - # via - # -r requirements/quality.txt - # fs asgiref==3.7.2 # via # -r requirements/quality.txt @@ -19,15 +15,6 @@ astroid==3.0.2 # pylint-celery black==24.1.1 # via -r requirements/dev.in -boto3==1.34.29 - # via - # -r requirements/quality.txt - # fs-s3fs -botocore==1.34.29 - # via - # -r requirements/quality.txt - # boto3 - # s3transfer build==1.0.3 # via # -r requirements/pip-tools.txt @@ -70,7 +57,7 @@ coverage[toml]==7.4.1 # -r requirements/quality.txt # coverage # pytest-cov -cryptography==42.0.1 +cryptography==42.0.2 # via # -r requirements/quality.txt # pyjwt @@ -95,7 +82,6 @@ django==3.2.23 # edx-django-utils # edx-drf-extensions # edx-i18n-tools - # openedx-django-pyfs django-crum==0.7.9 # via # -r requirements/quality.txt @@ -137,16 +123,6 @@ filelock==3.13.1 # -r requirements/ci.txt # tox # virtualenv -fs==2.4.16 - # via - # -r requirements/quality.txt - # fs-s3fs - # openedx-django-pyfs - # xblock -fs-s3fs==1.1.1 - # via - # -r requirements/quality.txt - # openedx-django-pyfs idna==3.6 # via # -r requirements/quality.txt @@ -168,31 +144,12 @@ jinja2==3.1.3 # -r requirements/quality.txt # code-annotations # diff-cover -jmespath==1.0.1 - # via - # -r requirements/quality.txt - # boto3 - # botocore -lazy==1.6 - # via - # -r requirements/quality.txt - # xblock lxml==5.1.0 - # via - # -r requirements/quality.txt - # edx-i18n-tools - # xblock -mako==1.3.0 - # via - # -r requirements/quality.txt - # xblock - # xblock-utils + # via edx-i18n-tools markupsafe==2.1.4 # via # -r requirements/quality.txt # jinja2 - # mako - # xblock mccabe==0.7.0 # via # -r requirements/quality.txt @@ -203,10 +160,6 @@ newrelic==9.6.0 # via # -r requirements/quality.txt # edx-django-utils -openedx-django-pyfs==3.4.1 - # via - # -r requirements/quality.txt - # xblock packaging==23.2 # via # -r requirements/ci.txt @@ -305,13 +258,8 @@ pytest==8.0.0 # pytest-django pytest-cov==4.1.0 # via -r requirements/quality.txt -pytest-django==4.7.0 +pytest-django==4.8.0 # via -r requirements/quality.txt -python-dateutil==2.8.2 - # via - # -r requirements/quality.txt - # botocore - # xblock python-slugify==8.0.2 # via # -r requirements/quality.txt @@ -321,38 +269,24 @@ pytz==2023.4 # -r requirements/quality.txt # django # djangorestframework - # xblock pyyaml==6.0.1 # via # -r requirements/quality.txt # code-annotations # edx-i18n-tools - # xblock requests==2.31.0 # via # -r requirements/quality.txt # edx-drf-extensions -s3transfer==0.10.0 - # via - # -r requirements/quality.txt - # boto3 semantic-version==2.10.0 # via # -r requirements/quality.txt # edx-drf-extensions -simplejson==3.19.2 - # via - # -r requirements/quality.txt - # xblock - # xblock-utils six==1.16.0 # via # -r requirements/ci.txt # -r requirements/quality.txt # edx-lint - # fs - # fs-s3fs - # python-dateutil # tox snowballstemmer==2.2.0 # via @@ -403,35 +337,18 @@ typing-extensions==4.9.0 # black # edx-opaque-keys # pylint -urllib3==1.26.18 +urllib3==2.2.0 # via # -r requirements/quality.txt - # botocore # requests virtualenv==20.25.0 # via # -r requirements/ci.txt # tox -web-fragments==2.1.0 - # via - # -r requirements/quality.txt - # xblock - # xblock-utils -webob==1.8.7 - # via - # -r requirements/quality.txt - # xblock wheel==0.42.0 # via # -r requirements/pip-tools.txt # pip-tools -xblock[django]==1.10.0 - # via - # -r requirements/quality.txt - # xblock - # xblock-utils -xblock-utils==4.0.0 - # via -r requirements/quality.txt zipp==3.17.0 # via # -r requirements/pip-tools.txt diff --git a/requirements/doc.txt b/requirements/doc.txt index c9b61f9..20be50b 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -8,10 +8,6 @@ accessible-pygments==0.0.4 # via pydata-sphinx-theme alabaster==0.7.13 # via sphinx -appdirs==1.4.4 - # via - # -r requirements/test.txt - # fs asgiref==3.7.2 # via # -r requirements/test.txt @@ -22,15 +18,6 @@ babel==2.14.0 # sphinx beautifulsoup4==4.12.3 # via pydata-sphinx-theme -boto3==1.34.29 - # via - # -r requirements/test.txt - # fs-s3fs -botocore==1.34.29 - # via - # -r requirements/test.txt - # boto3 - # s3transfer build==1.0.3 # via -r requirements/doc.in certifi==2023.11.17 @@ -58,7 +45,7 @@ coverage[toml]==7.4.1 # -r requirements/test.txt # coverage # pytest-cov -cryptography==42.0.1 +cryptography==42.0.2 # via # -r requirements/test.txt # pyjwt @@ -73,7 +60,6 @@ django==3.2.23 # drf-jwt # edx-django-utils # edx-drf-extensions - # openedx-django-pyfs django-crum==0.7.9 # via # -r requirements/test.txt @@ -115,16 +101,6 @@ exceptiongroup==1.2.0 # via # -r requirements/test.txt # pytest -fs==2.4.16 - # via - # -r requirements/test.txt - # fs-s3fs - # openedx-django-pyfs - # xblock -fs-s3fs==1.1.1 - # via - # -r requirements/test.txt - # openedx-django-pyfs idna==3.6 # via # -r requirements/test.txt @@ -154,34 +130,14 @@ jinja2==3.1.3 # -r requirements/test.txt # code-annotations # sphinx -jmespath==1.0.1 - # via - # -r requirements/test.txt - # boto3 - # botocore keyring==24.3.0 # via twine -lazy==1.6 - # via - # -r requirements/test.txt - # xblock -lxml==5.1.0 - # via - # -r requirements/test.txt - # xblock -mako==1.3.0 - # via - # -r requirements/test.txt - # xblock - # xblock-utils markdown-it-py==3.0.0 # via rich markupsafe==2.1.4 # via # -r requirements/test.txt # jinja2 - # mako - # xblock mdurl==0.1.2 # via markdown-it-py more-itertools==10.2.0 @@ -192,10 +148,6 @@ newrelic==9.6.0 # edx-django-utils nh3==0.2.15 # via readme-renderer -openedx-django-pyfs==3.4.1 - # via - # -r requirements/test.txt - # xblock packaging==23.2 # via # -r requirements/test.txt @@ -254,13 +206,8 @@ pytest==8.0.0 # pytest-django pytest-cov==4.1.0 # via -r requirements/test.txt -pytest-django==4.7.0 +pytest-django==4.8.0 # via -r requirements/test.txt -python-dateutil==2.8.2 - # via - # -r requirements/test.txt - # botocore - # xblock python-slugify==8.0.2 # via # -r requirements/test.txt @@ -271,12 +218,10 @@ pytz==2023.4 # babel # django # djangorestframework - # xblock pyyaml==6.0.1 # via # -r requirements/test.txt # code-annotations - # xblock readme-renderer==42.0 # via twine requests==2.31.0 @@ -294,27 +239,12 @@ rfc3986==2.0.0 # via twine rich==13.7.0 # via twine -s3transfer==0.10.0 - # via - # -r requirements/test.txt - # boto3 secretstorage==3.3.3 # via keyring semantic-version==2.10.0 # via # -r requirements/test.txt # edx-drf-extensions -simplejson==3.19.2 - # via - # -r requirements/test.txt - # xblock - # xblock-utils -six==1.16.0 - # via - # -r requirements/test.txt - # fs - # fs-s3fs - # python-dateutil snowballstemmer==2.2.0 # via sphinx soupsieve==2.5 @@ -370,32 +300,12 @@ typing-extensions==4.9.0 # edx-opaque-keys # pydata-sphinx-theme # rich -urllib3==1.26.18 +urllib3==2.2.0 # via # -r requirements/test.txt - # botocore # requests # twine -web-fragments==2.1.0 - # via - # -r requirements/test.txt - # xblock - # xblock-utils -webob==1.8.7 - # via - # -r requirements/test.txt - # xblock -xblock[django]==1.10.0 - # via - # -r requirements/test.txt - # xblock - # xblock-utils -xblock-utils==4.0.0 - # via -r requirements/test.txt zipp==3.17.0 # via # importlib-metadata # importlib-resources - -# The following packages are considered to be unsafe in a requirements file: -# setuptools diff --git a/requirements/quality.txt b/requirements/quality.txt index 10c89cd..42c2155 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -4,10 +4,6 @@ # # make upgrade # -appdirs==1.4.4 - # via - # -r requirements/test.txt - # fs asgiref==3.7.2 # via # -r requirements/test.txt @@ -16,15 +12,6 @@ astroid==3.0.2 # via # pylint # pylint-celery -boto3==1.34.29 - # via - # -r requirements/test.txt - # fs-s3fs -botocore==1.34.29 - # via - # -r requirements/test.txt - # boto3 - # s3transfer certifi==2023.11.17 # via # -r requirements/test.txt @@ -56,7 +43,7 @@ coverage[toml]==7.4.1 # -r requirements/test.txt # coverage # pytest-cov -cryptography==42.0.1 +cryptography==42.0.2 # via # -r requirements/test.txt # pyjwt @@ -72,7 +59,6 @@ django==3.2.23 # drf-jwt # edx-django-utils # edx-drf-extensions - # openedx-django-pyfs django-crum==0.7.9 # via # -r requirements/test.txt @@ -107,16 +93,6 @@ exceptiongroup==1.2.0 # via # -r requirements/test.txt # pytest -fs==2.4.16 - # via - # -r requirements/test.txt - # fs-s3fs - # openedx-django-pyfs - # xblock -fs-s3fs==1.1.1 - # via - # -r requirements/test.txt - # openedx-django-pyfs idna==3.6 # via # -r requirements/test.txt @@ -133,40 +109,16 @@ jinja2==3.1.3 # via # -r requirements/test.txt # code-annotations -jmespath==1.0.1 - # via - # -r requirements/test.txt - # boto3 - # botocore -lazy==1.6 - # via - # -r requirements/test.txt - # xblock -lxml==5.1.0 - # via - # -r requirements/test.txt - # xblock -mako==1.3.0 - # via - # -r requirements/test.txt - # xblock - # xblock-utils markupsafe==2.1.4 # via # -r requirements/test.txt # jinja2 - # mako - # xblock mccabe==0.7.0 # via pylint newrelic==9.6.0 # via # -r requirements/test.txt # edx-django-utils -openedx-django-pyfs==3.4.1 - # via - # -r requirements/test.txt - # xblock packaging==23.2 # via # -r requirements/test.txt @@ -228,13 +180,8 @@ pytest==8.0.0 # pytest-django pytest-cov==4.1.0 # via -r requirements/test.txt -pytest-django==4.7.0 +pytest-django==4.8.0 # via -r requirements/test.txt -python-dateutil==2.8.2 - # via - # -r requirements/test.txt - # botocore - # xblock python-slugify==8.0.2 # via # -r requirements/test.txt @@ -244,36 +191,20 @@ pytz==2023.4 # -r requirements/test.txt # django # djangorestframework - # xblock pyyaml==6.0.1 # via # -r requirements/test.txt # code-annotations - # xblock requests==2.31.0 # via # -r requirements/test.txt # edx-drf-extensions -s3transfer==0.10.0 - # via - # -r requirements/test.txt - # boto3 semantic-version==2.10.0 # via # -r requirements/test.txt # edx-drf-extensions -simplejson==3.19.2 - # via - # -r requirements/test.txt - # xblock - # xblock-utils six==1.16.0 - # via - # -r requirements/test.txt - # edx-lint - # fs - # fs-s3fs - # python-dateutil + # via edx-lint snowballstemmer==2.2.0 # via pydocstyle sqlparse==0.4.4 @@ -305,27 +236,7 @@ typing-extensions==4.9.0 # astroid # edx-opaque-keys # pylint -urllib3==1.26.18 +urllib3==2.2.0 # via # -r requirements/test.txt - # botocore # requests -web-fragments==2.1.0 - # via - # -r requirements/test.txt - # xblock - # xblock-utils -webob==1.8.7 - # via - # -r requirements/test.txt - # xblock -xblock[django]==1.10.0 - # via - # -r requirements/test.txt - # xblock - # xblock-utils -xblock-utils==4.0.0 - # via -r requirements/test.txt - -# The following packages are considered to be unsafe in a requirements file: -# setuptools diff --git a/requirements/test.txt b/requirements/test.txt index 8fa08ed..ac7b2ed 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -4,23 +4,10 @@ # # make upgrade # -appdirs==1.4.4 - # via - # -r requirements/base.txt - # fs asgiref==3.7.2 # via # -r requirements/base.txt # django -boto3==1.34.29 - # via - # -r requirements/base.txt - # fs-s3fs -botocore==1.34.29 - # via - # -r requirements/base.txt - # boto3 - # s3transfer certifi==2023.11.17 # via # -r requirements/base.txt @@ -45,7 +32,7 @@ coverage[toml]==7.4.1 # via # coverage # pytest-cov -cryptography==42.0.1 +cryptography==42.0.2 # via # -r requirements/base.txt # pyjwt @@ -58,7 +45,6 @@ cryptography==42.0.1 # drf-jwt # edx-django-utils # edx-drf-extensions - # openedx-django-pyfs django-crum==0.7.9 # via # -r requirements/base.txt @@ -89,16 +75,6 @@ edx-opaque-keys==2.5.1 # edx-drf-extensions exceptiongroup==1.2.0 # via pytest -fs==2.4.16 - # via - # -r requirements/base.txt - # fs-s3fs - # openedx-django-pyfs - # xblock -fs-s3fs==1.1.1 - # via - # -r requirements/base.txt - # openedx-django-pyfs idna==3.6 # via # -r requirements/base.txt @@ -107,38 +83,12 @@ iniconfig==2.0.0 # via pytest jinja2==3.1.3 # via code-annotations -jmespath==1.0.1 - # via - # -r requirements/base.txt - # boto3 - # botocore -lazy==1.6 - # via - # -r requirements/base.txt - # xblock -lxml==5.1.0 - # via - # -r requirements/base.txt - # xblock -mako==1.3.0 - # via - # -r requirements/base.txt - # xblock - # xblock-utils markupsafe==2.1.4 - # via - # -r requirements/base.txt - # jinja2 - # mako - # xblock + # via jinja2 newrelic==9.6.0 # via # -r requirements/base.txt # edx-django-utils -openedx-django-pyfs==3.4.1 - # via - # -r requirements/base.txt - # xblock packaging==23.2 # via pytest pbr==6.0.0 @@ -175,13 +125,8 @@ pytest==8.0.0 # pytest-django pytest-cov==4.1.0 # via -r requirements/test.in -pytest-django==4.7.0 +pytest-django==4.8.0 # via -r requirements/test.in -python-dateutil==2.8.2 - # via - # -r requirements/base.txt - # botocore - # xblock python-slugify==8.0.2 # via code-annotations pytz==2023.4 @@ -189,35 +134,16 @@ pytz==2023.4 # -r requirements/base.txt # django # djangorestframework - # xblock pyyaml==6.0.1 - # via - # -r requirements/base.txt - # code-annotations - # xblock + # via code-annotations requests==2.31.0 # via # -r requirements/base.txt # edx-drf-extensions -s3transfer==0.10.0 - # via - # -r requirements/base.txt - # boto3 semantic-version==2.10.0 # via # -r requirements/base.txt # edx-drf-extensions -simplejson==3.19.2 - # via - # -r requirements/base.txt - # xblock - # xblock-utils -six==1.16.0 - # via - # -r requirements/base.txt - # fs - # fs-s3fs - # python-dateutil sqlparse==0.4.4 # via # -r requirements/base.txt @@ -239,27 +165,7 @@ typing-extensions==4.9.0 # -r requirements/base.txt # asgiref # edx-opaque-keys -urllib3==1.26.18 +urllib3==2.2.0 # via # -r requirements/base.txt - # botocore # requests -web-fragments==2.1.0 - # via - # -r requirements/base.txt - # xblock - # xblock-utils -webob==1.8.7 - # via - # -r requirements/base.txt - # xblock -xblock[django]==1.10.0 - # via - # -r requirements/base.txt - # xblock - # xblock-utils -xblock-utils==4.0.0 - # via -r requirements/base.txt - -# The following packages are considered to be unsafe in a requirements file: -# setuptools diff --git a/setup.py b/setup.py index db68a7e..a954885 100755 --- a/setup.py +++ b/setup.py @@ -150,8 +150,5 @@ def is_requirement(line): "lms.djangoapp": [ "platform_plugin_turnitin = platform_plugin_turnitin.apps:PlatformPluginTurnitinConfig" ], - "xblock.v1": [ - "turnitin = platform_plugin_turnitin.turnitin:TurnitinXBlock", - ], }, )