Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
9a64872
Allow determined by resource to be stored as a value.
rtibbles Oct 24, 2022
b6e4324
Stop using the google storage API url in production to prevent CORS i…
rtibbles Oct 24, 2022
9462899
Merge pull request #3767 from rtibbles/determined_by_resource
marcellamaki Oct 24, 2022
0cb9091
Merge pull request #3768 from rtibbles/very_cross_about_the_origin
rtibbles Oct 25, 2022
dcf9422
Find unapplied changes and ensure we get updates from the backend abo…
rtibbles Oct 25, 2022
f29a11e
Don't reverse unAppliedChanges to ensure we get the earliest unapplie…
rtibbles Oct 25, 2022
4135adf
Merge pull request #3771 from rtibbles/not_applicable
marcellamaki Oct 25, 2022
b61e1d3
Update h5p and html model and threshold conditions
marcellamaki Oct 24, 2022
3ab75ec
Update max rev tracking to only look at client generated events.
rtibbles Oct 26, 2022
17467dd
Use visibility API to better detect when a user returns to a tab.
rtibbles Oct 26, 2022
d6519c4
Filter out server generated events in server side max rev calculations.
rtibbles Oct 26, 2022
f9c31aa
Updates to completion duration criteria to ensure data persistence. D…
marcellamaki Oct 27, 2022
29de82b
Remove required duration from exercises. Fix display of practice quizzes
marcellamaki Oct 27, 2022
61d2ea7
Update tests
marcellamaki Oct 27, 2022
0071088
Code cleanup and revert some (mistaken) changes
marcellamaki Oct 27, 2022
14c076d
Properly handle input from minutes, rather than setting default
marcellamaki Oct 27, 2022
4d45824
Merge pull request #3777 from marcellamaki/completion-duration-updates
rtibbles Oct 28, 2022
60f1528
Disable bulk editing of all new metadata types.
rtibbles Oct 28, 2022
12f4ff3
Do early return so we don't try to generate a thumbnail when we cannot.
rtibbles Oct 28, 2022
b8eb534
Merge pull request #3776 from rtibbles/one_less
marcellamaki Oct 28, 2022
e1a6e49
Ensure value for exact time duration is returned when duration dropdo…
marcellamaki Oct 28, 2022
a50d70a
Change completion criteria validation to ensure proper model for kind.
rtibbles Oct 28, 2022
7d6ef41
Still run full completion criteria validation when node is marked as …
rtibbles Oct 28, 2022
c2f957a
Harmonize frontend and backend sentry integrations.
rtibbles Oct 28, 2022
afc08b1
Update serializer tests to test complete contentnode serializer.
rtibbles Oct 29, 2022
afa6d24
Merge pull request #3780 from rtibbles/epubthumbnail
marcellamaki Oct 31, 2022
a986d25
Merge pull request #3782 from rtibbles/sentry
rtibbles Oct 31, 2022
5f30ee8
Fixes for completion criteria.
rtibbles Nov 1, 2022
302e361
Fix learner_managed getter.
rtibbles Nov 1, 2022
2293b7f
Set threshold for audio video types.
rtibbles Nov 1, 2022
111d4e3
Updates from review to reduce extraneous whitespace.
rtibbles Nov 1, 2022
e3a3b09
Always set mastery model for practice quizzes to do all.
rtibbles Nov 1, 2022
8c9b20f
Final completion criteria validation updates
marcellamaki Nov 1, 2022
cee4776
Merge pull request #3779 from rtibbles/learning_activity_bulk_edit
rtibbles Nov 1, 2022
897853f
Update gherkin scenarios
marcellamaki Nov 1, 2022
5447b69
Remove stray log
marcellamaki Nov 2, 2022
7dc7888
Move mark complete string into completion options.
rtibbles Nov 2, 2022
6923350
Clean up practice quiz helper function.
rtibbles Nov 2, 2022
783f9ff
Merge pull request #3781 from marcellamaki/more-completion-duration-u…
rtibbles Nov 2, 2022
985e9dd
Reverse changes to max rev logic.
rtibbles Nov 2, 2022
021dbb9
Make fetch blocking more targeted to allow fetches to happen while ot…
rtibbles Nov 2, 2022
3b0deaf
Exclude fetches when the parent has an unapplied tree affecting change.
rtibbles Nov 3, 2022
a3867b0
Merge pull request #3789 from rtibbles/copy_never_succeeds
rtibbles Nov 3, 2022
9df874e
Ensure info logs get sent to stdout
bjester Nov 4, 2022
1623098
Merge pull request #3796 from bjester/logging-stdout
marcellamaki Nov 4, 2022
5e44318
Do defaulting better to allow falsey values.
rtibbles Nov 7, 2022
72acf9e
Merge pull request #3801 from rtibbles/default_properly
marcellamaki Nov 7, 2022
a4ab06e
Use uniqBy and isEqual to do a deep comparison for uniqueifying compl…
rtibbles Nov 4, 2022
ace8bac
Flag non-unique value at the whole value level.
rtibbles Nov 4, 2022
b6d632f
Merge pull request #3798 from rtibbles/bulk_completion_criteria
marcellamaki Nov 7, 2022
509f98c
Prevents edge case where node extra fields could get modified during …
rtibbles Nov 9, 2022
f47e6ab
Merge pull request #3804 from rtibbles/no_modify_publish
rtibbles Nov 9, 2022
6d91350
Merge pull request #3658 from learningequality/hotfixes
bjester Nov 9, 2022
c0584b3
Prevent empty strings and nulls from populating detail lists
bjester Nov 10, 2022
b59d0d5
Require a defined array of items
bjester Nov 10, 2022
08c987d
Check that channel_id exists before calling method
bjester Nov 10, 2022
c686fff
Check map exists before delete
bjester Nov 10, 2022
6594f30
Prevent rendering until loaded
bjester Nov 10, 2022
cfe5c65
Better defaulting to empty lists
bjester Nov 10, 2022
08088cc
Add extra context to change application error reporting.
rtibbles Nov 10, 2022
372e8e7
Upgrade sentry-vue to latest.
rtibbles Nov 10, 2022
c4d36c9
Destroy mounted wrapper causing async failures outside of test suite
bjester Nov 10, 2022
59c689f
Merge pull request #3809 from bjester/defensive-defense
bjester Nov 10, 2022
8398d72
Merge pull request #3810 from rtibbles/sentry
rtibbles Nov 10, 2022
4e120ad
Merge branch 'master' into hotfixes
bjester Nov 10, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 48 additions & 13 deletions contentcuration/contentcuration/constants/completion_criteria.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,53 @@ def _build_validator():
validator = _build_validator()


ALLOWED_MODELS_PER_KIND = {
content_kinds.DOCUMENT: {
completion_criteria.PAGES,
completion_criteria.TIME,
completion_criteria.APPROX_TIME,
completion_criteria.REFERENCE,
},
content_kinds.EXERCISE: {completion_criteria.MASTERY},
content_kinds.HTML5: {
completion_criteria.DETERMINED_BY_RESOURCE,
completion_criteria.TIME,
completion_criteria.APPROX_TIME,
completion_criteria.REFERENCE,
},
content_kinds.H5P: {
completion_criteria.DETERMINED_BY_RESOURCE,
completion_criteria.TIME,
completion_criteria.APPROX_TIME,
completion_criteria.REFERENCE,
},
content_kinds.AUDIO: {
completion_criteria.TIME,
completion_criteria.APPROX_TIME,
completion_criteria.REFERENCE,
},
content_kinds.VIDEO: {
completion_criteria.TIME,
completion_criteria.APPROX_TIME,
completion_criteria.REFERENCE,
},
}


def check_model_for_kind(data, kind):
model = data.get("model")
if kind is None or model is None or kind not in ALLOWED_MODELS_PER_KIND:
return

# validate that content kind is allowed for the completion criteria model
if model not in ALLOWED_MODELS_PER_KIND[kind]:
raise ValidationError(
"Completion criteria model '{}' is invalid for content kind '{}'".format(
model, kind
)
)


def validate(data, kind=None):
"""
:param data: Dictionary of data to validate
Expand Down Expand Up @@ -49,16 +96,4 @@ def validate(data, kind=None):
e.error_list.extend(error_descriptions)
raise e

model = data.get("model")
if kind is None or model is None:
return

# validate that content kind is allowed for the completion criteria model
if (model == completion_criteria.PAGES and kind != content_kinds.DOCUMENT) or (
model == completion_criteria.MASTERY and kind != content_kinds.EXERCISE
):
raise ValidationError(
"Completion criteria model '{}' is invalid for content kind '{}'".format(
model, kind
)
)
check_model_for_kind(data, kind)
4 changes: 4 additions & 0 deletions contentcuration/contentcuration/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ def site_variables(request):
"DEBUG": settings.DEBUG,
"LANG_INFO": json_for_parse_from_data(language_globals()),
"LOGGED_IN": not request.user.is_anonymous,
"SENTRY_DSN": settings.SENTRY_DSN,
"SENTRY_ENVIRONMENT": settings.SENTRY_ENVIRONMENT,
"SENTRY_RELEASE": settings.SENTRY_RELEASE,
"SENTRY_ACTIVE": settings.SENTRY_ACTIVE,
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,21 @@ function selectNode(wrapper) {
}

describe('CurrentTopicView', () => {
let wrapper;

afterEach(() => {
wrapper && wrapper.destroy();
});

it('smoke test', () => {
const store = storeFactory(STORE_CONFIG);
const wrapper = makeWrapper({ store });
wrapper = makeWrapper({ store });

expect(wrapper.isVueInstance()).toBe(true);
});

describe('for a topic with nodes', () => {
let store, wrapper;
let store;

beforeEach(() => {
global.CHANNEL_EDIT_GLOBAL.channel_id = CHANNEL.id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
:items="availableNumbers"
:menu-props="menuProps"
:attach="attach"
:rules="minutesRules"
/>
</template>
</DropdownWrapper>
Expand Down Expand Up @@ -102,10 +103,7 @@
if (this.audioVideoUpload) {
return false;
}
return (
this.selectedDuration !== DurationDropdownMap.EXACT_TIME &&
this.selectedCompletion === CompletionDropdownMap.completeDuration
);
return this.selectedCompletion === CompletionDropdownMap.completeDuration;
},
showOptionalLabel() {
return this.selectedDuration !== DurationDropdownMap.EXACT_TIME;
Expand Down Expand Up @@ -153,8 +151,13 @@
return getShortActivityDurationValidators().map(translateValidator);
} else if (this.selectedDuration === DurationDropdownMap.LONG_ACTIVITY) {
return getLongActivityDurationValidators().map(translateValidator);
} else if (
this.selectedDuration === DurationDropdownMap.EXACT_TIME &&
this.selectedCompletion === CompletionDropdownMap.completeDuration
) {
return getActivityDurationValidators().map(translateValidator);
}
return getActivityDurationValidators().map(translateValidator);
return [];
},
},
created() {
Expand Down
Loading