176 Commits

Author SHA1 Message Date
Daniel Wong
cd6faeb966 Follow-up to PR 36789 (#37751)
* refactor(certificates): replace direct model imports with data classes and APIs

* fix: use Certificates API to create certificates

* docs: update docstring for get_certificate_for_user

* fix: remove trailing whitespace

---------

Co-authored-by: coder1918 <ram.chandra@wgu.edu>
Co-authored-by: Deborah Kaplan <deborahgu@users.noreply.github.com>
2026-01-08 13:03:46 -05:00
David Ormsbee
53c25b9cd8 fix: sanitize HTML for course overview & sidebar
The "overview" and "about_sidebar_html" fields in the
CoursewareInformation view (/api/courseware/course/{courseId}) were
returning unsanitized HTML and relying on the client to sanitize it.
This commit shifts that work to the server side (clean_dangerous_html)
to remove potentially dangerous tags when generating the response. The
source of this data is modified in the "Settings and Details" section
of a course in Studio.
2025-12-17 11:02:12 -05:00
Haftamu Kebede
e46cfa6b32 feat: Certificate sharing to linkedin (optionally) consider course level organization name (#37331)
By adjusting social media sharing settings(specifically linkedin) certificate parameters are autopopulated to LinkedIn API. Additional setting parameters(such as CERTIFICATE_LINKEDIN_DEFAULTS_TO_COURSE_ORGANIZATION_NAME) are introduced to override existing(platform level parameter for organization name) parameters for an operator to configure course level organization name. This will enable learners to share certificate in to LinkedIn with an option for course associated organization to be autopopulated.
2025-10-07 16:02:08 -04:00
Nathan Sprenkle
cb7f0f4811 fix: fix bad serialization of courseware metadata (#37338)
* Formats single_paid_mode as a dict, rather than named tuple which couldn't be serialized to DictField
* Allow ecommerce_checkout_link to be empty

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-09 14:18:20 -04:00
Feanil Patel
06b54e79f2 Merge pull request #36845 from raccoongang/rg/axm-course-catalog-extend-courseware-api
feat: [FC-86] extend courseware api with new fields
2025-09-04 09:46:25 -04:00
Serhii Nanai
ed69cb554b fix: remove unused fields 'prerequisites', 'ocw_links' 2025-09-03 12:38:08 +03:00
Serhii Nanai
577ef63a78 docs: add comment for skip_unless_lms 2025-08-29 13:30:35 +03:00
Serhii Nanai
b0ecbdfbd6 refactor: move import inside testcase
refactor: fix unused imports
2025-08-29 13:30:35 +03:00
Serhii Nanai
3a8366e053 docs: update docstring for course info serializer 2025-08-28 18:00:44 +03:00
Serhii Nanai
fa2eddb775 docs: update docstring for prerequisite course serializer 2025-08-28 17:58:06 +03:00
Andrii
42d30601b2 fix: remove redundant test which breaks everything 2025-07-04 15:50:16 +03:00
Andrii
722c73f771 refactor: add missing docstrings, rename * remove some fields 2025-06-27 18:51:21 +03:00
Andrii
3c47f1cc47 refactor: fix prerequisites source 2025-06-24 15:07:25 +03:00
Andrii
ca437883b7 refactor: add some fields to serailizer for FE & update API docstring 2025-06-19 17:55:14 +03:00
Jansen Kantor
f58c6f04fa fix: wrap sequence metadata view in bulk actions contextmanager (#36854)
* fix: wrap sequence metadata view in bulk actions contextmanager

* style: line too long
2025-06-04 16:52:09 +00:00
Andrii
c43e1be4a8 feat: extend courseware api with new fields 2025-06-03 18:17:41 +03:00
Feanil Patel
1829eb7d71 feat!: Remove the course sock and related APIs.
DEPR: https://github.com/openedx/edx-platform/issues/36429

This change removes the course_sock and related API data.  The UI it
removes is on the Legacy Courseware pages which have also been replaced
and have their own [deprecation ticket](https://github.com/openedx/edx-platform/issues/35803)

Before this can be merged, we will need to update the
frontend-app-learning MFE to no longer consume the
`can_show_upgrade_sock` attribute.

BREAKING CHANGE: CourseHomeMetadata, ProgressTab, OutlineTab and
VerifiedMode APIs will no longer have a `can_show_upgrade_sock`
attribute.
2025-04-07 10:29:39 -04:00
Kristin Aoki
e13d66d1e4 feat: support unit preview in learning MFE (#35747)
* feat: update preview url to direct to mfe

* fix: use url builder instead of string formatter

* fix: url redirect for never published units

* fix: remove 404 error when  not a preview or staff

* feat: update sequence metadata to allow draft branch
2024-11-01 11:03:06 -04:00
Nathan Sprenkle
8571eeca61 feat: add course language to courseware API (#34392) 2024-03-20 11:02:41 -04:00
Alison Langston
78afee7573 feat: remove learning assistant waffle flag (#34272) 2024-02-23 11:39:15 -05:00
Alison Langston
4fb1dba298 feat: replace la waffle flag with django setting (#34236) 2024-02-20 09:00:23 -05:00
Jansen Kantor
88b6f3894e fix: turn off atomic requests for course api get views (#33230)
* fix: turn off atomic requests for course api get views

* test: fix test
2023-09-14 10:40:28 -04:00
Artur Gaspar
7da99848a7 fix: edxnotes visibility in courseware and courseware API (#33096)
This retrieves user preferences for edxnotes visibility by:
1. Adding a `bind_course_for_student` method to course overview model.
2. Using a bound XBlock in the `toggle_notes.html` template.

The previously used unbound course instance was returning a default value.
2023-09-07 17:59:51 +02:00
michaelroytman
7598a81b57 feat: replace learning_assistant_launch_url with learning_assistant_enabled in courseware API
This commit replaces the learning_assistant_launch_url field of the CoursewareInformation view of the courseware API with a learning_assistant_enabled field. learning_assistant_enabled is a boolean that represents whether the Xpert Learning Assistant is enabled for the requesting user, based on the associated CourseWaffleFlag. This change is necessary because we are no longer leveraging the Learning Assistant LTI tool.
2023-08-09 10:29:11 -05:00
alangsto
cb3a0e91e9 feat: return lti launch url (#32718) 2023-07-12 14:25:59 -04:00
alangsto
6f00f63da6 feat: add course waffle flag for learner assistant (#32657) 2023-07-06 10:19:58 -04:00
Ned Batchelder
12765a7a59 refactor(test): use @skip_unless_lms uniformly 2023-02-01 13:52:26 -08:00
0x29a
9d8375ff99 refactor: rename module -> block within lms/djangoapps/courseware
Also, removed unused `_has_access_xmodule` methid from `lms/djangoapps/courseware/access.py`.
2023-01-30 18:15:22 +01:00
Arunmozhi
d417a7561f refactor: rename ItemFactory to BlockFactory 2023-01-23 14:47:47 +01:00
Bernard Szabo
377edc2f4d feat: TNL-10136 Propagate changes from last PR 2022-12-13 17:19:41 -05:00
Michael Terry
bc10f653dc fix: remove a couple unused learning MFE serializer fields
Now that the frontend assumes there are no legacy courseware pages,
we can stop sending them info about it.
2022-04-19 15:06:37 -04:00
Michael Terry
afd19f0513 feat!: drop legacy courseware tab access for learners
The only way to access the legacy courseware is now through the
Studio preview feature (and at some point, when the MFE supports a
preview mode, we can then remove even that).

This drops the courseware.use_legacy_frontend waffle.
2022-04-19 12:27:10 -04:00
Chris Deery
e8462bb667 feat: [AA-1207] remove redundant Tabs fields from courseware API (#30079)
feat: [AA-1207] remove redundant Tabs fields from courseware API

Remove redundant fields from courseware API.

- number
- verified_mode
- original_User_is_staff
- is_staff

This is the backend work for https://github.com/openedx/frontend-app-learning/pull/873
2022-03-18 12:09:52 -04:00
Dillon Dumesnil
d43ece5dba feat: AA-1205: Add Learning MFE support for Entrance Exams
* Adds entrance exam information to the Course Overview object
    * Enables hiding other tabs since the get_course_tab_list uses
      a Course Overview
    * Enables using the entrance exam helper functions to determine
      if Entrance exams are being used in this course.
* Posts a message when Entrance Exam is passed to parent container for
usage in the Learning MFE
* Overrides the 'title' field of the courseware tab since the Learning MFE
uses that over the 'name' field.
2022-03-14 09:04:45 -04:00
Chris Deery
50f348b395 feat: [AA-1207] remove redundant Tabs fields from courseware API (#30023)
* feat: [AA-1207] remove redundant Tabs fields from courseware API

All the tab information now goes through the course home metadata tab fields. This field is redundant.
2022-03-11 09:36:28 -05:00
Chris Deery
b61b29196b feat: [AA-1206] remove redundant fields from API (#29920)
* feat: [AA-1206] remove redundant fields from API

Part of a larger effort to clean up the MFE BFF endpoints.
Remove the redundant fields username and course_access, both of which are also available in the course home metadata call.
2022-03-04 09:01:02 -05:00
Mohammad Ahtasham ul Hassan
4260bd2af5 fix: fixed django40 warnings (#29655)
* fix: fixed django40 warnings
* fix: fix quality failures

Co-authored-by: UsamaSadiq <usama.sadiq@arbisoft.com>
2022-03-02 16:08:04 +05:00
Simon Chen
a76f8d4f32 fix: do not deny proctoring access when masquerading as verified learner (#29937)
Co-authored-by: Simon Chen <schen@edx-c02fw0guml85.lan>
2022-02-16 15:02:29 -05:00
Simon Chen
5cfec9732b fix: Provide a new data property on CoursewareMeta for proctoring exam access (#29929)
Co-authored-by: Simon Chen <schen@edX-C02FW0GUML85.local>
2022-02-16 11:02:15 -05:00
Bianca Severino
af81b3a609 chore: replace integrity signature flag with django setting 2022-02-15 09:57:00 -05:00
Michael Terry
cb1bb7fa64 test: switch default test store to the split store
It's long past time that the default test modulestore was Split,
instead of Old Mongo. This commit switches the default store and
fixes some tests that now fail:
- Tests that didn't expect MFE to be enabled (because we don't
  enable MFE for Old Mongo) - opt out of MFE for those
- Tests that hardcoded old key string formats
- Lots of other random little differences

In many places, I didn't spend much time trying to figure out how to
properly fix the test, and instead just set the modulestore to Old
Mongo.

For those tests that I didn't spend time investigating, I've set
the modulestore to TEST_DATA_MONGO_AMNESTY_MODULESTORE - search for
that string to find further work.
2022-02-04 14:32:50 -05:00
Bianca Severino
e848935000 fix: exclude masters from honor code check 2022-01-19 15:11:41 -05:00
Dillon Dumesnil
7b1fead04c feat: AA-1138: Adds ability to have Weekly Goal Celebration Modal in MFE
Adds celebrate_weekly_goal to the CourseEnrollmentCelebration and includes logic
for only returning True if the db field is true and the learner has hit their goal
this week. Adds ability to set to false via the API already used by the frontend.
Default db value is False, but all new enrollments after merge will be set to True.
2022-01-14 13:59:22 -05:00
Chris Deery
dddcadb706 feat: [AA-922] remove deprecated Goals backend (#29705)
* feat: [AA-922] remove deprecated Goals backend

While the new Weekly Learning Goals were being rolled out, the previous goal setting feature still existed behind a waffle flag.
The Weekly Learning Goals now become the one and only learning goal feature.

This change does not remove the old goals feature from the legacy backend, and therefore it does not remove any of the data that was used by the old goals feature.
The goals are now driven by the single pre-existing Waffle flag ENABLE_COURSE_GOALS

 - Removed COURSE_GOALS_NUMBER_OF_DAYS_GOALS waffle flag, replacing it where needed with the existing ENABLE_COURSE_GOALS

 - modified the API to remove the old goal_options, keeping the redundant weekly_learning_goal_enabled flag

 - updated tests

 - refactor tests to fit 50 line limit in lint
2022-01-11 09:02:03 -05:00
Jawayria
7f5b4a6a47 chore: removed 'wrong-import-order' from disabled imports (#29365)
* chore: removed 'wrong-import-order' from disabled imports
2022-01-06 19:14:51 +05:00
Michael Terry
712380713b fix: give proper status code for invalid sequence metadata requests
If the sequence metadata view is asked to give metadata for a block
that is not a sequence (or section), give a proper http code back,
rather than throwing an attribute exception.

This avoids a monitoring error being flagged, and lets the frontend
catch this case specially (which the MFE does do, to notice that it
actually has a unit, not a sequence).
2022-01-04 14:30:48 -05:00
Michael Terry
e2e37154ce fix: add a couple guards for anonymous users
This fixes a couple places (LastSeenCoursewareTimezone and
UserCourseTag) where we were saving an entry for a user, but not
making sure we ignored anonymous users.
2021-12-09 10:26:51 -05:00
Jawayria
8ccb8b0608 chore: Applied lint-amnesty on openedx/core/djangoapps 2021-12-09 13:32:06 +05:00
Simon Chen
d1904bd99b fix: Ensure edX staff user can also see Honor Code modal dialog (#29479)
Co-authored-by: Simon Chen <schen@dhcp-10-31-112-124.dyn.mit.edu>
2021-12-01 10:13:27 -05:00
Bianca Severino
9f2dc8606b fix: add integrity signature flag to courseware api 2021-11-05 15:35:04 -04:00