Commit Graph

4435 Commits

Author SHA1 Message Date
connorhaugh
15b7564a73 feat: add mgmt command to track active_versions (#30730)
In order to gain more information about ongoing questions related to the potentially out-of-sync nature of the SQL and MongoDb tables in Split Modulestore, I have created the management command to list all courses with out-of-sync active_versions and course_index entires.

This should have no direct impact on anyone, nor alter anything.

part of an on-going investigation to figure out 500 errors in studio.
2022-07-14 16:00:07 -04:00
Jansen Kantor
143ea1dbbc fix: use peer assessment as default ora template (#30705)
* fix: use peer assessment as default ora template

* chore: bump ora

* test: update test after ORA update
2022-07-13 10:21:42 -04:00
Justin Hynes
26ae8b4bcd feat: add management command to clean stale certificate availability dates
[MICROBA-1806]

We are aware of product issue where it is possible for a self-paced course-run to get have a `certificate_availability_date` created in the course settings. This can have an adverse effect on the Credentials IDA where a learner's Program Record does not correctly display the course certificates they have earned because of this data. This not only causes confusion for our learners, as it appears that a course certificate a learner can access and share in the LMS is displayed as unearned in the Credential's program record, but this can also cause issues when a learner attempts to share their program record through a credit pathway and the program record would not accurately reflect their program completion.

Unfortunately, the settings that manage the certificate availability date are hidden for self-paced courses in Studio (as they should only be used in instructor-paced courses).

For this reason, we are introducing a management command that will remove a certificate available date for a specified (self-paced) course-run. This will allow us to fix issues for individual learners while we work on a longer-term fix for the larger issue.

* Add new `clean_stale_certificate_available_dates` management command
* Add new `CleanStaleCertificateAvailabilityDates` Configuration Model
* Add tests for the new management command
* (Unrelated cleanup) Fix potential issue with private.py settings in the CMS being overwritten in devstack.py for developers using devstack.
2022-07-11 13:13:27 -04:00
0x29a
cf1a7c616a refactor: remove error_descriptor_class and NonStaffErrorBlock
It's safe to remove this because non-staff [1] users cannot access [2]
an `ErrorBlock`. We were able to reproduce this with and without this commit
with the following results:
1. Staff users were seeing the `ErrorBlock`.
2. Non-staff users were getting an empty `<div class="vert-mod"></div>`.

In theory, error blocks should be hidden in the Learning MFE because of this
option [3]. However, when we manually set `hide_access_error_blocks` to
`False`, we kept getting identical results (with and without this commit), so
it looks that the removal `NonStaffErrorBlock` was just omitted at some point.

[1] a4ec4c1b8e/lms/djangoapps/courseware/access.py (L419-L436)
[2] a4ec4c1b8e/lms/djangoapps/courseware/access.py (L150-L151)
[3] 92ca176fde/lms/djangoapps/courseware/views/views.py (L1547-L1551)
2022-06-30 15:53:39 +02:00
Kshitij Sobti
8169aa99da fix: if pages and resources view is disabled, show all pages in studio (#30550)
In a previous PR #28686, the ability to see and enable/disable wiki and progress tabs was removed from studio along with the ability to re-order non-static tabs. The ability to toggle the Wiki tab was moved to the pages and resources section of the course authoring MFE. If that MFE is unavailable this means there is no way to show/hide the Wiki. This reverts some of the old changes if the pages and resources view is disabled.
2022-06-28 21:19:32 +05:00
Raymond Zhou
d1394922ae feat: change text xblock title to 'Text' v2 (#30578) 2022-06-13 14:13:08 -04:00
Feanil Patel
b9131ac1af Merge pull request #30299 from raccoongang/depr/remove-course-info
FC-0001: Remove legacy course info page & related code
2022-06-13 08:23:25 -04:00
Demid
8886f29e52 refactor: remove debug property from ModuleSystem (#30450)
This also:
1. Removes this property from XBlock runtime shims.
2. Updates the minimum required version of the LTI Consumer XBlock.
2022-06-08 18:59:45 +02:00
jfavellar90
0f4082427e fix: LI-10, improve home studio performance.
Improving Studio homepage performance for users with course access role with no course_id

Fixing unit tests

Added create CourseOverviewFactory after creating course to course listing test

Fix order import for `from openedx.core.djangoapps.content.course_overviews.tests.factories import CourseOverviewFactory
`

(cherry picked from commit 997a0ff770744309f0ee84f3c0696a80310c5f2d)
2022-06-07 15:13:11 -05:00
Sagirov Eugeniy
92ca176fde refactor: Remove legacy course info page & related code 2022-06-05 19:00:05 +03:00
connorhaugh
2e13033fbe Revert "Feat change default title for text xblock to be 'text'" 2022-06-01 10:52:09 -04:00
Raymond Zhou
a27247d14d Merge pull request #30406 from openedx/feat--change-default-title-for-text-xblock-to-be-'Text'
Feat  change default title for text xblock to be 'text'
2022-05-31 09:35:33 -07:00
Raymond Zhou
8422f50a16 feat: fix test 2022-05-27 11:05:52 -07:00
Raymond Zhou
9c8b026588 feat: assertEqual 2022-05-27 10:47:27 -07:00
Raymond Zhou
0678a444ec feat: missed a translation in item.py 2022-05-27 10:23:39 -07:00
rayzhou-bit
cf84c3bc64 feat: more pep8 fix 2022-05-27 03:48:33 -04:00
rayzhou-bit
701bfbc8c6 feat: pep8 fixes 2022-05-27 03:24:18 -04:00
rayzhou-bit
c63d871e5c feat: add testing and i18n 2022-05-27 02:58:07 -04:00
Eugene Dyudyunov
b4fecd620b refactor: rename toggle_warnings to toggle_warning (#30458)
Rename toggle_warnings to toggle_warning for consistency with setting_warning.
2022-05-24 11:47:31 -04:00
Usama Sadiq
583b36938e fix: fix ResourceWarnings (#30317) 2022-05-24 11:44:45 +05:00
rayzhou-bit
a9a945094e feat: add comment 2022-05-16 12:07:47 -04:00
Simon Chen
4f339e2f9e fix: make the studio user_id the actual anonymous_user_id (#30248)
* feat: test out individualized anonymouse_user_id for studio preview on xblocks

* test: adds tests for the PreviewModuleSystem anonymous_user_id (#30400)

and the INDIVIDUALIZE_ANONYMOUS_USER_ID flag.

Co-authored-by: Jillian Vogel <jill@opencraft.com>

Co-authored-by: Simon Chen <schen@edX-C02FW0GUML85.local>
Co-authored-by: Jillian Vogel <jill@opencraft.com>
2022-05-16 10:37:39 -04:00
Eugene Dyudyunov
52dd883a3c refactor: delete now unused FutureCourseWaffleFlag (#30367)
Remove temporary FutureCourseWaffleFlag class;
Update ora2 and edx-toggles to versions cleaned from the
LegacyWaffle* classes;
Replace `override_flag`s with `override_waffle_flag`;
Replace `override_switch`s with `override_waffle_switch` (where it's possible).
2022-05-13 08:48:42 -04:00
Eugene Dyudyunov
655e4a344f refactor!: update CourseWaffleFlag (#30351)
BREAKING: get rid of the LegacyWaffle-based CourseWaffleFlag.
Both CourseWaffleFlag and FutureCourseWaffleFlag now use the modern
WaffleFlag as parent class. FutureCourseWaffleFlag left to support ORA
transition to modern waffle.

Switch to the ORA version which supporting new Waffles.
2022-05-10 15:08:59 -04:00
Demid
a4ec4c1b8e refactor: Delete XModule classes (#30262)
Removes XModule, XModuleDescriptor, ProxyAttribute classes and their usages.
2022-05-10 19:09:11 +02:00
Eugene Dyudyunov
8bd43207ca refactor!: switch from LegacyWaffle* to modern waffles (#30330)
This is a first stage for removing the LegacyWaffle* classes.

LegacyWaffleFlag usage replaced with WaffleFlag;
LegacyWaffleSwitche usage replaced with WaffleSwitch;
New CourseWaffleFlag added to the temporary module __future__ as FutureCourseWaffleFlag;
Updated all the imports to use CourseWaffleFlag from the __future__ module;

BREAKING CHANGE: A number of toggle related constants (e.g. ENABLE_ACCESSIBILITY_POLICY_PAGE)
changed types. They were strings, and are now toggle instances (e.g. WaffleSwitch). Although the entire
refactor should be self-contained in edx-platform, if any plugins or dependencies were directly
using these constants, they will break. If this is the case, try to find a better publicized way of
exposing those toggles.
2022-05-05 12:03:10 -04:00
rayzhou-bit
109e68ca94 feat: html xblock default title is now 'Text' 2022-05-03 12:21:56 -04:00
rayzhou-bit
18ec99dd0b feat: change default title for text xblock 2022-04-26 05:09:36 -04:00
Demid
16fa97dde4 feat: deprecate filestore
This:

1. Removes the `filestore` property from the `ModuleSystem` in favor of
   the `runtime.resources_fs` property.
   In the original code, `filestore` is equal to
   `DescriptorSystem.runtime.resources_fs`. It's safe to replace it with
   `ModuleSystem.runtime.resources_fs` because both runtimes are combined
   using the `CachingDescriptorSystem`. It provides the `resources_fs` property
   that uses the same file storage.

2. Renames `filestore` argument to `resources_fs` in the `LoncapaSystem`
   constructor.

3. Adds the deprecated `filestore` property to the `ModuleSystemShim`
   and `RuntimeShim`.
2022-04-14 14:45:05 +02:00
Kyle McCormick
42fcfc8217 docs: update CourseGraph README, notably w.r.t. new Tutor plugin
Update the README of the CMS's CourseGraph support app:
* Point to the newly-developed CourseGraph plugin for Tutor,
  and remove some prose that's now redundant with the Tutor
  plugin's README.
* Add a link to the now-public CourseGraph Queries wiki page.
* Capitalize the G in CourseGraph.
* Fix a couple misc. formatting things.
2022-03-29 11:21:20 -04:00
Kyle McCormick
d16fe9d427 feat: add admin action for dump to coursegraph
This introduces two admin actions:
* Dump to CourseGraph (respect cache), and
* Dump to CourseGraph (override cache)

which allow admins to select a collection of courses from Django
admin and dump them to the Neo4j instance specified by
settings.COURSEGRAPH_CONNECTION, with or without respecting
the cache (that is: whether the course has already been dumped
since its last publishing).
2022-03-29 11:21:20 -04:00
Kyle McCormick
d75a32c009 refactor: read course publish date from overview, not block structure
The `get_course_last_published` function is used by CourseGraph to
determine whether or not a course should be dumped to Neo4j.
If the course hasn't been published since it was last dumped to
Neo4j, then it can be skipped (unless the override_cache option
is enabled).

The function was previously built using the BlockStructure
data model. While this worked fine in Production instances that
enable `block_structure.storage_backing_for_cache`, this
implementation did NOT work in development environments,
which do not use the BlockStrcture model.

Instead, we switch to using CourseOverview.modified to
approximate when a course was last published. This is method
has fewer moving parts and is universally available across
instances.
2022-03-29 11:21:20 -04:00
Kyle McCormick
696984a2bd feat: dump to cousegraph on course publish signal
Previously, CourseGraph needed to be kept up-to-date by
running `./manage.py dump_to_neo4j ...` manually or on a cron timer.

This introduces a CMS new setting: COURSEGRAPH_DUMP_COURSE_ON_PUBLISH.
When enabled, the CMS course_published signal handler will
asynchronously dump each individual course to CourseGraph when it
is published.

This follows a pattern established by other subsystems like
learning_sequences and special exam registration, both of which
fire off asynchronous post-processing tasks from the course-
publish handler.
2022-03-29 11:21:20 -04:00
Kyle McCormick
1bf8af5f72 feat: specify dump_to_neo4j defaults in COURSEGRAPH_CONNECTION
Introduce a new CMS settings COURSEGRAPH_CONNECTION,
which allows operators to specify default connection paramters
for a Neo4j instance.

This has three purposes:
* The `./manage.py cms dump_to_neo4j` management command will be
  much easier for developers and operators to type out because connection
  arguments can now be omitted. Note that connection arguments, if
  supplied, will override the arguments specified in CMS settings.
* The automatic push-to-coursegraph-on-publish-signal introduced in
  subsequent commits can use these connection settings.
* The CourseGraph Django admin actions introduced in subsequent
  commits can use these connection settings.
2022-03-29 11:21:20 -04:00
Kyle McCormick
c7693cfa20 docs: enrich dump_to_neo4j help text & docstrings
Move most docs out of docstring and into programatically-
displayable argument help text.

Also, the 'Example Usage' was out of date. This commit updates it to:
 * use `./manage.py cms ...' instead of `./manage.py lms ...', and
 * use `--port` instead of `--https_port`.
2022-03-29 11:21:20 -04:00
Kyle McCormick
8039e40f47 refactor: move coursegraph to cms
This code was originally located at:
  ./openedx/core/djangoapps/coursegraph

However, code makes more sense within the ./cms tree, because:
* it is responsible for publishing course content to an
  external system, with is within the responsibilities of CMS, and
* is uses modulestore, which is discouraged for use in LMS
  (see 0011-limit-modulestore-use-in-lms.rst).

So, we move the code to:
  ./cms/djangoapps/coursegraph
and uninstall coursegraph from LMS.

We do not expect this refactor to have any breaking downstream effects.
2022-03-29 11:21:20 -04:00
Awais Qureshi
bc45f1ee48 fix: Removed usage of djangoratelimitbackend. (#30116)
* fix: Removed usage of djangoratelimitbackend.
2022-03-25 15:27:39 +05:00
Michael Terry
7300072ce5 Merge pull request #30091 from openedx/mikix/backfill-args
feat: add a config model for the backfill_course_tabs command
2022-03-18 12:08:38 -04:00
Michael Terry
35df2723d8 feat: add a config model for the backfill_course_tabs command
- Adds a BackfillCourseTabsConfig model to manage the arguments
  to that command
- Adds batching arguments using that model
- Adds some extra logging for the failed courses
2022-03-18 11:50:55 -04:00
Feanil Patel
13ecd80e86 Merge pull request #30086 from openedx/feanil/remove_edx4edx_lite_ref
docs: Update a help string to reference a more up-to-date sample course.
2022-03-17 14:53:52 -04:00
Feanil Patel
2ce5f63756 docs: Update a help string to reference a more up-to-date sample course. 2022-03-17 14:10:05 -04:00
Dillon Dumesnil
46a93ed23c feat: Be even more permissive with errors for this command 2022-03-15 10:14:14 -04:00
Dillon Dumesnil
fc474e92ea Merge pull request #30058 from openedx/ddumesnil/backfill-tabs-update
feat: Add some error handling to Backfill Course Tabs Command
2022-03-14 19:00:51 -07:00
Dillon Dumesnil
0a1fe04565 feat: Add some error handling to Backfill Course Tabs Command 2022-03-14 15:42:36 -04:00
Kaustav Banerjee
c48c655998 refactor: deprecates replace url related properties from ModuleSystem
Deprecates the following attributes from ModuleSystem:
 * replace_urls
 * replace_course_urls
 * replace_jump_to_id_urls

A new ReplaceURLService is created as replacement with a unified replace_urls method
2022-03-14 09:35:41 -04:00
Dillon Dumesnil
61b93d953d feat: Add backfill course tabs management command
Previously, course tabs would only be created once and never try to
update the default tabs again. This leads to an issue if you ever want
to add a new tab. With this command, you can now update the default tabs
for all existing courses and new courses will pick it up upon creation
when CourseTabList.initialize_default is called.
2022-03-11 11:16:18 -05:00
Robert Raposa
8b775961a6 fix: rename table_blacklist to table_ignorelist 2022-03-09 16:43:47 -05:00
Simon Chen
60cf4d7ded fix: allow exam_type change when exam do not have external_id specified (#30032)
Co-authored-by: Simon Chen <schen@edX-C02FW0GUML85.local>
2022-03-09 15:08:33 -05:00
Braden MacDonald
dcb7ef8821 feat: Read course indexes from MySQL, not MongoDB (#29184)
Description
This is a follow up to #29058 and #29413. This is the next step in moving part of the modulestore data (the course indexes / "active versions" table) from MongoDB to MySQL.

There are four steps planned in moving course index data to MySQL:

Step 1: create the tables in MySQL, start writing to MySQL + MongoDB  done
Step 2: migrate all remaining courses to MySQL  done
Step 3: switch reads from MongoDB to MySQL (this PR)
Step 4 (much later, once we know this is working well): stop writing to MongoDB altogether.
Supporting information
OpenCraft Jira ticket: MNG-2557

Status
 Tested with a large Open edX instance is in progress.

Testing instructions
Try making changes in Studio and verify that they work fine.

Deadline
None
2022-03-09 10:21:09 -05:00
Simon Chen
0940fc5e49 fix: Loosen the restriction on updating exam_type (#30022)
Currently, if a subsection was a special exam, we do not allow it to be changed back as a special exam. This PR would loosen that change to only disallow reintroducing the exam back to proctored exam. Timed exam can be updated however the user wants

Co-authored-by: Simon Chen <schen@edX-C02FW0GUML85.local>
2022-03-08 13:00:59 -05:00