Commit Graph

9362 Commits

Author SHA1 Message Date
Sofia Yoon
898684287a feat: AA-885 show offsets in studio self paced course outline for a subsection
feat: AA-883 basic prototype for custom pacing pls in studio

refactor: merge with basic prototype for self paced courses from AA-844

feat: add due date estimate message in self paced courses studio modal

refactor: merge with main that has up to date self paced custom pls editor and tests

fix: only display projected date if start date exists

fix: tests to check grading date in outline

fix: only one warning message show at a time

fix: do not show projected date when it is before the start date
2021-07-26 16:26:22 -04:00
Usama Sadiq
1795008686 fix: Removed pylint constraint (#28222)
Disabled pylint warnings in pylint_tweaks
2021-07-23 18:35:57 +05:00
connorhaugh
9d25982fab fix: oblige non-studio-authoring submit settings (#28253)
Problem blocks offer a setting to make users wait a set time between submissions. If a course is not authored in studio, it might not set a value for this setting. Consequently, the problem block must handle the submission_wait_seconds field to be none, so it doesn't break the submitted responses.

These kinds of errors here will prevent learners from submitting any answer, and has for several learners. Adding in this one-line change will prevent future errors without having to change the authoring practices of those ambitious enough to write their courses with import.

This also catches the case that some internal process other than studio might be creating problems with "none" as the setting.

In response to TNL-8234

Testing: hand-testing by importing the following problem xml file within a course and attempting to answer as learner(answer is 10.4).
2021-07-22 12:57:36 -04:00
Matt Tuchfarber
325629dd25 Merge pull request #28237 from edx/tuchfarber/move_may_certify_2
Move cert display decisions to certificates app
2021-07-22 10:20:13 -04:00
Matt Tuchfarber
d16c9a804c refactor: Move cert code to cert app
The `may_certify` function is used to determine whether a learner should
be able to see that their certificate is ready. It is therefore entirely
in the certificates domain. This remove may_certifiy and
may_certify_for_course from the xmodule and course_overview
apps and into the certificates app. The xmodule may_certify was not called
outside of tests prior to this, and the other's were easily moved.

In order to avoid circular imports, this also moved
certificate_info_for_user out of the model code and into an API
2021-07-21 15:56:19 -04:00
connorhaugh
0d26738fce fix: Prevent Transcripts from Failing Export, Edit (#28242)
Instead of having json errors in transcript acquisition and conversion cause errors, have transcription conversion and acquisition simply return an error message in the transcription which can prompt a change from the user.

Although not uploading a transcript is handled, transcripts can often cause errors in edit, export, and other activities due to json errors. These errors block the entire use of these features, so to allow for reupload, etc, we add an error message instead of transcript and log the event.

In response to [TNL-8539](https://openedx.atlassian.net/secure/RapidBoard.jspa?rapidView=580&projectKey=TNL&modal=detail&selectedIssue=TNL-8539)

Testing: Unit tests coverage is included in the PR. Upload, import, and export of courses with transcriptions is also easily hand-testable. Just create a video in studio, add an irrelevant transcript. Then try to import, export, and edit the problem. Expected behavior is success.
2021-07-21 15:52:54 -04:00
David Ormsbee
1238e5d1b4 perf: add monitoring for get_course and safe_exec (#28241)
This is to help diagnose performance issues around the SequenceMetadata
API, as part of TNL-8330.
2021-07-21 11:19:10 -04:00
connorhaugh
a2a2a1f433 fix: Report Custom Python Errors to Instructors (#28199)
Partner Support commonly raises the issue of instructors' custom Python problems not generating any response report on the instructor dashboard. Such errors are due to the operating restrictions placed on codejail. Sometimes not all answers can be processed by the server, which kills off some to accommodate. Instead of spiking the whole report, this change logs not only the error in our system, but also allows the mostly complete response to reach the instructor.

This PR will decrease friction not only for Partner support and instructors, but T&L, who have periodically implemented workarounds to the problem.

The PR merely implements exception handling for generating reports which logged exceptions and added them to the report, continuing the work done in TNL-8218 which did the same for grading.
2021-07-16 13:39:46 -04:00
Sofia Yoon
e343c78227 feat: basic prototype for custom pacing pls in studio (AA-883) 2021-07-13 13:56:28 -04:00
Julia Eskew
b24e65903d Revert "feat: AA-883 Basic prototype for self paced due dates in Studio" 2021-07-09 17:38:18 -04:00
sofiayoon
264606dfd4 Merge pull request #28016 from edx/syoon/AA-844
feat: AA-883 Basic prototype for self paced due dates in Studio
2021-07-09 09:23:05 -04:00
Burhan Nasir
acb7fc5544 Fix Caption message issue with YouTube (#27782)
* fix video caption message issue
2021-07-09 18:21:10 +05:00
João Cabrita
530e4932bb fix!: Disable changing discussions providers once a course run has started
For authenticated users that are not global staff, changing discussion
providers after a course has started fails with 403 Forbidden.

Related issues:
* [BB-4253](https://tasks.opencraft.com/browse/BB-4253)
* [TNL-8142](https://openedx.atlassian.net/browse/TNL-8142)

BREAKING CHANGE:
Course staff, who were previously allowed to do this operation,
will instead receive a 403 Forbidden response.
2021-07-09 12:14:23 +05:00
Sofia Yoon
09eb36e550 feat: AA-883 basic prototype for custom pacing pls in studio
fix: make new field in xblock json serializable and don't assign due dates to ORAs

feat: display warning message in Studio if the relative date input is more than 18 weeks for custom pacing in self paced course

fix: handle due dates for mix of ORA and non ORA problems under a subsection and other styling fixes

feat: add a minimum restriction for self paced courses due date editor input

fix: naming of warning id divs to be more specific and exclude children of ORA problems in setting due dates

test: extracting dates for a self paced course with custom pacing

test: frontend for self paced custom pacing modal in studio and clean up its backend tests

fix: remove an unused line when getting children of custom pacing subsection, reorganize testing for custom pacing

fix: more specific comments to testing for custom PLS and remove a test case course

fix: more cleanup for self paced custom pacing PLS backend tests
2021-07-08 16:05:38 -04:00
Sofia Yoon
4d96449134 feat: create feature flag for PLS custom pacing 2021-07-08 14:39:04 -04:00
Matt Tuchfarber
63cb6a97ff Revert "feat: Reimagine certificate_availability_date and certificates_display_behavior" 2021-07-07 16:53:05 -04:00
Matt Tuchfarber
2a7106acfb feat: reimagine certificate display settings
The course settings `certificate_available_date` (CAD) and
`certificates_display_behavior` (CDB) were previously acting indedependantly
of one another. They now work in tandem. This change:
- limits CDB to a dropdown
- removes "early_with_info" and adds "end_with_date"
- only takes CAD into account if "end_with_date" is selected
- Moves CDB to the main course schedule settings page
- updates CourseOverview to validate these fields and choose sane
defaults if they aren't expected values

Certificates will now show under the following circumstances:
"Immediately upon passing"
certificate_availability_date = null
certificates_display_behavior = "early_no_info"

"End date of course"
certificate_availability_date = null
certificates_display_behavior = "end"

"A date after the course end date"
certificate_availability_date = <date>
certificates_display_behavior = "end_with_date"
2021-07-06 16:45:23 -04:00
David Ormsbee
741f0b6a88 Merge pull request #27858 from mitodl/hamza/add_validation_to_capa_problem_authoring_markdown
add validation to capa problem markdown for missing option text and fix response report generation for old problems
2021-07-01 14:09:32 -04:00
Michael Terry
c62626227a fix: jump_to should redirect to first unit on invalid key
Previously, it would 404. While accurate, it's not a great user
experience. Users can be offered invalid jump_to paths in the normal
course of things, if course content disappears or they lose access
to it.

In both cases, they might be offered a resume URL in the courseware
that would be to a now-invalid location.

With this change, that invalid link will at least give them
*something* (the first unit in the course) rather than an error
page.

This also (unrelatedly) fixes an exception when the learning MFE
outline page tries to render a course that contains sequences
with no children.

AA-867
2021-06-28 15:43:12 -04:00
Christie Rice
e9fd9cb2a7 test: Remove flaky test test_get_all_assets_with_paging (#28037)
CR-3817
2021-06-25 12:46:43 -04:00
Diana Huang
29548459fa refactor: Remove PyContracts usage. (#27887)
* refactor: Remove PyContracts usage.

We have not used PyContracts in a while and it is overhead we don't
need in edx-platform.

https://openedx.atlassian.net/browse/DEPR-147

* chore: Updating Python Requirements (#28018)

Co-authored-by: edX requirements bot <49161187+edx-requirements-bot@users.noreply.github.com>
2021-06-23 18:24:06 -04:00
HamzaIbnFarooq
9e655a4c99 refactor: refactoring error messages for CAPA problem authoring 2021-06-17 16:18:55 +05:00
Hamza Farooq
0e4d2ff823 fix: adds default texts for missing answer texts in capa problems to fix response report generation
If an author has created a capa problem like an mcqs or something similar without providing answer text to an option and some learner selected that option then the response report generation will fail due to that missing answer text. The current commit will add default text to be substituted and prevents report generation crash.
2021-06-17 15:59:24 +05:00
HamzaIbnFarooq
883d223d59 fix: add validation to capa problem markdown for missing option text
Before this commit, if a course author created a capa mcqs or similar problem without providing any answer text for an option the question would be created causing abnormal behavior for learners. This commit will validate answer text of all options and raise an error message to author to fix the issue on the go.
2021-06-17 15:59:24 +05:00
Régis Behmo
b1eaf9c7f8 refactor: remove deprecated mongodb client class
As of pymongo 3.0, the MongoReplicaSetClient is deprecated in favour of
MongoClient. Thus, the creation of mongodb clients is simplified.

See: https://pymongo.readthedocs.io/en/stable/changelog.html#mongoclient-changes
2021-06-14 09:42:34 -04:00
Ihor Romaniuk
06c542dfa0 [BD-26] feat: add temporary waffle flag for enabling disabling proctored exams (#27810)
* feat: [BD-26] add the is_proctored value to SequenceMetadata API

* feat: add temporary flag for enabling/disabling proctored exams

* fix: change creation date

* fix: fix text indents

* fix: [BD-26] Remove redundant duplicated test.

Co-authored-by: Sagirov Eugeniy <sagirov19@gmail.com>
Co-authored-by: Igor Degtiarov <igor.degtiarov@raccoongang.com>
2021-06-11 10:04:11 -04:00
Bianca Severino
58d5b29f19 fix: convert integrity signature waffle flag to CourseWaffleFlag 2021-06-09 13:19:17 -04:00
Kyle McCormick
de8859584f Merge pull request #27874 from edx/kdmccormick/xmodule-no-cms
refactor: make xmodule & openedx independent of code in cms

The xmodule and openedx packages both contain code that is common
between LMS and CMS. The cms package is, of course,
contains CMS-specific code.

So, one prerequisite to extracting CMS into an independent service
will be making sure that lms, common, openedx, and the projects in
common/lib (xmodule, capa, etc.) are not coupled to any CMS-specific
features. This PR moves us towards that reality by making sure
that those packages are independent from cms from a Python-import
perspective, at least.
2021-06-09 09:15:31 -04:00
Christie Rice
e7900160e8 test: Remove flaky test (#27885)
CR-3732
2021-06-08 15:07:23 -04:00
Kyle McCormick
7a26ec6b92 refactor: move xml_importer-specific exceptions into xml_importer
This is a minor refactoring in order to remove
a code dependency of ./xmodule on ./cms
2021-06-08 10:46:52 -04:00
Kyle McCormick
c1e79c993e refactor: use handler_url from xblock runtime, not cms
This is a minor refactoring in order to remove
a code dependency of ./xmodule on ./cms
2021-06-08 10:46:52 -04:00
Kyle McCormick
d42b0c401d refactor: normalize xmodule imports
Code in ./common/lib/xmodule/xmodule should
be imported as `from xmodule`, since `xmodule`
is a locally-installed package.

This is weird, but as long as it is the case,
we should be consistent.

(In BOM-2584, I propose moving the files to
 ./xmodule, which would quell this confusion.)
2021-06-07 16:36:38 -04:00
Bianca Severino
f19582a67c Merge pull request #27831 from edx/bseverino/proctoring-integrity-signature-check
[MST-838] Pass integrity signature waffle flag to timed exam view
2021-06-04 11:26:05 -04:00
Bianca Severino
f7aee7a900 fix: pass integrity signature waffle flag to timed exam view 2021-06-03 15:28:39 -04:00
Michael Terry
6a41c61adc fix: don't escape assignment names in grades API
We had been pre-escaping display names like 'Math & Science' as
'Math &amp; Science" in the REST API itself - which meant that
consumers like MFEs that do their own escaping displayed the wrong
thing.

It's better for the API to just leave the string as-is. As far as
I know, this only affects the gradebook and progress pages, both
of which do their own escaping of the result from the API already.

AA-808
2021-06-03 11:11:07 -04:00
Simon Chen
ce6087f546 [Chore]:MST-677 Cleanup the waffle flag to roll out Proctoring Improvements (#27657) 2021-05-17 20:46:24 -04:00
jawad khan
17906d6770 feat: Add multi device support for mobile in word cloud (#27386)
Enable mobile support on word cloud xblock

LEARNER-8319
2021-05-17 07:49:33 +05:00
Michael Terry
71a8a9fb56 fix: make 'conditional' xblocks work again after being broken
I accidentally broke them in commit b90039b2 by passing in an
extra argument to display.js constructors.

TNL-8318
2021-05-14 10:09:27 -04:00
Michael Terry
1e4daf749c Merge pull request #27594 from edx/mikix/youtube-complete
fix: mark age-restricted youtube videos as complete immediately
2021-05-11 14:53:08 -04:00
Michael Terry
c7fd535c2f fix: mark age-restricted youtube videos as complete immediately
Youtube videos that are age-restricted must be viewed on youtube
itself rather than in the embedded player. So we can't notice when
the video is watched. Rather than leave it incompletable, just mark
the video complete immediately if it's restricted.

AA-804
2021-05-11 13:58:03 -04:00
Kyle McCormick
680bd32de8 revert: refactor: pyupgrade second iteration (#27591)
The edx-sandbox (secure/codejailed execution context
for edx-platform) still runs in Python 3.5, so certain
modules in common/lib cannot be py-upgraded to use
Python 3.8 syntax.

Specifically, this commit added an f-string to
common/lib/sandbox-packages/verifiers/draganddrop.py,
which broke scoring of deprecated drag-and-drop problems
in codejail.

TNL-8322

This reverts commit 8c06b68bbe
2021-05-11 10:53:49 -04:00
Usama Sadiq
4f4be6538a BOM-2477: pylint warnings lint-amnesty (#27585) 2021-05-11 17:22:40 +05:00
Usama Sadiq
8c06b68bbe refactor: pyupgrade second iteration (#27451) 2021-05-10 13:46:28 +05:00
Usama Sadiq
e66e43c5d2 refactor: pyupgrade second iteration (#27450) 2021-05-10 13:42:51 +05:00
Michael Terry
78c6be8bee Merge pull request #27422 from edx/mikix/handler-will-recheck-access
fix: the get_completion JS handler should not ignore FBE blocks
2021-05-04 15:54:36 -04:00
Michael Terry
6e52aafc8c fix: properly set contains_gated_content field on xblocks again
This has been broken for a couple months, preventing proper display
of verified-only assignments on the dates tab and elsewhere.

AA-780
2021-05-03 10:17:17 -04:00
David Ormsbee
dfb80acc11 feat: Enrollment Tracks OutlineProcessor (MST-685)
NOTE: This will require a forced backfill of course outlines to update
the course content data in learning_sequences:

  python manage.py cms backfill_course_outlines --force

Without this backfill, the learning_sequences API will continue to serve
stale content data that has no user partition group data. It won't cause
errors, but it won't do the exclusions properly.

Commit summary:

* Created EnrollmentTrackPartitionGroupsOutlineProcessor to process the
  enrollment_track User Partition Group, allowing Sequences and Sections
  to be removed based on their group_access settings.
* Added user_partition_groups attribute to CourseLearningSequenceData
  and CourseSectionData in learning_sequences/data.py, along with
  backing model data.
* get_outline_from_modulestore now extracts group_access settings from
  Sections and Sequences. It also bubbles up group_access settings from
  Units, meaning that if a Sequence with no group_access setting has
  Units that are all set to show only to the Verified enrollment track,
  then the Sequence will only show to the Verified enrollment track.

This commit adds model-level support for all user partition groups by
capturing all the content group associations (group_access), but it only
implements the code checks for the enrollment track partition. It's not
clear that we want to generalize, since there's only one other partition
type (A/B testing) that is applicable at the outline level.

It's important to note that there is no way to set the group_access for
a Section or Sequence in Studio today. It's only possible by direct
editing of the OLX for import. That being said, the block structures
framework supports applying course groups at this level, and this commit
moves learning_sequences closer to feature parity.

The bubbling up from Units to the parent Sequence was done to mitigate
confusion when a Sequence is entirely composed of Units that are not
visible to the user because of content group restrictions. It's not
clear whether this is something we want to do in the long term, since it
would simplify the code to always specify group_access at the Sequence
level. This first pass is done partially to collect better data about
places in our courses where this kind of usage is already happening.

Most of the EnrollmentTrackPartitionGroupsOutlineProcessor code and its
tests were written by @schenedx.
2021-04-28 12:58:59 -04:00
Michael Terry
b90039b23d fix: the get_completion JS handler should not ignore FBE blocks
Because xblock handlers normally get a block tree that already has
inaccessible blocks stripped, they don't see FBE gated blocks at
all. So the get_completion handler would return True for FBE units
incorrectly. Leading to a visual bug as an audit user went through
their units in the courseware.

In order to let the handler know about the full tree, I've added a
new attribute you can set on your xblock handlers:
my_handler.will_recheck_access = True

This will tell the top-level handler code get the full tree for you.

As part of this, I've also changed the sequence xblock handler's
into proper xblock handlers (not old-style xmodule handlers).
This changes their URLs slightly. I've kept the old URLs for now
as well, but they'll be removed after Maple.

AA-409
2021-04-27 15:17:53 -04:00
Dillon Dumesnil
8c18242ecb fix: AA-646: Fix is_staff_user check to check for course staff
It was checking for global staff, but really only needed to check
for course staff. This corrects the check.
2021-04-23 10:24:53 -04:00
Kyle McCormick
b0d41f6ebb refactor: simplify ProblemBlock inheritance hierarchy (#27363)
Previously, ProblemBlock's implementation was split between
CapaMixin/CapaFields (in capa_base.py) and ProblemBlock
(in capa_module.py), the former being the base classes of the
latter. The split existed for a historical reason:
as a former XModule, ProblemBlock was once split
between CapaDescriptor (author-facing) and CapaModule
(learner-facing). Since ProblemBlock has been converted
to being a pure XBlock, the division between the base
classes and the block class are no longer necessary
nor semantically helpful.

docs: Flesh out ProblemBlock's docstring a bit.
2021-04-22 12:44:15 -04:00