Commit Graph

389 Commits

Author SHA1 Message Date
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
David Ormsbee
99c759f887 Revert "perf: avoid invoking codejail for problem response report" (#27310)
This reverts commit 35b2780658.
2021-04-12 17:17:31 -04:00
David Ormsbee
35b2780658 perf: avoid invoking codejail for problem response report
We don't need to execute instuctor code for the problem response
report because we're grabbing existing student state and scores.
Running codejail is expensive, slow, and risks report failures if
there is CPU intensive instructor code that is run at times when
the servers are already heavily loaded (and things start timing
out). This came up in TNL-8183 (and many others).
2021-04-07 11:11:07 -04:00
M. Zulqarnain
b4614d75f0 BOM-2378 (C) : pyupgrade in common/lib/xmodule (#26736)
* refactor: pyupgrade in common/lib/xmodule

Co-authored-by: Usama Sadiq <usama.sadiq@arbisoft.com>
2021-03-10 17:56:39 +05:00
usamasadiq
bbc386752f Applied pylint-amnesty 2021-02-04 18:52:10 +05:00
Dave St.Germain
8795bb8c82 Merge pull request #24680 from open-craft/ahmed/fix-capa-dropdown-indexing
[TNL-6993] [BD-29]: Handle edge case where dropdown values are not being indexed
2020-08-11 11:35:29 -04:00
Ahmad Bilal Khalid
971bb1bebd fixed issues pointed by kshitij 2020-08-07 00:26:07 +05:00
Calen Pennington
f9619d6cad Add a pluggable CallToAction service for XBlocks
This also has an initial use case for Personalized Learner Schedules
to add CTAs to capa and vertical blocks to allow users to shift their
course deadlines.
2020-08-06 14:38:26 -04:00
Ahmad Bilal Khalid
3fab3ad47f issue fixed, use regex to replace 2020-08-05 16:26:12 +05:00
Ahmad Bilal Khalid
eb89988944 fixed issue 2020-08-04 22:11:16 +05:00
Ahmad Bilal Khalid
dfedde57b0 Handle edge case where dropdown values are not being indexed, fixed tests 2020-08-04 20:26:15 +05:00
Aarif
98af9ce418 remove useless-supression warnings 2020-05-01 19:42:15 +05:00
DawoudSheraz
0b1c7db967 add multiple correct values check for Dropdown problems 2020-02-10 11:36:28 +05:00
Feanil Patel
9cf2f9f298 Run 2to3 -f future . -w
This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
2019-12-30 10:35:30 -05:00
Braden MacDonald
f31dc19887 Support anonymous users in the Blockstore-based XBlock runtime
Implementation details:
* Anonymous users are assigned a unique ID (like 
  `anon42c08f9996194e2a9339`) which gets stored in the django session.
  `block.scope_ids.user_id` and `block.runtime.anonymous_student_id`
  will both return this value.
* User state for anonymous users is stored in the django cache and
  automatically expires as the cache gets pruned. Because user state is
  stored, anonymous users can use interactive blocks like capa problems.
* There is no mechanism for upgrading to a registered account and
  keeping user state since the user state store for anonymous users
  (EphemeralKeyValueStore) is completely different than the one for
  registered users (DjangoKeyValueStore/"CSM"), and has no "list all
  keys" functionality.
* "User State Summary" field values are shared among [recently active]
  anonymous users but are not shared with registered users.
* Anonymous users can only access the `public_view` of XBlocks, not the
  regular `student_view`.
2019-12-19 16:12:24 -08:00
Feanil Patel
07df64eb8c Fix the rest of these. 2019-09-27 14:36:40 -04:00
Feanil Patel
16cce5f389 BOM-843 Fix reraise call. 2019-09-27 14:19:40 -04:00
Alan Zarembok
95616d7d11 PROD-448: Gracefully handle exceptions from user-supplied code in
advanced problems so that they do not become uneditable.
2019-07-11 14:45:58 -04:00
Kyle Mulka
d4cbcfd5d5 INCR-229 ran modernize and isort on some files (#20463)
* INCR-229 ran modernize on common/lib/xmodule/xmodule/[a-g]*.py except for graders.py

* fix a couple xss-commit-linter issues
2019-05-09 00:57:09 -04:00
Usman Khalid
41c6236e0a Convert CapaModule to ProblemBlock.
* Minimum possible changes were made to merge CapaModule & CapaDescriptor into
  one ProblemBlock class.
* There are no known changes in behavior.
* CapaModule and CapaDescriptor inherited from a number of classes which inherit
  from XModule or XModuleDescriptor but did not depend on them. For all these
  classes the methods were moved to mixins which did not inherit from either and
  then these mixins were added to ProblemBlock in the order which maintains MRO.
2019-05-01 20:08:36 +05:00
Diana Huang
6572d99e76 Remove all references to datadog from our code. 2019-01-08 15:41:24 -05:00
noraiz-anwar
593c2d1ae8 add python getter in capa system 2018-07-18 18:44:56 +05:00
Kshitij Sobti
c7f980c9de Add correct answer to response 2018-07-09 23:57:14 +05:30
Daniel Clemente Laboreo
6d3f8150db Implement generate_report_data for capa problems 2018-05-24 22:09:58 +03:00
Ned Batchelder
e23e3a0486 Fix a number of unused-import pylint violations 2017-11-21 19:57:06 -05:00
Sanford Student
932776159c EDUCATOR-165 instructor task and UI for overriding learner grades. 2017-07-18 13:51:56 -04:00
Andy Armstrong
93235d118d Reorder imports using isort (except lms and cms) 2017-05-30 16:04:54 -04:00
sanfordstudent
bcc3d16589 Merge pull request #14929 from edx/neem/capa-refactor
Refactor CAPA to use scorable XBlock mixin
2017-05-02 09:43:06 -04:00
J. Cliff Dyer
ea0027f338 refactor CAPA to use scorable xblock mixin
for TNL-6594
2017-05-01 15:08:17 -04:00
Ned Batchelder
4a568476fd Remove a number of unneeded super()-delegation methods 2017-04-27 14:12:56 -04:00
Jillian Vogel
f18a2be837 Implement optional hiding of capa assessment results 2017-04-13 15:52:57 -07:00
Nimisha Asthagiri
f1f5a8f12f Optimize max_score by moving from XModule to Descriptor
TNL-5939
2016-11-17 09:17:59 -05:00
Albert St. Aubin
dbb66f8c09 Updated the problem meta to show a score of 0 and refactored/simplified the JS that build the problem meta string
TNL-5549
2016-10-21 06:40:20 -04:00
cahrens
0fb37ceeb6 Replace with JS code. 2016-10-18 16:27:29 -04:00
cahrens
1b03a0090d Replace with CoffeeScript generated version of JS.
Includes reformatting to 4 spaces.
2016-10-14 13:14:19 -04:00
cahrens
b8ddf709dc Convert javascript_loader to JS.
Also reformat to 4 spaces per indent.
2016-10-13 13:59:00 -04:00
muhammad-ammar
c3b6b10478 Problem (capa) feedback UX revamp.
TNL-4877
2016-10-06 17:34:43 -04:00
Eric Fischer
0059f88d2a Silence XML parse error in capa_module
TNL-5057 This un-actionable error is polluting the stream of devops pages, and
should be quieted. A longer term fix will be made in TNL-5245.
2016-08-25 12:00:18 -04:00
Ned Batchelder
eef964f5f6 Fix unused-variable errors 2016-08-03 12:44:41 -04:00
Adam Palay
a19d2e76ff quiet some noisy logs 2016-07-06 16:32:27 -04:00
muhammad-ammar
8024bae255 enforce display name in CAPA problems
FEDX-198
2016-06-09 16:42:19 +05:00
Dmitry Viskov
21bbcc9f35 Connected aside information is included in the emitted event (on check) 2016-05-19 17:37:40 +03:00
Christina Roberts
2497f0a0eb WIP: xblock pipeline work (#10176)
[PERF-303] Integer XBlocks/XModules into the static asset pipeline.

This PR, based on hackathon work from Christina/Andy, implements a way to discover all installed XBlocks and XModules and to enumerate their public assets, then pulling them in during the collectstatic phase and hashing them.  In turn, the methods for generating URLs to resources will then returned the hashed name for assets, allowing them to be served from nginx/CDNs, and cached heavily.
2016-04-29 10:52:42 -04:00
Calen Pennington
dd90c55602 Create a new CSMHExtended table to hold our new data
This is a clone (copy) of CSMH's declaration and methods with an added
id of UnsignedBigInAutoField

We should be able to delete the save_history code, but needs testing.

Add error logging when capa failures happen

Put StudentModuleHistory into its own database

Bump out the primary key on CSMHE

This gives us a gap to backfill as needed.
Since the new table's pk is an unsigned bigint, even for people who don't
consolidate CSMH into CSMHE, the lost rows are unlikely to matter.

Remove StudentModuleHistory cleaner
2016-02-29 13:58:39 -05:00
Ned Batchelder
f5d0f3ff55 Remove useless pylint suppressions 2015-11-22 07:41:19 -05:00
Nimisha Asthagiri
0698076440 Transformer: StudentViewTransformer 2015-11-05 23:29:12 +00:00
Marko Jevtic
8faff973df Quality improvements 2015-08-18 08:26:44 +00:00
Marko Jevtic
63edfc6eb4 Applied suggestion from the 1st review 2015-08-17 14:14:17 +00:00
Marko Jevtic
35e7a7338c Addresses design review feedback 2015-08-13 12:46:48 +00:00
Marko Jevtic
d942891b6f (SOL-1040) Indexing capa problems 2015-08-12 11:49:56 +02:00