Skip to content

Commit

Permalink
Rename PretestEngineService to QuestionPlayerEngineService (oppia#6913)
Browse files Browse the repository at this point in the history
* Rename PretestEngineService

* Fixed linting errors

* Fixed linting errors

* Fixed linting errors

* Revert package-lock.json
  • Loading branch information
sophiewu6 authored and aks681 committed Jun 16, 2019
1 parent a156118 commit 46ae61e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ require(
'player-correctness-feedback-enabled.service.ts');
require('pages/exploration-player-page/services/player-position.service.ts');
require('pages/exploration-player-page/services/player-transcript.service.ts');
require('pages/exploration-player-page/services/pretest-engine.service.ts');
require(
'pages/exploration-player-page/services/question-player-engine.service.ts');
require(
'pages/exploration-player-page/services/' +
'refresher-exploration-confirmation-modal.service.ts');
Expand Down Expand Up @@ -343,7 +344,7 @@ oppia.directive('conversationSkin', [
'AudioTranslationManagerService', 'EVENT_AUTOPLAY_AUDIO',
'COMPONENT_NAME_FEEDBACK', 'AutogeneratedAudioPlayerService',
'StateClassifierMappingService', 'ImagePreloaderService',
'PlaythroughService', 'PretestEngineService',
'PlaythroughService', 'QuestionPlayerEngineService',
'WHITELISTED_COLLECTION_IDS_FOR_SAVING_GUEST_PROGRESS',
'ExplorationPlayerStateService', 'INTERACTION_DISPLAY_MODE_INLINE',
'CurrentInteractionService', 'UserService',
Expand All @@ -370,7 +371,7 @@ oppia.directive('conversationSkin', [
AudioTranslationManagerService, EVENT_AUTOPLAY_AUDIO,
COMPONENT_NAME_FEEDBACK, AutogeneratedAudioPlayerService,
StateClassifierMappingService, ImagePreloaderService,
PlaythroughService, PretestEngineService,
PlaythroughService, QuestionPlayerEngineService,
WHITELISTED_COLLECTION_IDS_FOR_SAVING_GUEST_PROGRESS,
ExplorationPlayerStateService, INTERACTION_DISPLAY_MODE_INLINE,
CurrentInteractionService, UserService) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ require('pages/exploration-player-page/services/exploration-engine.service.ts');
require('pages/exploration-player-page/services/number-attempts.service.ts');
require('pages/exploration-player-page/services/player-position.service.ts');
require('pages/exploration-player-page/services/player-transcript.service.ts');
require('pages/exploration-player-page/services/pretest-engine.service.ts');
require(
'pages/exploration-player-page/services/question-player-engine.service.ts');
require(
'pages/exploration-player-page/services/state-classifier-mapping.service.ts');
require('pages/exploration-player-page/services/stats-reporting.service.ts');
Expand All @@ -51,21 +52,21 @@ oppia.factory('ExplorationPlayerStateService', [
'ExplorationFeaturesService', 'NumberAttemptsService',
'PlayerCorrectnessFeedbackEnabledService', 'PlayerPositionService',
'PlayerTranscriptService', 'PlaythroughIssuesService', 'PlaythroughService',
'PretestEngineService', 'PretestQuestionBackendApiService',
'QuestionPlayerBackendApiService',
'ReadOnlyExplorationBackendApiService', 'StateClassifierMappingService',
'StatsReportingService', 'UrlService', 'EXPLORATION_MODE',
'PretestQuestionBackendApiService', 'QuestionPlayerBackendApiService',
'QuestionPlayerEngineService', 'ReadOnlyExplorationBackendApiService',
'StateClassifierMappingService', 'StatsReportingService',
'UrlService', 'EXPLORATION_MODE',
function(
$log, $q, $rootScope, ContextService,
EditableExplorationBackendApiService,
ExplorationEngineService, ExplorationFeaturesBackendApiService,
ExplorationFeaturesService, NumberAttemptsService,
PlayerCorrectnessFeedbackEnabledService, PlayerPositionService,
PlayerTranscriptService, PlaythroughIssuesService, PlaythroughService,
PretestEngineService, PretestQuestionBackendApiService,
QuestionPlayerBackendApiService,
ReadOnlyExplorationBackendApiService, StateClassifierMappingService,
StatsReportingService, UrlService, EXPLORATION_MODE) {
PretestQuestionBackendApiService, QuestionPlayerBackendApiService,
QuestionPlayerEngineService, ReadOnlyExplorationBackendApiService,
StateClassifierMappingService, StatsReportingService,
UrlService, EXPLORATION_MODE) {
var currentEngineService = null;
var explorationMode = EXPLORATION_MODE.OTHER;
var editorPreviewMode = ContextService.isInExplorationEditorPage();
Expand Down Expand Up @@ -93,12 +94,12 @@ oppia.factory('ExplorationPlayerStateService', [

var initializePretestServices = function(pretestQuestionDicts, callback) {
PlayerCorrectnessFeedbackEnabledService.init(true);
PretestEngineService.init(pretestQuestionDicts, callback);
QuestionPlayerEngineService.init(pretestQuestionDicts, callback);
};

var initializeQuestionPlayerServices = function(questionDicts, callback) {
PlayerCorrectnessFeedbackEnabledService.init(true);
PretestEngineService.init(questionDicts, callback);
QuestionPlayerEngineService.init(questionDicts, callback);
};

var setExplorationMode = function() {
Expand All @@ -108,12 +109,12 @@ oppia.factory('ExplorationPlayerStateService', [

var setPretestMode = function() {
explorationMode = EXPLORATION_MODE.PRETEST;
currentEngineService = PretestEngineService;
currentEngineService = QuestionPlayerEngineService;
};

var setQuestionPlayerMode = function() {
explorationMode = EXPLORATION_MODE.QUESTION_PLAYER;
currentEngineService = PretestEngineService;
currentEngineService = QuestionPlayerEngineService;
};

var initExplorationPreviewPlayer = function(callback) {
Expand Down Expand Up @@ -200,7 +201,7 @@ oppia.factory('ExplorationPlayerStateService', [
return explorationMode === EXPLORATION_MODE.QUESTION_PLAYER;
},
getPretestQuestionCount: function() {
return PretestEngineService.getPretestQuestionCount();
return QuestionPlayerEngineService.getPretestQuestionCount();
},
moveToExploration: function(callback) {
setExplorationMode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ require('services/stateful/FocusManagerService.ts');

oppia.constant('INTERACTION_SPECS', GLOBALS.INTERACTION_SPECS);

oppia.factory('PretestEngineService', [
oppia.factory('QuestionPlayerEngineService', [
'$http', '$q', '$rootScope', 'AlertsService', 'AnswerClassificationService',
'ContextService', 'ExplorationHtmlFormatterService',
'ExpressionInterpolationService', 'FocusManagerService',
Expand Down
2 changes: 1 addition & 1 deletion extensions/classifiers/WinnowingPreprocessingService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ oppia.factory('WinnowingPreprocessingService', [function() {
}

var fingerprint = [];
fingerprintHashesIndex.forEach(function(hashIndex) {
fingerprintHashesIndex.forEach(function(hashIndex: number) {
fingerprint.push([kGramHashes[hashIndex], hashIndex]);
});

Expand Down

0 comments on commit 46ae61e

Please sign in to comment.