Skip to content

Commit

Permalink
Merge pull request #226 from CUCWD/feature.nutmeg/courseware
Browse files Browse the repository at this point in the history
Merge in prior release changes for courseware
  • Loading branch information
becdavid authored Feb 5, 2024
2 parents 6b48f9f + e3dbe94 commit 0719c1d
Show file tree
Hide file tree
Showing 42 changed files with 4,489 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pylint-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
matrix:
include:
- module-name: lms-1
path: "lms/djangoapps/badges/ lms/djangoapps/save_for_later/ lms/djangoapps/bigcommerce_app/ lms/djangoapps/branding/ lms/djangoapps/bulk_email/ lms/djangoapps/bulk_enroll/ lms/djangoapps/bulk_user_retirement/ lms/djangoapps/ccx/ lms/djangoapps/certificates/ lms/djangoapps/commerce/ lms/djangoapps/course_api/ lms/djangoapps/course_blocks/ lms/djangoapps/course_home_api/ lms/djangoapps/course_wiki/ lms/djangoapps/coursewarehistoryextended/ lms/djangoapps/debug/ lms/djangoapps/courseware/ lms/djangoapps/course_goals/ lms/djangoapps/rss_proxy/"
path: "lms/djangoapps/badges/ lms/djangoapps/mfe_config_api/ lms/djangoapps/save_for_later/ lms/djangoapps/bigcommerce_app/ lms/djangoapps/branding/ lms/djangoapps/bulk_email/ lms/djangoapps/bulk_enroll/ lms/djangoapps/bulk_user_retirement/ lms/djangoapps/ccx/ lms/djangoapps/certificates/ lms/djangoapps/commerce/ lms/djangoapps/course_api/ lms/djangoapps/course_blocks/ lms/djangoapps/course_home_api/ lms/djangoapps/course_wiki/ lms/djangoapps/coursewarehistoryextended/ lms/djangoapps/debug/ lms/djangoapps/courseware/ lms/djangoapps/course_goals/ lms/djangoapps/rss_proxy/"
- module-name: lms-2
path: "lms/djangoapps/gating/ lms/djangoapps/grades/ lms/djangoapps/instructor/ lms/djangoapps/instructor_analytics/ lms/djangoapps/discussion/ lms/djangoapps/edxnotes/ lms/djangoapps/email_marketing/ lms/djangoapps/experiments/ lms/djangoapps/instructor_task/ lms/djangoapps/learner_dashboard/ lms/djangoapps/lms_initialization/ lms/djangoapps/lms_xblock/ lms/djangoapps/lti_provider/ lms/djangoapps/mailing/ lms/djangoapps/mobile_api/ lms/djangoapps/monitoring/ lms/djangoapps/ora_staff_grader/ lms/djangoapps/program_enrollments/ lms/djangoapps/rss_proxy lms/djangoapps/static_template_view/ lms/djangoapps/staticbook/ lms/djangoapps/support/ lms/djangoapps/survey/ lms/djangoapps/teams/ lms/djangoapps/tests/ lms/djangoapps/user_tours/ lms/djangoapps/verify_student/ lms/envs/ lms/lib/ lms/tests.py"
- module-name: openedx-1
Expand Down
10 changes: 10 additions & 0 deletions cms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1264,6 +1264,8 @@
'css/vendor/jquery.qtip.min.css',
'js/vendor/markitup/skins/simple/style.css',
'js/vendor/markitup/sets/wiki/style.css',
'css/vendor/OwlCarousel2/owl.carousel.css',
'css/vendor/OwlCarousel2/owl.theme.default.css',
],
'output_filename': 'css/cms-style-vendor.css',
},
Expand Down Expand Up @@ -1324,6 +1326,14 @@
'common/js/vendor/backbone.js',
'js/vendor/URI.min.js',

# Load Owl Carousel
'js/vendor/OwlCarousel2/owl.carousel.js',

# Used for Glossary
'common/js/vendor/jquery.easytabs.js',
'common/js/vendor/jquery.hashchange.js',
'common/js/vendor/jquery.scrollTo.js',

# Make some edX UI Toolkit utilities available in the global "edx" namespace
'edx-ui-toolkit/js/utils/global-loader.js',
'edx-ui-toolkit/js/utils/string-utils.js',
Expand Down
3 changes: 2 additions & 1 deletion cms/static/js/models/settings/course_details.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ define(['backbone', 'underscore', 'gettext', 'js/models/validation_helpers', 'js
entrance_exam_minimum_score_pct: '50',
learning_info: [],
instructor_info: {},
self_paced: null
self_paced: null,
revision_number: ''
},

validate: function(newattrs) {
Expand Down
3 changes: 2 additions & 1 deletion cms/static/js/spec/views/settings/main_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ define([
instructor_info: {
instructors: [{name: '', title: '', organization: '', image: '', bio: ''}]
},
self_paced: false
self_paced: false,
revision_number: ''
},

mockSettingsPage = readFixtures('mock/mock-settings-page.underscore'),
Expand Down
8 changes: 6 additions & 2 deletions cms/static/js/views/settings/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ define(['js/views/validation', 'codemirror', 'underscore', 'jquery', 'jquery.ui'
options = options || {};
// fill in fields
this.$el.find('#course-language').val(this.model.get('language'));
this.$el.find('#course-revision-number').val(this.model.get('revision_number'));
this.$el.find('#course-organization').val(this.model.get('org'));
this.$el.find('#course-number').val(this.model.get('course_id'));
this.$el.find('#course-name').val(this.model.get('run'));
Expand Down Expand Up @@ -112,6 +113,7 @@ define(['js/views/validation', 'codemirror', 'underscore', 'jquery', 'jquery.ui'
this.$el.find('.remove-course-introduction-video').show();
} else this.$el.find('.remove-course-introduction-video').hide();

this.$el.find('#' + this.fieldToSelectorMap.revision_number).val(this.model.get('revision_number'));
this.$el.find('#' + this.fieldToSelectorMap.effort).val(this.model.get('effort'));
this.$el.find("#" + this.fieldToSelectorMap.certificates_display_behavior).val(this.model.get('certificates_display_behavior'));
this.updateCertificatesDisplayBehavior();
Expand Down Expand Up @@ -188,7 +190,8 @@ define(['js/views/validation', 'codemirror', 'underscore', 'jquery', 'jquery.ui'
course_settings_learning_fields: 'course-settings-learning-fields',
add_course_learning_info: 'add-course-learning-info',
add_course_instructor_info: 'add-course-instructor-info',
course_learning_info: 'course-learning-info'
course_learning_info: 'course-learning-info',
revision_number: 'course-revision-number'
},

addLearningFields: function() {
Expand Down Expand Up @@ -312,7 +315,8 @@ define(['js/views/validation', 'codemirror', 'underscore', 'jquery', 'jquery.ui'
this.updateCertificatesDisplayBehavior();
break;
case 'course-language':
case 'course-effort':
case 'course-version':
case 'course-revision-number':
case 'course-title':
case 'course-subtitle':
case 'course-duration':
Expand Down
5 changes: 5 additions & 0 deletions cms/templates/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,11 @@ <h2 class="title-2">${_('Course Details')}</h2>
</select>
<span class="tip tip-stacked">${_("Identify the course language here. This is used to assist users find courses that are taught in a specific language. It is also used to localize the 'From:' field in bulk emails.")}</span>
</li>
<li class="field text" id="field-course-revision-number">
<label for="course-revision-number">${_("Course Revision Number")}</label>
<input id="course-revision-number" type="text" placeholder="YYYY.MM">
<span class="tip tip-stacked">${_("Identify the course revision number here. This is used to assist with identifying what changes have been made for a course. Placeholder indicates a date format (YYYY.MM), however, we don't have to explicity tie this to a date for the number identification.")}</span>
</li>
</ol>
</div>
% endif
Expand Down
5 changes: 5 additions & 0 deletions cms/templates/ux/reference/fragments/course-settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,11 @@ <h2 class="title-2">Course Details</h2>
</select>
<span class="tip tip-stacked">Identify the course language here. This is used to assist users find courses that are taught in a specific language. It is also used to localize the 'From:' field in bulk emails.</span>
</li>
<li class="field text" id="field-course-revision-number">
<label for="course-revision-number">${_("Course Revision Number")}</label>
<input id="course-revision-number" type="text" placeholder="YYYY.MM">
<span class="tip tip-stacked">${_("Identify the course revision number here. This is used to assist with identifying what changes have been made for a course. Placeholder indicates a date format (YYYY.MM), however, we don't have to explicity tie this to a date for the number identification.")}</span>
</li>
</ol>
</div>

Expand Down
5 changes: 4 additions & 1 deletion common/djangoapps/student/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,14 +679,16 @@ def _get_html_for_entitlement_button(course_key: CourseKey):
return'''
<div class="course-info">
<span class="info-university">{org} - </span>
<span class="info-course-id">{course}</span>
<span class="info-course-id">{course} - </span>
<span class="info-course-run">{run}</span>
<span class="info-date-block-container">
<button class="change-session btn-link ">Change or Leave Session</button>
</span>
</div>
'''.format(
org=course_key.org,
course=course_key.course,
run=course_key.run
)

def test_view_course_appears_on_dashboard(self):
Expand Down Expand Up @@ -901,6 +903,7 @@ def test_dashboard_with_resume_buttons_and_view_buttons(self):
expected_button = html_for_view_buttons[i]
unexpected_button = html_for_resume_buttons[i] + html_for_entitlement[i]

# import pdb;pdb.set_trace()
assert expected_button in dashboard_html
assert unexpected_button not in dashboard_html

Expand Down
41 changes: 41 additions & 0 deletions common/lib/xmodule/xmodule/course_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,31 @@ class CourseFields: # lint-amnesty, pylint: disable=missing-class-docstring
scope=Scope.settings
)

instructor_dashboard_resources = Dict(
# Translators: This field is the container for course-specific instructor dashboard resource configuration values
display_name=_("Instructor Dashboard Resources"),
# Translators: These overrides allow for an alternative configuration of the instructor dashboard resource configuration web view
help=_(
"Enter course-specific overrides for the Instructor Dashboard Resources template parameters here (JSON format)"),
default={
"HANDOUTS": {
"instructor": [
{
"resource-name": "",
"resource-url": ""
},
],
"student": [
{
"resource-name": "",
"resource-url": ""
},
]
}
},
scope=Scope.settings,
)

invitation_only = Boolean(
display_name=_("Invitation Only"),
help=_("Whether to restrict enrollment to invitation by the course staff."),
Expand Down Expand Up @@ -1468,6 +1493,22 @@ def forum_posts_allowed(self):
return False
return True

@property
def instructor_dashboard_resources_instructor(self):
"""
Return list of topic instructor resources defined in course policy.
"""
resources = self.instructor_dashboard_resources
return [r["instructor"] for r in resources.values()][0]

@property
def instructor_dashboard_resources_student(self):
"""
Return list of topic student resources defined in course policy.
"""
resources = self.instructor_dashboard_resources
return [r["student"] for r in resources.values()][0]

@property
def number(self):
"""
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
186 changes: 186 additions & 0 deletions common/static/css/vendor/OwlCarousel2/owl.carousel.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
/**
* Owl Carousel v2.3.4
* Copyright 2013-2018 David Deutsch
* Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE
*/
/*
* Owl Carousel - Core
*/
.owl-carousel {
display: none;
width: 100%;
-webkit-tap-highlight-color: transparent;
/* position relative and z-index fix webkit rendering fonts issue */
position: relative;
z-index: 1; }
.owl-carousel .owl-stage {
position: relative;
-ms-touch-action: pan-Y;
touch-action: manipulation;
-moz-backface-visibility: hidden;
/* fix firefox animation glitch */ }
.owl-carousel .owl-stage:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0; }
.owl-carousel .owl-stage-outer {
position: relative;
overflow: hidden;
/* fix for flashing background */
-webkit-transform: translate3d(0px, 0px, 0px); }
.owl-carousel .owl-wrapper,
.owl-carousel .owl-item {
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-ms-backface-visibility: hidden;
-webkit-transform: translate3d(0, 0, 0);
-moz-transform: translate3d(0, 0, 0);
-ms-transform: translate3d(0, 0, 0); }
.owl-carousel .owl-item {
position: relative;
min-height: 1px;
float: left;
-webkit-backface-visibility: hidden;
-webkit-tap-highlight-color: transparent;
-webkit-touch-callout: none; }
.owl-carousel .owl-item img {
display: block;
width: 100%; }
.owl-carousel .owl-nav.disabled,
.owl-carousel .owl-dots.disabled {
display: none; }
.owl-carousel .owl-nav .owl-prev,
.owl-carousel .owl-nav .owl-next,
.owl-carousel .owl-dot {
cursor: pointer;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none; }
.owl-carousel .owl-nav button.owl-prev,
.owl-carousel .owl-nav button.owl-next,
.owl-carousel button.owl-dot {
background: none;
color: inherit;
border: none;
padding: 0 !important;
font: inherit; }
.owl-carousel.owl-loaded {
display: block; }
.owl-carousel.owl-loading {
opacity: 0;
display: block; }
.owl-carousel.owl-hidden {
opacity: 0; }
.owl-carousel.owl-refresh .owl-item {
visibility: hidden; }
.owl-carousel.owl-drag .owl-item {
-ms-touch-action: pan-y;
touch-action: pan-y;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none; }
.owl-carousel.owl-grab {
cursor: move;
cursor: grab; }
.owl-carousel.owl-rtl {
direction: rtl; }
.owl-carousel.owl-rtl .owl-item {
float: right; }

/* No Js */
.no-js .owl-carousel {
display: block; }

/*
* Owl Carousel - Animate Plugin
*/
.owl-carousel .animated {
animation-duration: 1000ms;
animation-fill-mode: both; }

.owl-carousel .owl-animated-in {
z-index: 0; }

.owl-carousel .owl-animated-out {
z-index: 1; }

.owl-carousel .fadeOut {
animation-name: fadeOut; }

@keyframes fadeOut {
0% {
opacity: 1; }
100% {
opacity: 0; } }

/*
* Owl Carousel - Auto Height Plugin
*/
.owl-height {
transition: height 500ms ease-in-out; }

/*
* Owl Carousel - Lazy Load Plugin
*/
.owl-carousel .owl-item {
/**
This is introduced due to a bug in IE11 where lazy loading combined with autoheight plugin causes a wrong
calculation of the height of the owl-item that breaks page layouts
*/ }
.owl-carousel .owl-item .owl-lazy {
opacity: 0;
transition: opacity 400ms ease; }
.owl-carousel .owl-item .owl-lazy[src^=""], .owl-carousel .owl-item .owl-lazy:not([src]) {
max-height: 0; }
.owl-carousel .owl-item img.owl-lazy {
transform-style: preserve-3d; }

/*
* Owl Carousel - Video Plugin
*/
.owl-carousel .owl-video-wrapper {
position: relative;
height: 100%;
background: #000; }

.owl-carousel .owl-video-play-icon {
position: absolute;
height: 80px;
width: 80px;
left: 50%;
top: 50%;
margin-left: -40px;
margin-top: -40px;
background: url("owl.video.play.png") no-repeat;
cursor: pointer;
z-index: 1;
-webkit-backface-visibility: hidden;
transition: transform 100ms ease; }

.owl-carousel .owl-video-play-icon:hover {
-ms-transform: scale(1.3, 1.3);
transform: scale(1.3, 1.3); }

.owl-carousel .owl-video-playing .owl-video-tn,
.owl-carousel .owl-video-playing .owl-video-play-icon {
display: none; }

.owl-carousel .owl-video-tn {
opacity: 0;
height: 100%;
background-position: center center;
background-repeat: no-repeat;
background-size: contain;
transition: opacity 400ms ease; }

.owl-carousel .owl-video-frame {
position: relative;
z-index: 1;
height: 100%;
width: 100%; }
6 changes: 6 additions & 0 deletions common/static/css/vendor/OwlCarousel2/owl.carousel.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0719c1d

Please sign in to comment.