Skip to content
Snippets Groups Projects
  1. Feb 03, 2020
  2. Jan 24, 2020
  3. Jan 16, 2020
    • Braden MacDonald's avatar
      Add way to get YouTube metadata that doesn't require a session cookie · c7d5efb7
      Braden MacDonald authored
      The Video Player XBlock will sometimes make API calls to /couses/yt_video_metadata, a REST API endpoint that in turn loads video metadata from YouTube using the configured settings.YOUTUBE_API_KEY.
      
      However, in the Blockstore-based XBlock runtime, we are running XBlocks in a secure sandbox, and the user's browser cannot pass session cookies when calling REST API endpoints. So currently, the video XBlock tries to request YouTube metadata from that API endpoint, but it fails if run within such a sandbox.
      
      The existing API also doesn't work for anonymous users (users who are allowed to see video XBlocks but who have not logged in to an LMS user account).
      
      This commit updates the Video XBlock so that it can use a handler to load the data from YouTube instead of a generic REST API. This works well in the new runtime, because it has code to support calling handlers within the sandbox, including by anonymous users.
      
      I also fixed a bug where on a default devstack, the endpoint will try calling YouTube using PUT_YOUR_API_KEY_HERE as an API key, and get a "bad request" error from YouTube.
      
      The code could be re-organized by moving things around, but I've left everything as-is for now to keep the diff as small as possible.
      c7d5efb7
  4. Jan 15, 2020
    • Braden MacDonald's avatar
      Fix: KeyError: 'source' when parsing HTML5 videos · d39421d9
      Braden MacDonald authored
      This fixes a bug that causes the video XBlock parsing to break in the new XBlock runtime if:
      * the html5_sources field is set, and
      * the download_video field is not set
      
      The error is:
      
        File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/xblock/rest_api/views.py", line 52, in render_block_view
          block = load_block(usage_key, request.user)
        File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/xblock/api.py", line 84, in load_block
          return runtime.get_block(usage_key)
        File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/xblock/runtime/blockstore_runtime.py", line 70, in get_block
          block = block_class.parse_xml_new_runtime(xml_node, runtime=self, keys=keys)
        File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/video_module/video_module.py", line 620, in parse_xml_new_runtime
          setattr(video_block, key, cls.fields[key].from_json(val))
        KeyError: 'source'
      
      The reason for the error is that parse_video_xml() will sometimes return a 'source' attribute in its field_data return value, even though source is not a video field (anymore). This then causes an error when trying to look up cls.fields['source']
      
      A workaround in the meantime is to add download_video="false" to the OLX.
      d39421d9
  5. Jan 14, 2020
  6. Jan 13, 2020
  7. Jan 02, 2020
  8. Dec 30, 2019
  9. Dec 20, 2019
    • atesker's avatar
      EDUCATOR-4846 - added team config service for xblocks. · e0d57fe1
      atesker authored
      Quality / encoding
      
      Remove comments
      
      remove debug
      
      Changed service implementation to make unit testing easier
      
      Corrected service
      
      code style
      
      unit test cleanup
      
      Clean up imports
      e0d57fe1
    • Braden MacDonald's avatar
      Support anonymous users in the Blockstore-based XBlock runtime · f31dc198
      Braden MacDonald authored
      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`.
      f31dc198
  10. Dec 15, 2019
  11. Dec 13, 2019
  12. Dec 11, 2019
  13. Dec 10, 2019
  14. Dec 09, 2019
    • Giovanni Cimolin da Silva's avatar
      Upgrade pymongo and fix issues · ba4de2f9
      Giovanni Cimolin da Silva authored
      This commit upgrades the version of pymongo from 2.x to 3.x, removing usages to deprecated functions usage and fixing tests where necessary.
      
      This version of pymongo supports MongoDB 2.x all the way up to 4.2, and this ensures that the platform will be able to run on a supported MongoDB version in the next release.
      ba4de2f9
  15. Dec 06, 2019
  16. Dec 05, 2019
    • Feanil Patel's avatar
      Add error handling in course structure cache. · 684f254a
      Feanil Patel authored
      When going between python 2 and python 3.5 we can get pickeld course
      structires that are incompatible no matter what we do do to the bug
      linked in the comment.  In this case, handle the error and delete the
      corrupt data from the cache.
      
      Making this fairly generic because if we have any bad data in cache we
      don't want it to blow up the whole process.  Just delete the bad data
      and try again.
      684f254a
  17. Nov 27, 2019
  18. Nov 14, 2019
  19. Nov 12, 2019
  20. Nov 07, 2019
    • Feanil Patel's avatar
      The type of the attrib object wasn't actually a dict. · 1a3f2108
      Feanil Patel authored
      It was an internal class that we can't easily compare to. So I'm opting
      to just make the xml output be more consistent and ordered.  I was
      hoping to avoid this since the order shouldn't matter but the juggling
      we have to do to validate the unorderd data is more complication than
      it's worth.
      1a3f2108
    • Dave St.Germain's avatar
      TNL-6929: · 3e73ba38
      Dave St.Germain authored
      Improves navigation within Studio for Learning Sequences, speeding up authors who want to see how a learner progresses through content without needing to jump over to the LMS.
      
      This adds a dropdown section navigator to the breadcrumbs on the unit page and copies the sequence navigator from LMS to the studio unit page.
      3e73ba38
    • Kyle McCormick's avatar
      Remove most references to old teams config scheme (#22238) · 4f3262a4
      Kyle McCormick authored
      This is a follow up from MST-16, which was commited
      in 3858036a.
      
      Changes:
      * Enrich course teams_configuration from a plain Dict
        to a custom XBlock field that uses the new TeamsConfig
        wrapper class.
      * Remove teams_conf property from course, as the previous
        change made it redundant.
      * Update teams_enabled implementation.
      * Remove teams_max_size field from course, which is
        no longer semantically correct, as max team size
        is now defined on a teamset level.
      * Remove teams_topics in order to discourage use of raw
        teams config dict.
      * Add convenience properties teamsets and teamsets_by_id
        to course.
      * Allow periods and spaces in teamset IDs to avoid breaking
        existing course teams.
      
      Some parts of the code still use the old raw config data
      (identifiable by searching "cleaned_data_old_format"),
      which we expect to be slowly factored away as we build
      new teams features. MST-40 has been created to remove any
      remaining references if necessary.
      
      MST-18
      
      * fix: bokchoy test
      
      * fix: remove pdb break
      4f3262a4
  21. Nov 06, 2019
    • Feanil Patel's avatar
      Parse transcripts json to compare logically. · 0078a6c1
      Feanil Patel authored
      This is to deal with a special issue in the video descriptor xml output.
      The value of the transcript attribute of the video tag is a serialized
      json string.  This can have comparison problems in python3 where the order
      of the dictionary output is not gauranteed to be the same. So the strings
      don't match equally.  We convert the parsed json instead so that the
      comparison can be correct.
      0078a6c1
    • DawoudSheraz's avatar
      added conditional logs for RCA · 3787dcd7
      DawoudSheraz authored
      3787dcd7
  22. Nov 04, 2019