Skip to content

Commit

Permalink
Merge pull request #343 from ucsd-ets/release-candidate
Browse files Browse the repository at this point in the history
Release-2020-04-08 to 2020-04-22
  • Loading branch information
tehreem-sadat authored Apr 22, 2020
2 parents 7ab5493 + 6f1cbcd commit bb1815a
Show file tree
Hide file tree
Showing 17 changed files with 113 additions and 44 deletions.
2 changes: 1 addition & 1 deletion cms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@
'openedx.core.djangoapps.oauth_dispatch.dot_overrides.backends.EdxRateLimitedAllowAllUsersModelBackend',
]

LMS_BASE = None
LMS_BASE = "localhost:8000"
LMS_ROOT_URL = "http://localhost:8000"
LMS_INTERNAL_ROOT_URL = LMS_ROOT_URL
LMS_ENROLLMENT_API_PATH = "/api/enrollment/v1/"
Expand Down
2 changes: 1 addition & 1 deletion cms/envs/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
EMAIL_PORT = ENV_TOKENS.get('EMAIL_PORT', EMAIL_PORT)
EMAIL_USE_TLS = ENV_TOKENS.get('EMAIL_USE_TLS', EMAIL_USE_TLS)

LMS_BASE = ENV_TOKENS.get('LMS_BASE')
LMS_BASE = ENV_TOKENS.get('LMS_BASE', LMS_BASE)
LMS_ROOT_URL = ENV_TOKENS.get('LMS_ROOT_URL')
LMS_INTERNAL_ROOT_URL = ENV_TOKENS.get('LMS_INTERNAL_ROOT_URL', LMS_ROOT_URL)
ENTERPRISE_API_URL = ENV_TOKENS.get('ENTERPRISE_API_URL', LMS_INTERNAL_ROOT_URL + '/enterprise/api/v1/')
Expand Down
4 changes: 3 additions & 1 deletion common/djangoapps/student/tests/test_retirement.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,9 @@ class TestRegisterRetiredUsername(TestCase):
# The returned message here varies depending on whether a ValidationError -or-
# an AccountValidationError occurs.
INVALID_ACCT_ERR_MSG = ('An account with the Public Username', 'already exists.')
INVALID_ERR_MSG = ('It looks like', 'belongs to an existing account. Try again with a different username.')
INVALID_ERR_MSG = ('It looks like', 'belongs to an existing account. Please use a different public username. '
'Your email address is still your unique identifier for your account.')


def setUp(self):
super(TestRegisterRetiredUsername, self).setUp()
Expand Down
49 changes: 28 additions & 21 deletions common/lib/xmodule/xmodule/tests/test_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from lxml import etree
from mock import ANY, Mock, patch, MagicMock
import ddt
import httpretty

from django.conf import settings
from django.test import TestCase
Expand Down Expand Up @@ -62,29 +63,19 @@
'''

YOUTUBE_SUBTITLES = (
"LILA FISHER: Hi, welcome to Edx. I'm Lila Fisher, an Edx fellow helping to put together these"
" courses. As you know, our courses are entirely online. So before we start learning about the"
" subjects that brought you here, let's learn about the tools that you will use to navigate through"
" the course material. Let's start with what is on your screen right now. You are watching a video"
" of me talking. You have several tools associated with these videos. Some of them are standard"
" video buttons, like the play Pause Button on the bottom left. Like most video players, you can see"
" how far you are into this particular video segment and how long the entire video segment is."
" Something that you might not be used to is the speed option. While you are going through the"
" videos, you can speed up or slow down the video player with these buttons. Go ahead and try that"
" now. Make me talk faster and slower. If you ever get frustrated by the pace of speech, you can"
" adjust it this way. Another great feature is the transcript on the side. This will follow along"
" with everything that I am saying as I am saying it, so you can read along if you like. You can"
" also click on any of the words, and you will notice that the video jumps to that word. The video"
" slider at the bottom of the video will let you navigate through the video quickly. If you ever"
" find the transcript distracting, you can toggle the captioning button in order to make it go away"
" or reappear. Now that you know about the video player, I want to point out the sequence navigator."
" Right now you're in a lecture sequence, which interweaves many videos and practice exercises. You"
" can see how far you are in a particular sequence by observing which tab you're on. You can"
" navigate directly to any video or exercise by clicking on the appropriate tab. You can also"
" progress to the next element by pressing the Arrow button, or by clicking on the next tab. Try"
" that now. The tutorial will continue in the next video."
"Sample trascript line 1. "
"Sample trascript line 2. "
"Sample trascript line 3."
)

MOCKED_YOUTUBE_TRANSCRIPT_API_RESPONSE = '''
<transcript>
<text start="27.88" dur="3.68">Sample trascript line 1.</text>
<text start="31.76" dur="9.54">Sample trascript line 2.</text>
<text start="44.04" dur="3.1">Sample trascript line 3.</text>
</transcript>
'''

ALL_LANGUAGES = (
[u"en", u"English"],
[u"eo", u"Esperanto"],
Expand Down Expand Up @@ -1038,6 +1029,7 @@ def test_video_with_no_subs_index_dictionary(self):
"content_type": "Video"
})

@httpretty.activate
def test_video_with_youtube_subs_index_dictionary(self):
"""
Test index dictionary of a video module with YouTube subtitles.
Expand All @@ -1057,6 +1049,13 @@ def test_video_with_youtube_subs_index_dictionary(self):
</video>
'''
yt_subs_id = 'OEoXaMPEzfM'
url = 'http://video.google.com/timedtext?lang=en&v={}'.format(yt_subs_id)
httpretty.register_uri(
method=httpretty.GET,
uri=url,
body=MOCKED_YOUTUBE_TRANSCRIPT_API_RESPONSE,
content_type='application/xml'
)
descriptor = instantiate_descriptor(data=xml_data_sub)
subs = download_youtube_subs(yt_subs_id, descriptor, settings)
save_subs_to_store(json.loads(subs), yt_subs_id, descriptor)
Expand All @@ -1068,6 +1067,7 @@ def test_video_with_youtube_subs_index_dictionary(self):
"content_type": "Video"
})

@httpretty.activate
def test_video_with_subs_and_transcript_index_dictionary(self):
"""
Test index dictionary of a video module with
Expand All @@ -1089,6 +1089,13 @@ def test_video_with_subs_and_transcript_index_dictionary(self):
</video>
'''
yt_subs_id = 'OEoXaMPEzfM'
url = 'http://video.google.com/timedtext?lang=en&v={}'.format(yt_subs_id)
httpretty.register_uri(
method=httpretty.GET,
uri=url,
body=MOCKED_YOUTUBE_TRANSCRIPT_API_RESPONSE,
content_type='application/xml'
)
descriptor = instantiate_descriptor(data=xml_data_sub_transcript)
subs = download_youtube_subs(yt_subs_id, descriptor, settings)
save_subs_to_store(json.loads(subs), yt_subs_id, descriptor)
Expand Down
10 changes: 9 additions & 1 deletion common/lib/xmodule/xmodule/video_module/video_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
VideoTranscriptsMixin,
clean_video_id,
subs_filename,
get_transcript_for_video
get_transcript_for_video,
get_transcript
)

from .video_handlers import VideoStudentViewHandlers, VideoStudioViewHandlers
Expand Down Expand Up @@ -1040,6 +1041,13 @@ def _update_transcript_for_index(language=None):

if self.sub:
_update_transcript_for_index()
else:
try:
transcript = get_transcript(self, lang=self.transcript_language, output_format=Transcript.TXT)[0].replace("\n", " ")
transcript_index_name = "transcript_{}".format(self.transcript_language)
video_body.update({transcript_index_name: transcript})
except NotFoundError:
pass

# Check to see if there are transcripts in other languages besides default transcript
if self.transcripts:
Expand Down
19 changes: 16 additions & 3 deletions lms/djangoapps/certificates/views/webview.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ def _update_certificate_context(context, course, user_certificate, platform_name
# Populate dynamic output values using the course/certificate data loaded above
certificate_type = context.get('certificate_type')

lms_base = configuration_helpers.get_value("lms_base", settings.LMS_BASE)

# Override the defaults with any mode-specific static values
context['certificate_id_number'] = user_certificate.verify_uuid
context['certificate_verify_url'] = "{prefix}{uuid}{suffix}".format(
Expand Down Expand Up @@ -129,11 +131,22 @@ def _update_certificate_context(context, course, user_certificate, platform_name
platform_name=platform_name
)

# edx-417: this is used in SOA, replaces document_title there
context['document_title_1_a'] = _("UC San Diego").upper()
context['document_title_1_b'] = _("Online").upper()
context['document_title_2'] = _("Statement of Accomplishment").upper()

# Translators: This text fragment appears after the student's name (displayed in a large font) on the certificate
# screen. The text describes the accomplishment represented by the certificate information displayed to the user
context['accomplishment_copy_description_full'] = _("successfully completed, received a passing grade, and was "
"awarded this {platform_name} "
"Statement of Accomplishment in ").format(platform_name=platform_name)
# edx-417
context['accomplishment_copy_description_full'] = _("has successfully completed an offering of")
context['accomplishment_disclaimer'] = _("A Statement of accomplishment acknowledges that a {platform_name} " +
"course offered on {lms_base} was completed with a score indicating mastery of material by a particular learner. " +
"A Statement of accomplishment is not a certificate. It does not convey any academic credit, grade or degree, " +
"or indicate enrollment at UC San Diego").format(
platform_name=platform_name,
lms_base=lms_base
).upper()

certificate_type_description = get_certificate_description(user_certificate.mode, certificate_type, platform_name)
if certificate_type_description:
Expand Down
2 changes: 2 additions & 0 deletions lms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@

ENABLE_JASMINE = False

LMS_BASE = "localhost:8000"
LMS_ROOT_URL = "http://localhost:8000"
LMS_INTERNAL_ROOT_URL = LMS_ROOT_URL
LMS_ENROLLMENT_API_PATH = "/api/enrollment/v1/"
Expand Down Expand Up @@ -1620,6 +1621,7 @@ def _make_locale_paths(settings):
'style-certificates': {
'source_filenames': [
'certificates/css/main-ltr.css',
'css/lms-main-v1.css',
'css/vendor/font-awesome.css',
],
'output_filename': 'css/certificates-style.css'
Expand Down
1 change: 1 addition & 0 deletions lms/envs/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
EDXMKTG_LOGGED_IN_COOKIE_NAME = ENV_TOKENS.get('EDXMKTG_LOGGED_IN_COOKIE_NAME', EDXMKTG_LOGGED_IN_COOKIE_NAME)
EDXMKTG_USER_INFO_COOKIE_NAME = ENV_TOKENS.get('EDXMKTG_USER_INFO_COOKIE_NAME', EDXMKTG_USER_INFO_COOKIE_NAME)

LMS_BASE = ENV_TOKENS.get('LMS_BASE', LMS_BASE)
LMS_ROOT_URL = ENV_TOKENS.get('LMS_ROOT_URL')
LMS_INTERNAL_ROOT_URL = ENV_TOKENS.get('LMS_INTERNAL_ROOT_URL', LMS_ROOT_URL)

Expand Down
1 change: 1 addition & 0 deletions lms/envs/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@
COMPREHENSIVE_THEME_LOCALE_PATHS = [REPO_ROOT / "themes/conf/locale", ]

LMS_ROOT_URL = "http://localhost:18000"
LMS_BASE = "localhost:18000"

# TODO (felipemontoya): This key is only needed during lettuce tests.
# To be removed during https://openedx.atlassian.net/browse/DEPR-19
Expand Down
17 changes: 11 additions & 6 deletions lms/static/js/student_account/views/LoginView.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,17 @@
},

renderAuthWarning: function() {
var message = _.sprintf(
gettext('You have successfully signed into %(currentProvider)s, but your %(currentProvider)s' +
' account does not have a linked %(platformName)s account. To link your accounts,' +
' sign in now using your %(platformName)s password.'),
{currentProvider: this.currentProvider, platformName: this.platformName}
);
var message = HtmlUtils.interpolateHtml(
gettext('{paragraphStart}You have successfully signed into {currentProvider}, but your {currentProvider} account does not have a linked {platformName} account.{paragraphEnd}' + // eslint-disable-line max-len
'{blankLine}{paragraphStart}If you already have a {platformName} account, please log in below to link it to your {currentProvider} account.{paragraphEnd}' + // eslint-disable-line max-len
'{blankLine}{paragraphStart}If you do not have a {platformName} account, please click the "Create a {platformName} Account" button.{paragraphEnd}'), { // eslint-disable-line max-len
currentProvider: this.currentProvider,
platformName: this.platformName,
paragraphStart: HtmlUtils.HTML('<p>'),
paragraphEnd: HtmlUtils.HTML('</p>'),
blankLine: HtmlUtils.HTML('<br>')
}
);

this.clearAuthWarning();
this.renderFormFeedback(this.formStatusTpl, {
Expand Down
3 changes: 2 additions & 1 deletion openedx/core/djangoapps/user_api/accounts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
)
USERNAME_CONFLICT_MSG = _(
u"It looks like {username} belongs to an existing account. "
u"Try again with a different username."
u"Please use a different public username. "
u"Your email address is still your unique identifier for your account."
)

# Translators: This message is shown to users who enter a username/email/password
Expand Down
9 changes: 6 additions & 3 deletions openedx/core/djangoapps/user_api/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,8 @@ def test_register_duplicate_retired_username_account_validation_error(self):
"username": [{
"user_message": (
"It looks like {} belongs to an existing account. "
"Try again with a different username."
"Please use a different public username. "
"Your email address is still your unique identifier for your account."
).format(
self.USERNAME
)
Expand Down Expand Up @@ -2220,7 +2221,8 @@ def test_register_duplicate_username(self):
"username": [{
"user_message": (
"It looks like {} belongs to an existing account. "
"Try again with a different username."
"Please use a different public username. "
"Your email address is still your unique identifier for your account."
).format(
self.USERNAME
)
Expand Down Expand Up @@ -2255,7 +2257,8 @@ def test_register_duplicate_username_and_email(self):
"username": [{
"user_message": (
"It looks like {} belongs to an existing account. "
"Try again with a different username."
"Please use a different public username. "
"Your email address is still your unique identifier for your account."
).format(
self.USERNAME
)
Expand Down
26 changes: 24 additions & 2 deletions openedx/features/ucsd_features/additional_registration_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,34 @@ class AdditionalRegistrationFieldsForm(ModelForm):
"""
The fields on this form are derived from the AdditionalRegistrationFields model in models.py.
"""
def __init__(self, *args, **kwargs):
super(AdditionalRegistrationFieldsForm, self).__init__(*args, **kwargs)

class Meta(object):
model = AdditionalRegistrationFields
fields = ('gender_nb', 'ethnicity', 'age', 'education', 'howheard')
error_messages = {
'gender_nb': {
'required': 'Please select your Gender.',
},
'ethnicity': {
'required': 'Please select your Ethnicity.',
},
'age': {
'required': 'Please select your Age Group.',
},
'education': {
'required': 'Please select your Education Level.',
},
'howheard': {
'required': 'Please tell, how did you hear about us.'
},
}
help_texts = {
'gender_nb': 'Select "Decline to State" if you prefer not to tell.',
'ethnicity': 'The ethnic or social group you belong to.',
'age': 'Select the range in which your current age falls.',
'education': 'Your most recent educational qualification.',
'howheard': 'From where did you learn about us?',
}


# Admin Customization
Expand Down
3 changes: 2 additions & 1 deletion requirements/edx/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ git+https://github.com/edx/django-rest-framework.git@1ceda7c086fddffd1c440cc8685
-e git+https://github.com/edx/DoneXBlock.git@01a14f3bd80ae47dd08cdbbe2f88f3eb88d00fba#egg=done-xblock
-e git+https://github.com/jazkarta/edx-jsme.git@690dbf75441fa91c7c4899df0b83d77f7deb5458#egg=edx-jsme
git+https://github.com/mitodl/edx-sga.git@3828ba9e413080a81b907a3381e5ffa05e063f81#egg=edx-sga==0.8.3
git+https://github.com/edx/xblock-lti-consumer.git@v1.1.8#egg=lti_consumer-xblock==1.1.8
git+https://github.com/edx/xblock-lti-consumer.git@v1.2.5#egg=lti_consumer-xblock==1.2.5
git+https://github.com/appsembler/tahoe-lti.git@release-0.2.0#egg=tahoe-lti==release-0.2.0
git+https://github.com/edx/MongoDBProxy.git@25b99097615bda06bd7cdfe5669ed80dc2a7fed0#egg=MongoDBProxy==0.1.0
-e .
git+https://github.com/edx/edx-ora2.git@2.2.0#egg=ora2==2.2.0
Expand Down
3 changes: 2 additions & 1 deletion requirements/edx/development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ git+https://github.com/edx/django-rest-framework.git@1ceda7c086fddffd1c440cc8685
-e git+https://github.com/jazkarta/edx-jsme.git@690dbf75441fa91c7c4899df0b83d77f7deb5458#egg=edx-jsme
git+https://github.com/mitodl/edx-sga.git@3828ba9e413080a81b907a3381e5ffa05e063f81#egg=edx-sga==0.8.3
git+https://github.com/edx/lettuce.git@7a04591c78ac56dac3eb3e91ca94b15cce844133#egg=lettuce==0.2.23+edx.1
git+https://github.com/edx/xblock-lti-consumer.git@v1.1.8#egg=lti_consumer-xblock==1.1.8
git+https://github.com/edx/xblock-lti-consumer.git@v1.2.5#egg=lti_consumer-xblock==1.2.5
git+https://github.com/appsembler/tahoe-lti.git@release-0.2.0#egg=tahoe-lti==release-0.2.0
git+https://github.com/edx/MongoDBProxy.git@25b99097615bda06bd7cdfe5669ed80dc2a7fed0#egg=MongoDBProxy==0.1.0
-e .
git+https://github.com/edx/edx-ora2.git@2.2.0#egg=ora2==2.2.0
Expand Down
3 changes: 2 additions & 1 deletion requirements/edx/github.in
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
-e git+https://github.com/jazkarta/edx-jsme.git@690dbf75441fa91c7c4899df0b83d77f7deb5458#egg=edx-jsme
-e git+https://github.com/mitodl/django-cas.git@afac57bc523f145ae826f4ed3d4fa8b2c86c5364#egg=django-cas==2.1.1
-e git+https://github.com/dgrtwo/ParsePy.git@7949b9f754d1445eff8e8f20d0e967b9a6420639#egg=parse_rest
-e git+https://github.com/appsembler/tahoe-lti.git@release-0.2.0#egg=tahoe-lti==release-0.2.0

# Forked to get Django 1.10+ compat that is in origin BitBucket repo, without an official build.
# This can go away when we update auth to not use django-rest-framework-oauth
Expand All @@ -95,7 +96,7 @@
-e git+https://github.com/edx/RateXBlock.git@367e19c0f6eac8a5f002fd0f1559555f8e74bfff#egg=rate-xblock
-e git+https://github.com/edx/DoneXBlock.git@01a14f3bd80ae47dd08cdbbe2f88f3eb88d00fba#egg=done-xblock
-e git+https://github.com/edx-solutions/xblock-google-drive.git@138e6fa0bf3a2013e904a085b9fed77dab7f3f21#egg=xblock-google-drive
-e git+https://github.com/edx/xblock-lti-consumer.git@v1.1.8#egg=lti_consumer-xblock==1.1.8
-e git+https://github.com/edx/xblock-lti-consumer.git@v1.2.5#egg=lti_consumer-xblock==1.2.5

# Third Party XBlocks

Expand Down
3 changes: 2 additions & 1 deletion requirements/edx/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ git+https://github.com/edx/django-rest-framework.git@1ceda7c086fddffd1c440cc8685
-e git+https://github.com/jazkarta/edx-jsme.git@690dbf75441fa91c7c4899df0b83d77f7deb5458#egg=edx-jsme
git+https://github.com/mitodl/edx-sga.git@3828ba9e413080a81b907a3381e5ffa05e063f81#egg=edx-sga==0.8.3
git+https://github.com/edx/lettuce.git@7a04591c78ac56dac3eb3e91ca94b15cce844133#egg=lettuce==0.2.23+edx.1
git+https://github.com/edx/xblock-lti-consumer.git@v1.1.8#egg=lti_consumer-xblock==1.1.8
git+https://github.com/edx/xblock-lti-consumer.git@v1.2.5#egg=lti_consumer-xblock==1.2.5
git+https://github.com/appsembler/tahoe-lti.git@release-0.2.0#egg=tahoe-lti==release-0.2.0
git+https://github.com/edx/MongoDBProxy.git@25b99097615bda06bd7cdfe5669ed80dc2a7fed0#egg=MongoDBProxy==0.1.0
-e .
git+https://github.com/edx/edx-ora2.git@2.2.0#egg=ora2==2.2.0
Expand Down

0 comments on commit bb1815a

Please sign in to comment.