Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove voiceover from exp schema #20675

Closed
wants to merge 40 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f003882
Adds conversions function for exploration migration.
Nik-09 Apr 19, 2024
71a0266
Removes recorded voiceover fields from exploration states backend
Nik-09 Apr 22, 2024
d000747
Merge branch 'develop' of https://github.com/oppia/oppia into remove_…
Nik-09 Jun 8, 2024
68b14ad
Merge branch 'develop' of https://github.com/oppia/oppia into remove_…
Nik-09 Jun 9, 2024
a930682
Fixes merge conflict
Nik-09 Jul 8, 2024
17f95f4
Removed recorded voiceover from exploration
Nik-09 Jul 9, 2024
d9e5a91
Removes feature flag
Nik-09 Jul 9, 2024
2214f8b
Removes voice artist models and UI
Nik-09 Jul 10, 2024
7f21430
Removes audio translation service files and uses.
Nik-09 Jul 14, 2024
d62e948
Fixes merge conflict
Nik-09 Jul 15, 2024
e7a8ac4
Fixes backend tests
Nik-09 Jul 15, 2024
16eacbc
Fixes backend tests
Nik-09 Jul 15, 2024
9fb7eca
Merge branch 'develop' of https://github.com/oppia/oppia into remove_…
Nik-09 Jul 16, 2024
49380f3
Fixes frontend tests
Nik-09 Jul 21, 2024
439c490
Fixes merge conflict and frontend test
Nik-09 Jul 29, 2024
79c333b
Fixes frontend tests
Nik-09 Jul 29, 2024
7de0993
Fixes frontend tests
Nik-09 Aug 1, 2024
a348168
Merge branch 'develop' of https://github.com/oppia/oppia into remove_…
Nik-09 Aug 1, 2024
827700f
Fixes lint issues
Nik-09 Aug 1, 2024
789cb77
Fixes lint issues
Nik-09 Aug 3, 2024
7519f17
Merge branch 'develop' of https://github.com/oppia/oppia into remove_…
Nik-09 Aug 3, 2024
77ce7d1
Fixes merge conflict
Nik-09 Aug 7, 2024
23661e3
Fixes typescript checks
Nik-09 Aug 8, 2024
ff67301
Fixes merge conflict
Nik-09 Aug 18, 2024
4acb589
Merge branch 'develop' of https://github.com/oppia/oppia into remove_…
Nik-09 Sep 4, 2024
8072d16
Merge branch 'develop' of https://github.com/oppia/oppia into remove_…
Nik-09 Sep 21, 2024
3ea710d
Fixes frontend tests
Nik-09 Sep 23, 2024
a06d486
Fixes merge conflicts
Nik-09 Sep 30, 2024
c8a2218
Merge branch 'develop' of https://github.com/oppia/oppia into remove_…
Nik-09 Oct 7, 2024
7f34239
Fixes merge conflict
Nik-09 Oct 30, 2024
11942df
Merge branch 'develop' of https://github.com/oppia/oppia into remove_…
Nik-09 Nov 2, 2024
e89e16c
Fixes frontend tests
Nik-09 Nov 7, 2024
a8ab730
Fixes merge conflict
Nik-09 Nov 11, 2024
fc155ba
Reverts unnecessary changes.
Nik-09 Nov 24, 2024
bd34115
Merge branch 'develop' of https://github.com/oppia/oppia into remove_…
Nik-09 Nov 24, 2024
95d39fa
Merge branch 'develop' of https://github.com/oppia/oppia into remove_…
Nik-09 Dec 1, 2024
c49c609
Fixes backend and lint checks
Nik-09 Dec 1, 2024
a87e250
Fixes merge conflict
Nik-09 Dec 10, 2024
446684c
Merge branch 'develop' into remove_voiceover_from_exp_schema
seanlip Dec 12, 2024
52a7e17
Fixes merge conflict
Nik-09 Jan 9, 2025
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
Prev Previous commit
Next Next commit
Fixes lint issues
  • Loading branch information
Nik-09 committed Aug 1, 2024
commit 827700f1e817842ec47137f0b8cfdcaadd6c9606
1 change: 0 additions & 1 deletion core/controllers/voiceover_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

from core import feconf
from core.domain import state_domain
from core.domain import user_services
from core.domain import voiceover_domain
from core.domain import voiceover_services
from core.tests import test_utils
Expand Down
2 changes: 0 additions & 2 deletions core/domain/exp_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import zipfile

from core import android_validation_constants
from core import feature_flag_list
from core import feconf
from core import utils
from core.constants import constants
Expand All @@ -48,7 +47,6 @@
from core.domain import email_subscription_services
from core.domain import exp_domain
from core.domain import exp_fetchers
from core.domain import feature_flag_services
from core.domain import feedback_services
from core.domain import fs_services
from core.domain import html_cleaner
Expand Down
1 change: 0 additions & 1 deletion core/domain/exp_services_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import re
import zipfile

from core import feature_flag_list
from core import feconf
from core import utils
from core.constants import constants
Expand Down
10 changes: 0 additions & 10 deletions core/domain/state_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -3863,7 +3863,6 @@ def update_content(self, content: SubtitledHtml) -> None:
Args:
content: SubtitledHtml. Representation of updated content.
"""
old_content_id = self.content.content_id
# TODO(sll): Must sanitize all content in RTE component attrs.
self.content = content

Expand Down Expand Up @@ -3948,10 +3947,6 @@ def update_interaction_customization_args(
for ca_name in customization_args:
customization_args[ca_name].validate_subtitled_html()

old_content_id_list = list(itertools.chain.from_iterable([
self.interaction.customization_args[ca_name].get_content_ids()
for ca_name in self.interaction.customization_args]))

self.interaction.customization_args = customization_args
new_content_id_list = list(itertools.chain.from_iterable([
self.interaction.customization_args[ca_name].get_content_ids()
Expand Down Expand Up @@ -4106,13 +4101,8 @@ def update_interaction_hints(self, hints_list: List[Hint]) -> None:
raise Exception(
'Expected hints_list to be a list, received %s'
% hints_list)
old_content_id_list = [
hint.hint_content.content_id for hint in self.interaction.hints]
self.interaction.hints = copy.deepcopy(hints_list)

new_content_id_list = [
hint.hint_content.content_id for hint in self.interaction.hints]

def update_interaction_solution(
self, solution: Optional[Solution]
) -> None:
Expand Down
10 changes: 0 additions & 10 deletions core/domain/takeout_service_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,11 +967,6 @@ def set_up_non_trivial(self) -> None:
parent_user_id=self.PROFILE_ID_1
).put()

language_code_to_accent: Dict[str, str] = {
'en': 'en-US',
'hi': 'hi-IN'
}

# Set-up for AppFeedbackReportModel scrubbed by user.
report_id = '%s.%s.%s' % (
self.PLATFORM_ANDROID, self.REPORT_SUBMITTED_TIMESTAMP.second,
Expand Down Expand Up @@ -1232,7 +1227,6 @@ def test_export_data_for_full_user_trivial_is_correct(self) -> None:
expected_blog_author_details: Dict[str, Dict[str, str]] = {}
expected_learner_group_model_data: Dict[str, str] = {}
expected_learner_grp_user_model_data: Dict[str, str] = {}
expected_voice_artist_data: Dict[str, str] = {}

# Here we use type Any because this dictionary contains other
# different types of dictionaries whose values can vary from int
Expand Down Expand Up @@ -2107,10 +2101,6 @@ def test_export_data_for_full_user_nontrivial_is_correct(self) -> None:
expected_translation_coordinator_stats_data = {
'coordinated_language_ids': ['es', 'hi']
}
expected_language_code_to_accent: Dict[str, str] = {
'en': 'en-US',
'hi': 'hi-IN'
}
expected_user_data = {
'user_stats': expected_stats_data,
'user_group': expected_user_group_data,
Expand Down
6 changes: 1 addition & 5 deletions core/domain/voiceover_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,17 @@

from __future__ import annotations

import collections
import json
import os

from core import feature_flag_list
from core import feconf
from core import utils
from core.domain import exp_domain
from core.domain import feature_flag_services
from core.domain import state_domain
from core.domain import user_services
from core.domain import voiceover_domain
from core.platform import models

from typing import Dict, List, Sequence, cast
from typing import Dict, List, cast

MYPY = False
if MYPY: # pragma: no cover
Expand Down
5 changes: 0 additions & 5 deletions core/domain/voiceover_services_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,11 @@
import json
import os

from core import feature_flag_list
from core import feconf
from core import schema_utils
from core import utils
from core.domain import exp_domain
from core.domain import exp_fetchers
from core.domain import exp_services
from core.domain import feature_flag_services
from core.domain import state_domain
from core.domain import user_services
from core.domain import voiceover_domain
from core.domain import voiceover_services
from core.platform import models
Expand Down
2 changes: 0 additions & 2 deletions core/storage/voiceover/gae_models_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
from core.platform import models
from core.tests import test_utils

from typing import Dict

MYPY = False
if MYPY: # pragma: no cover
# Here, 'state_domain' is imported only for type checking.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import {
StateObjectsBackendDict,
States,
StatesObjectFactory,
VoiceoverObjectsDict,
} from 'domain/exploration/StatesObjectFactory';
import {UrlInterpolationService} from 'domain/utilities/url-interpolation.service';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import {
StateBackendDict,
StateObjectFactory,
} from 'domain/state/StateObjectFactory';
import {Voiceover} from 'domain/exploration/voiceover.model';
import {InteractionObjectFactory} from 'domain/exploration/InteractionObjectFactory';
import {LoggerService} from 'services/contextual/logger.service';
import {SubtitledUnicode} from 'domain/exploration/SubtitledUnicodeObjectFactory';
Expand Down
16 changes: 1 addition & 15 deletions core/templates/domain/question/question-update.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {QuestionDomainConstants} from 'domain/question/question-domain.constants
import cloneDeep from 'lodash/cloneDeep';
import {Injectable} from '@angular/core';
import {downgradeInjectable} from '@angular/upgrade/static';
import {State, StateBackendDict} from 'domain/state/StateObjectFactory';
import {StateBackendDict} from 'domain/state/StateObjectFactory';
import {Question} from './QuestionObjectFactory';

interface ApplyParams {
Expand Down Expand Up @@ -110,19 +110,6 @@ export class QuestionUpdateService {
return diffList;
}

_updateContentIdsInAssets(newState: State, oldState: State): void {
let newContentIds = new Set(newState.getAllContentIds());
let oldContentIds = new Set(oldState.getAllContentIds());
let contentIdsToDelete = this._getElementsInFirstSetButNotInSecond(
oldContentIds,
newContentIds
);
let contentIdsToAdd = this._getElementsInFirstSetButNotInSecond(
newContentIds,
oldContentIds
);
}

setQuestionLanguageCode(question: Question, newLanguageCode: string): void {
let oldLanguageCode = cloneDeep(question.getLanguageCode());
this._applyPropertyChange(
Expand Down Expand Up @@ -202,7 +189,6 @@ export class QuestionUpdateService {
// for creating the change to send to the backend.
updateFunction();
let newStateData = question.getStateData();
this._updateContentIdsInAssets(newStateData, oldStateData);
this._applyPropertyChange(
question,
QuestionDomainConstants.QUESTION_PROPERTY_QUESTION_STATE_DATA,
Expand Down
4 changes: 0 additions & 4 deletions core/templates/domain/state/StateObjectFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ import {
ParamChange,
} from 'domain/exploration/ParamChangeObjectFactory';
import {ParamChangesObjectFactory} from 'domain/exploration/ParamChangesObjectFactory';
import {
RecordedVoiceOverBackendDict,
RecordedVoiceovers,
} from 'domain/exploration/recorded-voiceovers.model';
import {
SubtitledHtmlBackendDict,
SubtitledHtml,
Expand Down
2 changes: 0 additions & 2 deletions core/templates/domain/state_card/state-card.model.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ import {
} from 'domain/exploration/InteractionObjectFactory';
import {StateCard} from 'domain/state_card/state-card.model';
import {SubtitledUnicode} from 'domain/exploration/SubtitledUnicodeObjectFactory';
import {RecordedVoiceovers} from 'domain/exploration/recorded-voiceovers.model';
import {Voiceover} from 'domain/exploration/voiceover.model';
import {InteractionCustomizationArgs} from 'interactions/customization-args-defs';
import {Hint} from 'domain/exploration/hint-object.model';
import {SolutionObjectFactory} from 'domain/exploration/SolutionObjectFactory';
Expand Down
4 changes: 0 additions & 4 deletions core/templates/domain/state_card/state-card.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ import cloneDeep from 'lodash/cloneDeep';
import {AppConstants} from 'app.constants';
import {AudioTranslationLanguageService} from 'pages/exploration-player-page/services/audio-translation-language.service';
import {Interaction} from 'domain/exploration/InteractionObjectFactory';
import {
BindableVoiceovers,
RecordedVoiceovers,
} from 'domain/exploration/recorded-voiceovers.model';
import {InteractionCustomizationArgs} from 'interactions/customization-args-defs';
import {Hint} from 'domain/exploration/hint-object.model';
import {Solution} from 'domain/exploration/SolutionObjectFactory';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ import {
Outcome,
OutcomeBackendDict,
} from 'domain/exploration/OutcomeObjectFactory';
import {
RecordedVoiceOverBackendDict,
RecordedVoiceovers,
} from 'domain/exploration/recorded-voiceovers.model';
import {LostChange} from 'domain/exploration/LostChangeObjectFactory';
import {BaseTranslatableObject} from 'domain/objects/BaseTranslatableObject.model';
import {TranslatedContent} from 'domain/exploration/TranslatedContentObjectFactory';
Expand All @@ -70,7 +66,6 @@ export type StatePropertyValues =
| InteractionCustomizationArgs
| Outcome
| ParamChange[]
| RecordedVoiceovers
| string
| SubtitledHtml
| BaseTranslatableObject;
Expand All @@ -81,7 +76,6 @@ export type StatePropertyDictValues =
| InteractionCustomizationArgsBackendDict
| OutcomeBackendDict
| ParamChangeBackendDict[]
| RecordedVoiceOverBackendDict
| string
| SubtitledHtmlBackendDict;
export type StatePropertyNames =
Expand All @@ -94,7 +88,6 @@ export type StatePropertyNames =
| 'linked_skill_id'
| 'param_changes'
| 'param_specs'
| 'recorded_voiceovers'
| 'solicit_answer_details'
| 'solution'
| 'state_name'
Expand Down Expand Up @@ -135,7 +128,6 @@ export class ChangeListService {
answer_groups: true,
confirmed_unclassified_answers: true,
content: true,
recorded_voiceovers: true,
default_outcome: true,
hints: true,
linked_skill_id: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,24 +292,10 @@ export class ExplorationStatesService {

markTranslationAndVoiceoverNeedsUpdate(contentId: string): void {
this.changeListService.markTranslationsAsNeedingUpdate(contentId);
let stateName = this.stateEditorService.getActiveStateName();
let state = this.getState(stateName);
// let recordedVoiceovers = state.recordedVoiceovers;
// if (recordedVoiceovers.hasUnflaggedVoiceovers(contentId)) {
// recordedVoiceovers.markAllVoiceoversAsNeedingUpdate(contentId);
// this.saveRecordedVoiceovers(stateName, recordedVoiceovers);
// }
}

removeTranslationAndVoiceover(contentId: string): void {
this.changeListService.removeTranslations(contentId);
let stateName = this.stateEditorService.getActiveStateName();
let state = this.getState(stateName);
// let recordedVoiceovers = state.recordedVoiceovers;
// if (recordedVoiceovers.hasVoiceovers(contentId)) {
// recordedVoiceovers.voiceoversMapping[contentId] = {};
// this.saveRecordedVoiceovers(stateName, recordedVoiceovers);
// }
this.entityTranslationsService.removeAllTranslationsForContent(contentId);
}

Expand Down Expand Up @@ -453,11 +439,6 @@ export class ExplorationStatesService {
backendName: 'solution',
newValue: SubtitledHtml
): void;
saveStateProperty(
stateName: string,
backendName: 'recorded_voiceovers',
newValue: RecordedVoiceovers
): void;
saveStateProperty(
stateName: string,
backendName: 'solicit_answer_details',
Expand Down Expand Up @@ -506,18 +487,6 @@ export class ExplorationStatesService {
this._verifyChangesInitialContents(backendName, newValue);
}

if (this._CONTENT_EXTRACTORS.hasOwnProperty(backendName)) {
let oldContentIds = this._extractContentIds(backendName, oldValue);
let newContentIds = this._extractContentIds(backendName, newValue);
let contentIdsToDelete = this._getElementsInFirstSetButNotInSecond(
oldContentIds,
newContentIds
);
let contentIdsToAdd = this._getElementsInFirstSetButNotInSecond(
newContentIds,
oldContentIds
);
}
let propertyRef = newStateData;
for (let i = 0; i < accessorList.length - 1; i++) {
propertyRef = propertyRef[accessorList[i]];
Expand Down Expand Up @@ -583,7 +552,7 @@ export class ExplorationStatesService {
return cloneDeep(this._states);
}

getAllContentIdsByStateName(stateName: string) {
getAllContentIdsByStateName(stateName: string): string[] {
let allContentIds = this._states.getState(stateName).getAllContentIds();
return allContentIds.filter(contentId => contentId !== undefined);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,6 @@ describe('Translation status service', () => {
let entityVoiceovers = EntityVoiceovers.createFromBackendDict(
entityVoiceoversBackendDict
);
console.log('Before syp');
console.log(entityVoiceovers);

ttams.activateVoiceoverMode();
var statesNeedingAudioUpdate = tss.getAllStatesNeedUpdatewarning();
Expand Down Expand Up @@ -569,7 +567,7 @@ describe('Translation status service', () => {

expect(activeStateComponentStatus).toBe(FEW_ASSETS_AVAILABLE_COLOR);

entityVoiceovers.voiceoversMapping['content_0'] = {
entityVoiceovers.voiceoversMapping.content_0 = {
manual: manualVoiceover2,
};
entityVoiceoversService.addEntityVoiceovers(entityVoiceovers);
Expand All @@ -591,7 +589,7 @@ describe('Translation status service', () => {
expect(activeStateComponentStatus).toBe(NO_ASSETS_AVAILABLE_COLOR);
ses.activeStateName = 'Third';

entityVoiceovers.voiceoversMapping['content_8'] = {
entityVoiceovers.voiceoversMapping.content_8 = {
manual: manualVoiceover2,
};
entityVoiceoversService.addEntityVoiceovers(entityVoiceovers);
Expand Down Expand Up @@ -720,7 +718,7 @@ describe('Translation status service', () => {
tss.getActiveStateContentIdStatusColor('feedback_3');
expect(activeStateContentIdStatusColor).toBe(ALL_ASSETS_AVAILABLE_COLOR);

entityVoiceovers.voiceoversMapping['content_0'] = {
entityVoiceovers.voiceoversMapping.content_0 = {
manual: manualVoiceover2,
};
entityVoiceoversService.addEntityVoiceovers(entityVoiceovers);
Expand All @@ -738,7 +736,7 @@ describe('Translation status service', () => {
expect(activeStateContentIdStatusColor).toBe(NO_ASSETS_AVAILABLE_COLOR);

ses.activeStateName = 'Third';
entityVoiceovers.voiceoversMapping['content_8'] = {
entityVoiceovers.voiceoversMapping.content_8 = {
manual: manualVoiceover3,
};
entityVoiceoversService.addEntityVoiceovers(entityVoiceovers);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ export class StateTranslationStatusGraphComponent {
let stateData = this.explorationStatesService.getState(stateName);

if (stateName && stateData) {
// this.stateRecordedVoiceoversService.init(
// stateName,
// stateData.recordedVoiceovers
// );
this.stateEditorService.onRefreshStateTranslation.emit();
}
this.routerService.onCenterGraph.emit();
Expand Down
Loading