diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 60803704b150..5bc2a569ce2c 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -231,7 +231,7 @@ /core/templates/dev/head/domain/statistics/ @brianrodri /core/templates/dev/head/pages/exploration-editor-page/improvements-tab/ @brianrodri /core/templates/dev/head/pages/exploration-editor-page/statistics-tab/ @brianrodri -/core/templates/dev/head/services/ImprovementCardService*.ts @brianrodri +/core/templates/dev/head/services/ImprovementTaskService*.ts @brianrodri /core/templates/dev/head/services/ImprovementsService*.ts @brianrodri /core/templates/dev/head/services/MessengerService.ts @brianrodri /core/templates/dev/head/services/Playthrough*.ts @brianrodri diff --git a/core/templates/dev/head/css/oppia.css b/core/templates/dev/head/css/oppia.css index 9e0b0af2bc23..76e580f3bdd6 100644 --- a/core/templates/dev/head/css/oppia.css +++ b/core/templates/dev/head/css/oppia.css @@ -2986,7 +2986,7 @@ md-card.preview-conversation-skin-supplemental-card { padding: 0; } -.oppia-improvement-card { +.oppia-improvement-task { background-color: #fff; margin-bottom: 30px; margin-left: auto; @@ -2995,7 +2995,7 @@ md-card.preview-conversation-skin-supplemental-card { padding: 32px 32px 24px 32px; } -.oppia-improvement-closed-card { +.oppia-improvement-closed-task { background-color: #dadada; margin-bottom: 30px; margin-left: auto; @@ -3004,29 +3004,29 @@ md-card.preview-conversation-skin-supplemental-card { padding: 32px 32px 24px 32px; } -.oppia-improvement-card-header { +.oppia-improvement-task-header { padding: 0 0 24px 0; display: flex; } -.oppia-improvement-closed-card-header { +.oppia-improvement-closed-task-header { padding: 0; display: flex; } -.oppia-improvement-card-header-title { +.oppia-improvement-task-header-title { flex-grow: 1; padding: 0; padding-right: 32px; margin: 0; } -.oppia-improvement-card-header-status-pill { +.oppia-improvement-task-header-status-pill { flex-grow: 0; text-align: right; } -.oppia-improvement-card-footer { +.oppia-improvement-task-footer { padding: 24px 0 0 0; text-align: right; } diff --git a/core/templates/dev/head/domain/statistics/AnswerDetailsImprovementCardObjectFactory.ts b/core/templates/dev/head/domain/statistics/AnswerDetailsImprovementTaskObjectFactory.ts similarity index 77% rename from core/templates/dev/head/domain/statistics/AnswerDetailsImprovementCardObjectFactory.ts rename to core/templates/dev/head/domain/statistics/AnswerDetailsImprovementTaskObjectFactory.ts index 1c1f143bcc31..610c89839f2f 100644 --- a/core/templates/dev/head/domain/statistics/AnswerDetailsImprovementCardObjectFactory.ts +++ b/core/templates/dev/head/domain/statistics/AnswerDetailsImprovementTaskObjectFactory.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * @fileoverview Factory for creating Answer details Cards in the Improvements + * @fileoverview Factory for creating Answer details Tasks in the Improvements * Tab. */ @@ -26,15 +26,15 @@ require('pages/exploration-editor-page/services/' + require('domain/statistics/statistics-domain.constants.ajs.ts'); -angular.module('oppia').factory('AnswerDetailsImprovementCardObjectFactory', [ +angular.module('oppia').factory('AnswerDetailsImprovementTaskObjectFactory', [ 'ImprovementActionButtonObjectFactory', 'ImprovementModalService', - 'LearnerAnswerDetailsDataService', 'ANSWER_DETAILS_IMPROVEMENT_CARD_TYPE', + 'LearnerAnswerDetailsDataService', 'ANSWER_DETAILS_IMPROVEMENT_TASK_TYPE', 'STATUS_NOT_ACTIONABLE', 'STATUS_OPEN', function( ImprovementActionButtonObjectFactory, ImprovementModalService, - LearnerAnswerDetailsDataService, ANSWER_DETAILS_IMPROVEMENT_CARD_TYPE, + LearnerAnswerDetailsDataService, ANSWER_DETAILS_IMPROVEMENT_TASK_TYPE, STATUS_NOT_ACTIONABLE, STATUS_OPEN) { - var AnswerDetailsImprovementCard = function(learnerAnswerDetails) { + var AnswerDetailsImprovementTask = function(learnerAnswerDetails) { this._learnerAnswerDetails = learnerAnswerDetails; this._actionButtons = [ ImprovementActionButtonObjectFactory.createNew( @@ -45,37 +45,37 @@ angular.module('oppia').factory('AnswerDetailsImprovementCardObjectFactory', [ }; - AnswerDetailsImprovementCard.prototype.getStatus = function() { + AnswerDetailsImprovementTask.prototype.getStatus = function() { return this._learnerAnswerDetails.learnerAnswerInfoData.length !== 0 ? STATUS_OPEN : STATUS_NOT_ACTIONABLE; }; - AnswerDetailsImprovementCard.prototype.getDirectiveData = function() { + AnswerDetailsImprovementTask.prototype.getDirectiveData = function() { return this._learnerAnswerDetails; }; - AnswerDetailsImprovementCard.prototype.getDirectiveType = function() { - return ANSWER_DETAILS_IMPROVEMENT_CARD_TYPE; + AnswerDetailsImprovementTask.prototype.getDirectiveType = function() { + return ANSWER_DETAILS_IMPROVEMENT_TASK_TYPE; }; - AnswerDetailsImprovementCard.prototype.getActionButtons = function() { + AnswerDetailsImprovementTask.prototype.getActionButtons = function() { return this._actionButtons; }; - AnswerDetailsImprovementCard.prototype.getTitle = function() { + AnswerDetailsImprovementTask.prototype.getTitle = function() { return 'Answer details for the card "' + this._learnerAnswerDetails.stateName + '"'; }; - AnswerDetailsImprovementCard.prototype.isObsolete = function() { + AnswerDetailsImprovementTask.prototype.isObsolete = function() { return this._learnerAnswerDetails.learnerAnswerInfoData.length === 0; }; return { createNew: function(learnerAnswerDetails) { - return new AnswerDetailsImprovementCard(learnerAnswerDetails); + return new AnswerDetailsImprovementTask(learnerAnswerDetails); }, - fetchCards: function() { + fetchTasks: function() { var createNew = this.createNew; return ( LearnerAnswerDetailsDataService.fetchLearnerAnswerInfoData().then( diff --git a/core/templates/dev/head/domain/statistics/AnswerDetailsImprovementCardObjectFactorySpec.ts b/core/templates/dev/head/domain/statistics/AnswerDetailsImprovementTaskObjectFactorySpec.ts similarity index 84% rename from core/templates/dev/head/domain/statistics/AnswerDetailsImprovementCardObjectFactorySpec.ts rename to core/templates/dev/head/domain/statistics/AnswerDetailsImprovementTaskObjectFactorySpec.ts index 9b1b0f4d3d33..b9e1f8ea6eda 100644 --- a/core/templates/dev/head/domain/statistics/AnswerDetailsImprovementCardObjectFactorySpec.ts +++ b/core/templates/dev/head/domain/statistics/AnswerDetailsImprovementTaskObjectFactorySpec.ts @@ -13,11 +13,11 @@ // limitations under the License. /** - * @fileoverview Unit tests for the FeedbackImprovementCardObjectFactory. + * @fileoverview Unit tests for the FeedbackImprovementTaskObjectFactory. */ // TODO(#7222): Remove the following block of unnnecessary imports once -// FeedbackImprovementCardObjectFactory.ts is upgraded to Angular 8. +// FeedbackImprovementTaskObjectFactory.ts is upgraded to Angular 8. import { AngularNameService } from 'pages/exploration-editor-page/services/angular-name.service'; import { AnswerClassificationResultObjectFactory } from @@ -73,16 +73,16 @@ import { WrittenTranslationsObjectFactory } from 'domain/exploration/WrittenTranslationsObjectFactory'; // ^^^ This block is to be removed. -require('domain/statistics/AnswerDetailsImprovementCardObjectFactory.ts'); +require('domain/statistics/AnswerDetailsImprovementTaskObjectFactory.ts'); -describe('AnswerDetailsImprovementCardObjectFactory', function() { +describe('AnswerDetailsImprovementTaskObjectFactory', function() { var $q = null; var $rootScope = null; var $uibModal = null; - var AnswerDetailsImprovementCardObjectFactory = null; + var AnswerDetailsImprovementTaskObjectFactory = null; var ImprovementModalService = null; var LearnerAnswerDetailsDataService = null; - var ANSWER_DETAILS_IMPROVEMENT_CARD_TYPE = null; + var ANSWER_DETAILS_IMPROVEMENT_TASK_TYPE = null; var STATUS_NOT_ACTIONABLE = null; var STATUS_OPEN = null; @@ -147,19 +147,19 @@ describe('AnswerDetailsImprovementCardObjectFactory', function() { })); beforeEach(angular.mock.inject(function( _$q_, _$rootScope_, _$uibModal_, - _AnswerDetailsImprovementCardObjectFactory_, _ImprovementModalService_, + _AnswerDetailsImprovementTaskObjectFactory_, _ImprovementModalService_, _LearnerAnswerDetailsDataService_, - _ANSWER_DETAILS_IMPROVEMENT_CARD_TYPE_, + _ANSWER_DETAILS_IMPROVEMENT_TASK_TYPE_, _STATUS_NOT_ACTIONABLE_, _STATUS_OPEN_) { $q = _$q_; $rootScope = _$rootScope_; $uibModal = _$uibModal_; - AnswerDetailsImprovementCardObjectFactory = - _AnswerDetailsImprovementCardObjectFactory_; + AnswerDetailsImprovementTaskObjectFactory = + _AnswerDetailsImprovementTaskObjectFactory_; ImprovementModalService = _ImprovementModalService_; LearnerAnswerDetailsDataService = _LearnerAnswerDetailsDataService_; - ANSWER_DETAILS_IMPROVEMENT_CARD_TYPE = - _ANSWER_DETAILS_IMPROVEMENT_CARD_TYPE_; + ANSWER_DETAILS_IMPROVEMENT_TASK_TYPE = + _ANSWER_DETAILS_IMPROVEMENT_TASK_TYPE_; STATUS_NOT_ACTIONABLE = _STATUS_NOT_ACTIONABLE_; STATUS_OPEN = _STATUS_OPEN_; })); @@ -167,16 +167,16 @@ describe('AnswerDetailsImprovementCardObjectFactory', function() { describe('.createNew', function() { it('retrieves data from passed thread', function() { var mockLearnerAnswerDetails = {learnerAnswerInfoData: 'sample'}; - var card = AnswerDetailsImprovementCardObjectFactory.createNew( + var task = AnswerDetailsImprovementTaskObjectFactory.createNew( mockLearnerAnswerDetails); - expect(card.getDirectiveData()).toBe(mockLearnerAnswerDetails); - expect(card.getDirectiveType()).toEqual( - ANSWER_DETAILS_IMPROVEMENT_CARD_TYPE); + expect(task.getDirectiveData()).toBe(mockLearnerAnswerDetails); + expect(task.getDirectiveType()).toEqual( + ANSWER_DETAILS_IMPROVEMENT_TASK_TYPE); }); }); - describe('.fetchCards', function() { + describe('.fetchTasks', function() { it('fetches threads from the backend', function(done) { spyOn( LearnerAnswerDetailsDataService, @@ -184,12 +184,12 @@ describe('AnswerDetailsImprovementCardObjectFactory', function() { spyOn(LearnerAnswerDetailsDataService, 'getData').and.returnValue( [{learnerAnswerInfoData: 'abc1'}, {learnerAnswerInfoData: 'def2'}]); - AnswerDetailsImprovementCardObjectFactory.fetchCards().then( - function(cards) { + AnswerDetailsImprovementTaskObjectFactory.fetchTasks().then( + function(tasks) { expect( - cards[0].getDirectiveData().learnerAnswerInfoData).toEqual('abc1'); + tasks[0].getDirectiveData().learnerAnswerInfoData).toEqual('abc1'); expect( - cards[1].getDirectiveData().learnerAnswerInfoData).toEqual('def2'); + tasks[1].getDirectiveData().learnerAnswerInfoData).toEqual('def2'); }).then(done, done.fail); // $q Promises need to be forcibly resolved through a JavaScript digest, @@ -198,7 +198,7 @@ describe('AnswerDetailsImprovementCardObjectFactory', function() { }); }); - describe('AnswerDetailsImprovementCard', function() { + describe('AnswerDetailsImprovementTask', function() { beforeEach(function() { this.mockLearnerAnswerDetails = { expId: 12, @@ -210,63 +210,63 @@ describe('AnswerDetailsImprovementCardObjectFactory', function() { created_on: 1441870501230.642, }] }; - this.card = - AnswerDetailsImprovementCardObjectFactory.createNew( + this.task = + AnswerDetailsImprovementTaskObjectFactory.createNew( this.mockLearnerAnswerDetails); }); describe('.getStatus', function() { it('returns open as status', function() { - expect(this.card.getStatus()).toEqual(STATUS_OPEN); + expect(this.task.getStatus()).toEqual(STATUS_OPEN); }); it('returns not actionable as status', function() { this.mockLearnerAnswerDetails.learnerAnswerInfoData = []; - expect(this.card.getStatus()).toEqual(STATUS_NOT_ACTIONABLE); + expect(this.task.getStatus()).toEqual(STATUS_NOT_ACTIONABLE); }); }); describe('.getTitle', function() { it('returns answer details as title', function() { - expect(this.card.getTitle()).toEqual( + expect(this.task.getTitle()).toEqual( 'Answer details for the card "fakeStateName"'); }); }); describe('.isObsolete', function() { it('returns is obsolete as false', function() { - expect(this.card.isObsolete()).toEqual(false); + expect(this.task.isObsolete()).toEqual(false); }); it('returns is obsolete as true', function() { this.mockLearnerAnswerDetails.learnerAnswerInfoData = []; - expect(this.card.isObsolete()).toEqual(true); + expect(this.task.isObsolete()).toEqual(true); }); }); describe('.getDirectiveType', function() { it('returns answer details as directive type', function() { - expect(this.card.getDirectiveType()) - .toEqual(ANSWER_DETAILS_IMPROVEMENT_CARD_TYPE); + expect(this.task.getDirectiveType()) + .toEqual(ANSWER_DETAILS_IMPROVEMENT_TASK_TYPE); }); }); describe('.getDirectiveData', function() { it('returns the learner answer details', function() { - expect(this.card.getDirectiveData()).toBe( + expect(this.task.getDirectiveData()).toBe( this.mockLearnerAnswerDetails); }); }); describe('.getActionButtons', function() { it('contains one button', function() { - expect(this.card.getActionButtons().length).toEqual(1); + expect(this.task.getActionButtons().length).toEqual(1); }); }); describe('first button', function() { beforeEach(function() { - this.button = this.card.getActionButtons()[0]; + this.button = this.task.getActionButtons()[0]; }); it('opens a learner answer details modal', function() { diff --git a/core/templates/dev/head/domain/statistics/FeedbackImprovementCardObjectFactory.ts b/core/templates/dev/head/domain/statistics/FeedbackImprovementTaskObjectFactory.ts similarity index 68% rename from core/templates/dev/head/domain/statistics/FeedbackImprovementCardObjectFactory.ts rename to core/templates/dev/head/domain/statistics/FeedbackImprovementTaskObjectFactory.ts index 675c46db1b57..417410beb617 100644 --- a/core/templates/dev/head/domain/statistics/FeedbackImprovementCardObjectFactory.ts +++ b/core/templates/dev/head/domain/statistics/FeedbackImprovementTaskObjectFactory.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * @fileoverview Factory for creating Feedback Cards in the Improvements Tab. + * @fileoverview Factory for creating Feedback Tasks in the Improvements Tab. */ require('domain/statistics/ImprovementActionButtonObjectFactory.ts'); @@ -24,13 +24,13 @@ require( require( 'pages/exploration-editor-page/feedback-tab/services/thread-data.service.ts'); -angular.module('oppia').factory('FeedbackImprovementCardObjectFactory', [ +angular.module('oppia').factory('FeedbackImprovementTaskObjectFactory', [ '$q', 'ImprovementActionButtonObjectFactory', 'ImprovementModalService', - 'ThreadDataService', 'FEEDBACK_IMPROVEMENT_CARD_TYPE', + 'ThreadDataService', 'FEEDBACK_IMPROVEMENT_TASK_TYPE', function( $q, ImprovementActionButtonObjectFactory, ImprovementModalService, - ThreadDataService, FEEDBACK_IMPROVEMENT_CARD_TYPE) { - var FeedbackImprovementCard = function(feedbackThread) { + ThreadDataService, FEEDBACK_IMPROVEMENT_TASK_TYPE) { + var FeedbackImprovementTask = function(feedbackThread) { this._feedbackThread = feedbackThread; this._actionButtons = [ ImprovementActionButtonObjectFactory.createNew( @@ -39,62 +39,62 @@ angular.module('oppia').factory('FeedbackImprovementCardObjectFactory', [ ]; }; - /** @returns {string} - The actionable status of this card. */ - FeedbackImprovementCard.prototype.getStatus = function() { + /** @returns {string} - The actionable status of this task. */ + FeedbackImprovementTask.prototype.getStatus = function() { return this._feedbackThread.status; }; /** @returns {string} - A simple summary of the feedback thread. */ - FeedbackImprovementCard.prototype.getTitle = function() { + FeedbackImprovementTask.prototype.getTitle = function() { return this._feedbackThread.subject; }; /** - * @returns {boolean} - Whether this card is no longer useful, and hence + * @returns {boolean} - Whether this task is no longer useful, and hence * should be hidden away. */ - FeedbackImprovementCard.prototype.isObsolete = function() { + FeedbackImprovementTask.prototype.isObsolete = function() { return false; // Feedback threads are always actionable. }; /** - * @returns {string} - The directive card type used to render details about - * this card's data. + * @returns {string} - The directive task type used to render details about + * this task's data. */ - FeedbackImprovementCard.prototype.getDirectiveType = function() { - return FEEDBACK_IMPROVEMENT_CARD_TYPE; + FeedbackImprovementTask.prototype.getDirectiveType = function() { + return FEEDBACK_IMPROVEMENT_TASK_TYPE; }; /** * @returns {string} - Data required by the associated directive for * rendering. */ - FeedbackImprovementCard.prototype.getDirectiveData = function() { + FeedbackImprovementTask.prototype.getDirectiveData = function() { return this._feedbackThread; }; /** * @returns {ImprovementActionButton[]} - The array of action buttons - * displayed on the card. + * displayed on the task. */ - FeedbackImprovementCard.prototype.getActionButtons = function() { + FeedbackImprovementTask.prototype.getActionButtons = function() { return this._actionButtons; }; return { /** - * @returns {FeedbackImprovementCard} - * @param {FeedbackThread} thread - The thread this card is referring to. + * @returns {FeedbackImprovementTask} + * @param {FeedbackThread} thread - The thread this task is referring to. */ createNew: function(thread) { - return new FeedbackImprovementCard(thread); + return new FeedbackImprovementTask(thread); }, /** - * @returns {Promise} - The array of feedback + * @returns {Promise} - The array of feedback * threads associated to the current exploration. */ - fetchCards: function() { + fetchTasks: function() { var createNew = this.createNew; return ThreadDataService.fetchThreads().then(function() { return $q.all( diff --git a/core/templates/dev/head/domain/statistics/FeedbackImprovementCardObjectFactorySpec.ts b/core/templates/dev/head/domain/statistics/FeedbackImprovementTaskObjectFactorySpec.ts similarity index 84% rename from core/templates/dev/head/domain/statistics/FeedbackImprovementCardObjectFactorySpec.ts rename to core/templates/dev/head/domain/statistics/FeedbackImprovementTaskObjectFactorySpec.ts index 21af82ba7793..1c3e3633e01c 100644 --- a/core/templates/dev/head/domain/statistics/FeedbackImprovementCardObjectFactorySpec.ts +++ b/core/templates/dev/head/domain/statistics/FeedbackImprovementTaskObjectFactorySpec.ts @@ -13,11 +13,11 @@ // limitations under the License. /** - * @fileoverview Unit tests for the FeedbackImprovementCardObjectFactory. + * @fileoverview Unit tests for the FeedbackImprovementTaskObjectFactory. */ // TODO(#7222): Remove the following block of unnnecessary imports once -// FeedbackImprovementCardObjectFactory.ts is upgraded to Angular 8. +// FeedbackImprovementTaskObjectFactory.ts is upgraded to Angular 8. import { AngularNameService } from 'pages/exploration-editor-page/services/angular-name.service'; import { AnswerClassificationResultObjectFactory } from @@ -73,16 +73,16 @@ import { WrittenTranslationsObjectFactory } from 'domain/exploration/WrittenTranslationsObjectFactory'; // ^^^ This block is to be removed. -require('domain/statistics/FeedbackImprovementCardObjectFactory.ts'); +require('domain/statistics/FeedbackImprovementTaskObjectFactory.ts'); -describe('FeedbackImprovementCardObjectFactory', function() { +describe('FeedbackImprovementTaskObjectFactory', function() { var $q = null; var $rootScope = null; var $uibModal = null; - var FeedbackImprovementCardObjectFactory = null; + var FeedbackImprovementTaskObjectFactory = null; var ImprovementModalService = null; var ThreadDataService = null; - var FEEDBACK_IMPROVEMENT_CARD_TYPE = null; + var FEEDBACK_IMPROVEMENT_TASK_TYPE = null; beforeEach(angular.mock.module('oppia')); beforeEach(angular.mock.module('oppia', function($provide) { @@ -144,30 +144,30 @@ describe('FeedbackImprovementCardObjectFactory', function() { new WrittenTranslationObjectFactory())); })); beforeEach(angular.mock.inject(function( - _$q_, _$rootScope_, _$uibModal_, _FeedbackImprovementCardObjectFactory_, + _$q_, _$rootScope_, _$uibModal_, _FeedbackImprovementTaskObjectFactory_, _ImprovementModalService_, _ThreadDataService_, - _FEEDBACK_IMPROVEMENT_CARD_TYPE_) { + _FEEDBACK_IMPROVEMENT_TASK_TYPE_) { $q = _$q_; $rootScope = _$rootScope_; $uibModal = _$uibModal_; - FeedbackImprovementCardObjectFactory = - _FeedbackImprovementCardObjectFactory_; + FeedbackImprovementTaskObjectFactory = + _FeedbackImprovementTaskObjectFactory_; ImprovementModalService = _ImprovementModalService_; ThreadDataService = _ThreadDataService_; - FEEDBACK_IMPROVEMENT_CARD_TYPE = _FEEDBACK_IMPROVEMENT_CARD_TYPE_; + FEEDBACK_IMPROVEMENT_TASK_TYPE = _FEEDBACK_IMPROVEMENT_TASK_TYPE_; })); describe('.createNew', function() { it('retrieves data from passed thread', function() { var mockThread = {threadId: 1}; - var card = FeedbackImprovementCardObjectFactory.createNew(mockThread); + var task = FeedbackImprovementTaskObjectFactory.createNew(mockThread); - expect(card.getDirectiveData()).toBe(mockThread); - expect(card.getDirectiveType()).toEqual(FEEDBACK_IMPROVEMENT_CARD_TYPE); + expect(task.getDirectiveData()).toBe(mockThread); + expect(task.getDirectiveType()).toEqual(FEEDBACK_IMPROVEMENT_TASK_TYPE); }); }); - describe('.fetchCards', function() { + describe('.fetchTasks', function() { it('fetches threads from the backend', function(done) { spyOn(ThreadDataService, 'fetchThreads').and.callFake($q.resolve); spyOn(ThreadDataService, 'fetchMessages').and.callFake($q.resolve); @@ -175,9 +175,9 @@ describe('FeedbackImprovementCardObjectFactory', function() { feedbackThreads: [{threadId: 'abc1'}, {threadId: 'def2'}] }); - FeedbackImprovementCardObjectFactory.fetchCards().then(function(cards) { - expect(cards[0].getDirectiveData().threadId).toEqual('abc1'); - expect(cards[1].getDirectiveData().threadId).toEqual('def2'); + FeedbackImprovementTaskObjectFactory.fetchTasks().then(function(tasks) { + expect(tasks[0].getDirectiveData().threadId).toEqual('abc1'); + expect(tasks[1].getDirectiveData().threadId).toEqual('def2'); }).then(done, done.fail); // $q Promises need to be forcibly resolved through a JavaScript digest, @@ -186,7 +186,7 @@ describe('FeedbackImprovementCardObjectFactory', function() { }); }); - describe('FeedbackImprovementCard', function() { + describe('FeedbackImprovementTask', function() { beforeEach(function() { this.mockThread = { last_updated: 1441870501230.642, @@ -197,45 +197,45 @@ describe('FeedbackImprovementCardObjectFactory', function() { summary: null, thread_id: 'abc1', }; - this.card = - FeedbackImprovementCardObjectFactory.createNew(this.mockThread); + this.task = + FeedbackImprovementTaskObjectFactory.createNew(this.mockThread); }); describe('.getStatus', function() { it('returns the same status as the thread', function() { this.mockThread.status = 'a unique status'; - expect(this.card.getStatus()).toEqual('a unique status'); + expect(this.task.getStatus()).toEqual('a unique status'); }); }); describe('.getTitle', function() { it('returns the subject of the thread', function() { this.mockThread.subject = 'Feedback from a learner'; - expect(this.card.getTitle()).toEqual('Feedback from a learner'); + expect(this.task.getTitle()).toEqual('Feedback from a learner'); }); }); describe('.getDirectiveType', function() { it('returns feedback as directive type', function() { - expect(this.card.getDirectiveType()) - .toEqual(FEEDBACK_IMPROVEMENT_CARD_TYPE); + expect(this.task.getDirectiveType()) + .toEqual(FEEDBACK_IMPROVEMENT_TASK_TYPE); }); }); describe('.getDirectiveData', function() { it('returns the thread', function() { - expect(this.card.getDirectiveData()).toBe(this.mockThread); + expect(this.task.getDirectiveData()).toBe(this.mockThread); }); }); describe('.getActionButtons', function() { it('contains one button', function() { - expect(this.card.getActionButtons().length).toEqual(1); + expect(this.task.getActionButtons().length).toEqual(1); }); describe('first button', function() { beforeEach(function() { - this.button = this.card.getActionButtons()[0]; + this.button = this.task.getActionButtons()[0]; }); it('opens a thread modal', function() { diff --git a/core/templates/dev/head/domain/statistics/PlaythroughImprovementCardObjectFactory.ts b/core/templates/dev/head/domain/statistics/PlaythroughImprovementTaskObjectFactory.ts similarity index 66% rename from core/templates/dev/head/domain/statistics/PlaythroughImprovementCardObjectFactory.ts rename to core/templates/dev/head/domain/statistics/PlaythroughImprovementTaskObjectFactory.ts index f093799a0e98..22f0b2402d95 100644 --- a/core/templates/dev/head/domain/statistics/PlaythroughImprovementCardObjectFactory.ts +++ b/core/templates/dev/head/domain/statistics/PlaythroughImprovementTaskObjectFactory.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * @fileoverview Factory for creating Playthrough Cards in the Improvements Tab. + * @fileoverview Factory for creating Playthrough Tasks in the Improvements Tab. */ require('domain/statistics/ImprovementActionButtonObjectFactory.ts'); @@ -25,19 +25,19 @@ require( 'improvement-modal.service.ts'); require('services/PlaythroughIssuesService.ts'); -angular.module('oppia').factory('PlaythroughImprovementCardObjectFactory', [ +angular.module('oppia').factory('PlaythroughImprovementTaskObjectFactory', [ 'ImprovementActionButtonObjectFactory', 'ImprovementModalService', - 'PlaythroughIssuesService', 'PLAYTHROUGH_IMPROVEMENT_CARD_TYPE', + 'PlaythroughIssuesService', 'PLAYTHROUGH_IMPROVEMENT_TASK_TYPE', 'STATUS_NOT_ACTIONABLE', 'STATUS_OPEN', function( ImprovementActionButtonObjectFactory, ImprovementModalService, - PlaythroughIssuesService, PLAYTHROUGH_IMPROVEMENT_CARD_TYPE, + PlaythroughIssuesService, PLAYTHROUGH_IMPROVEMENT_TASK_TYPE, STATUS_NOT_ACTIONABLE, STATUS_OPEN) { /** * @constructor - * @param {PlaythroughIssue} issue - The issue this card is referring to. + * @param {PlaythroughIssue} issue - The issue this task is referring to. */ - var PlaythroughImprovementCard = function(issue) { + var PlaythroughImprovementTask = function(issue) { /** @type {string} */ this._title = PlaythroughIssuesService.renderIssueStatement(issue); /** @type {ImprovementActionButton[]} */ @@ -49,11 +49,11 @@ angular.module('oppia').factory('PlaythroughImprovementCardObjectFactory', [ 'forever. Are you sure you want to proceed?', 'Mark as Resolved', 'btn-danger') .result.then(() => PlaythroughIssuesService.resolveIssue(issue)) - .then(() => this._discarded = true); + .then(() => this._isObsolete = true); }), ]; /** @type {boolean} */ - this._discarded = false; + this._isObsolete = false; /** @type {Object} */ this._directiveData = { title: this._title, @@ -62,64 +62,64 @@ angular.module('oppia').factory('PlaythroughImprovementCardObjectFactory', [ }; }; - /** @returns {string} - The actionable status of this card. */ - PlaythroughImprovementCard.prototype.getStatus = function() { - return this._discarded ? STATUS_NOT_ACTIONABLE : STATUS_OPEN; + /** @returns {string} - The actionable status of this task. */ + PlaythroughImprovementTask.prototype.getStatus = function() { + return this._isObsolete ? STATUS_NOT_ACTIONABLE : STATUS_OPEN; }; /** - * @returns {boolean} - Whether this card is no longer useful, and hence + * @returns {boolean} - Whether this task is no longer useful, and hence * should be hidden. */ - PlaythroughImprovementCard.prototype.isObsolete = function() { - return this._discarded; + PlaythroughImprovementTask.prototype.isObsolete = function() { + return this._isObsolete; }; /** @returns {string} - A simple summary of the Playthrough Issue. */ - PlaythroughImprovementCard.prototype.getTitle = function() { + PlaythroughImprovementTask.prototype.getTitle = function() { return this._title; }; /** - * @returns {string} - The directive card type used to render details about - * this card's data. + * @returns {string} - The directive task type used to render details about + * this task's data. */ - PlaythroughImprovementCard.prototype.getDirectiveType = function() { - return PLAYTHROUGH_IMPROVEMENT_CARD_TYPE; + PlaythroughImprovementTask.prototype.getDirectiveType = function() { + return PLAYTHROUGH_IMPROVEMENT_TASK_TYPE; }; /** * @returns {string} - Data required by the associated directive for * rendering. */ - PlaythroughImprovementCard.prototype.getDirectiveData = function() { + PlaythroughImprovementTask.prototype.getDirectiveData = function() { return this._directiveData; }; /** * @returns {ImprovementActionButton[]} - The list of action buttons - * displayed on the card. + * displayed on the task. */ - PlaythroughImprovementCard.prototype.getActionButtons = function() { + PlaythroughImprovementTask.prototype.getActionButtons = function() { return this._actionButtons; }; return { /** - * @returns {PlaythroughImprovementCard} - * @param {PlaythroughIssue} issue - The issue this card is referring to. + * @returns {PlaythroughImprovementTask} + * @param {PlaythroughIssue} issue - The issue this task is referring to. */ createNew: function(issue) { - return new PlaythroughImprovementCard(issue); + return new PlaythroughImprovementTask(issue); }, /** - * @returns {Promise} - The list of + * @returns {Promise} - The list of * playthrough issues associated to the current exploration. */ - fetchCards: function() { + fetchTasks: function() { return PlaythroughIssuesService.getIssues().then(function(issues) { return issues.map(function(issue) { - return new PlaythroughImprovementCard(issue); + return new PlaythroughImprovementTask(issue); }); }); }, diff --git a/core/templates/dev/head/domain/statistics/PlaythroughImprovementCardObjectFactorySpec.ts b/core/templates/dev/head/domain/statistics/PlaythroughImprovementTaskObjectFactorySpec.ts similarity index 83% rename from core/templates/dev/head/domain/statistics/PlaythroughImprovementCardObjectFactorySpec.ts rename to core/templates/dev/head/domain/statistics/PlaythroughImprovementTaskObjectFactorySpec.ts index 4fc97084c25e..306b2545a5e3 100644 --- a/core/templates/dev/head/domain/statistics/PlaythroughImprovementCardObjectFactorySpec.ts +++ b/core/templates/dev/head/domain/statistics/PlaythroughImprovementTaskObjectFactorySpec.ts @@ -13,11 +13,11 @@ // limitations under the License. /** - * @fileoverview Unit tests for the PlaythroughImprovementCardObjectFactory. + * @fileoverview Unit tests for the PlaythroughImprovementTaskObjectFactory. */ // TODO(#7222): Remove the following block of unnnecessary imports once -// PlaythroughImprovementCardObjectFactory.ts is upgraded to Angular 8. +// PlaythroughImprovementTaskObjectFactory.ts is upgraded to Angular 8. import { AngularNameService } from 'pages/exploration-editor-page/services/angular-name.service'; import { AnswerClassificationResultObjectFactory } from @@ -79,16 +79,16 @@ import { WrittenTranslationsObjectFactory } from 'domain/exploration/WrittenTranslationsObjectFactory'; // ^^^ This block is to be removed. -require('domain/statistics/PlaythroughImprovementCardObjectFactory'); +require('domain/statistics/PlaythroughImprovementTaskObjectFactory'); -describe('PlaythroughImprovementCardObjectFactory', function() { +describe('PlaythroughImprovementTaskObjectFactory', function() { var $q = null; var $rootScope = null; var $uibModal = null; - var PlaythroughImprovementCardObjectFactory = null; + var PlaythroughImprovementTaskObjectFactory = null; var playthroughIssueObjectFactory = null; var PlaythroughIssuesService = null; - var PLAYTHROUGH_IMPROVEMENT_CARD_TYPE = null; + var PLAYTHROUGH_IMPROVEMENT_TASK_TYPE = null; beforeEach(angular.mock.module('oppia')); beforeEach(angular.mock.module('oppia', function($provide) { @@ -158,17 +158,17 @@ describe('PlaythroughImprovementCardObjectFactory', function() { beforeEach(angular.mock.inject(function( _$q_, _$rootScope_, _$uibModal_, - _PlaythroughImprovementCardObjectFactory_, + _PlaythroughImprovementTaskObjectFactory_, _PlaythroughIssueObjectFactory_, _PlaythroughIssuesService_, - _PLAYTHROUGH_IMPROVEMENT_CARD_TYPE_) { + _PLAYTHROUGH_IMPROVEMENT_TASK_TYPE_) { $q = _$q_; $rootScope = _$rootScope_; $uibModal = _$uibModal_; - PlaythroughImprovementCardObjectFactory = - _PlaythroughImprovementCardObjectFactory_; + PlaythroughImprovementTaskObjectFactory = + _PlaythroughImprovementTaskObjectFactory_; playthroughIssueObjectFactory = _PlaythroughIssueObjectFactory_; PlaythroughIssuesService = _PlaythroughIssuesService_; - PLAYTHROUGH_IMPROVEMENT_CARD_TYPE = _PLAYTHROUGH_IMPROVEMENT_CARD_TYPE_; + PLAYTHROUGH_IMPROVEMENT_TASK_TYPE = _PLAYTHROUGH_IMPROVEMENT_TASK_TYPE_; PlaythroughIssuesService.initSession(expId, expVersion); @@ -190,23 +190,23 @@ describe('PlaythroughImprovementCardObjectFactory', function() { is_valid: true, }); - var card = PlaythroughImprovementCardObjectFactory.createNew(issue); + var task = PlaythroughImprovementTaskObjectFactory.createNew(issue); - expect(card.getTitle()).toEqual( + expect(task.getTitle()).toEqual( PlaythroughIssuesService.renderIssueStatement(issue)); - expect(card.getDirectiveData()).toEqual({ + expect(task.getDirectiveData()).toEqual({ title: PlaythroughIssuesService.renderIssueStatement(issue), suggestions: PlaythroughIssuesService.renderIssueSuggestions(issue), playthroughIds: ['1', '2'], }); - expect(card.getDirectiveType()).toEqual( - PLAYTHROUGH_IMPROVEMENT_CARD_TYPE); + expect(task.getDirectiveType()).toEqual( + PLAYTHROUGH_IMPROVEMENT_TASK_TYPE); }); }); - describe('.fetchCards', function() { - it('returns a card for each existing issue', function(done) { + describe('.fetchTasks', function() { + it('returns a task for each existing issue', function(done) { var earlyQuitIssue = playthroughIssueObjectFactory.createFromBackendDict({ issue_type: 'EarlyQuit', @@ -218,7 +218,7 @@ describe('PlaythroughImprovementCardObjectFactory', function() { schema_version: 1, is_valid: true, }); - var earlyQuitCardTitle = + var earlyQuitTaskTitle = PlaythroughIssuesService.renderIssueStatement(earlyQuitIssue); var multipleIncorrectSubmissionsIssue = @@ -232,7 +232,7 @@ describe('PlaythroughImprovementCardObjectFactory', function() { schema_version: 1, is_valid: true, }); - var multipleIncorrectSubmissionsCardTitle = + var multipleIncorrectSubmissionsTaskTitle = PlaythroughIssuesService.renderIssueStatement( multipleIncorrectSubmissionsIssue); @@ -246,7 +246,7 @@ describe('PlaythroughImprovementCardObjectFactory', function() { schema_version: 1, is_valid: true, }); - var cyclicTransitionsCardTitle = + var cyclicTransitionsTaskTitle = PlaythroughIssuesService.renderIssueStatement( cyclicTransitionsIssue); @@ -257,20 +257,20 @@ describe('PlaythroughImprovementCardObjectFactory', function() { cyclicTransitionsIssue, ])); - PlaythroughImprovementCardObjectFactory.fetchCards() - .then(function(cards) { - expect(cards.length).toEqual(3); - expect(cards[0].getTitle()).toEqual(earlyQuitCardTitle); - expect(cards[1].getTitle()) - .toEqual(multipleIncorrectSubmissionsCardTitle); - expect(cards[2].getTitle()).toEqual(cyclicTransitionsCardTitle); + PlaythroughImprovementTaskObjectFactory.fetchTasks() + .then(function(tasks) { + expect(tasks.length).toEqual(3); + expect(tasks[0].getTitle()).toEqual(earlyQuitTaskTitle); + expect(tasks[1].getTitle()) + .toEqual(multipleIncorrectSubmissionsTaskTitle); + expect(tasks[2].getTitle()).toEqual(cyclicTransitionsTaskTitle); }).then(done, done.fail); this.scope.$digest(); // Forces all pending promises to evaluate. }); }); - describe('PlaythroughImprovementCard', function() { + describe('PlaythroughImprovementTask', function() { beforeEach(function() { this.issue = playthroughIssueObjectFactory.createFromBackendDict({ issue_type: 'EarlyQuit', @@ -282,22 +282,22 @@ describe('PlaythroughImprovementCardObjectFactory', function() { schema_version: 1, is_valid: true, }); - this.card = PlaythroughImprovementCardObjectFactory.createNew(this.issue); + this.task = PlaythroughImprovementTaskObjectFactory.createNew(this.issue); }); describe('.getActionButtons', function() { it('contains a specific sequence of buttons', function() { - expect(this.card.getActionButtons().length).toEqual(1); - expect(this.card.getActionButtons()[0].getText()) + expect(this.task.getActionButtons().length).toEqual(1); + expect(this.task.getActionButtons()[0].getText()) .toEqual('Mark as Resolved'); }); }); describe('Mark as Resolved Action Button', function() { - it('marks the card as resolved after confirmation', function() { - var card = this.card; + it('marks the task as resolved after confirmation', function() { + var task = this.task; var issue = this.issue; - var resolveActionButton = card.getActionButtons()[0]; + var resolveActionButton = task.getActionButtons()[0]; var resolveIssueSpy = spyOn(PlaythroughIssuesService, 'resolveIssue').and.stub(); @@ -305,19 +305,19 @@ describe('PlaythroughImprovementCardObjectFactory', function() { result: $q.resolve(), // Returned when confirm button is pressed. }); - expect(card.getStatus()).toEqual('open'); + expect(task.getStatus()).toEqual('open'); resolveActionButton.execute(); this.scope.$digest(); // Forces all pending promises to evaluate. expect(resolveIssueSpy).toHaveBeenCalledWith(issue); - expect(card.getStatus()).not.toEqual('open'); + expect(task.getStatus()).not.toEqual('open'); }); - it('keeps the card after cancel', function() { - var card = this.card; + it('keeps the task after cancel', function() { + var task = this.task; var issue = this.issue; - var resolveActionButton = card.getActionButtons()[0]; + var resolveActionButton = task.getActionButtons()[0]; var resolveIssueSpy = spyOn(PlaythroughIssuesService, 'resolveIssue').and.stub(); @@ -325,12 +325,12 @@ describe('PlaythroughImprovementCardObjectFactory', function() { result: $q.reject(), // Returned when cancel button is pressed. }); - expect(card.getStatus()).toEqual('open'); + expect(task.getStatus()).toEqual('open'); resolveActionButton.execute(); this.scope.$digest(); // Forces all pending promises to evaluate. expect(resolveIssueSpy).not.toHaveBeenCalled(); - expect(card.getStatus()).toEqual('open'); + expect(task.getStatus()).toEqual('open'); }); }); }); diff --git a/core/templates/dev/head/domain/statistics/SuggestionImprovementCardObjectFactory.ts b/core/templates/dev/head/domain/statistics/SuggestionImprovementTaskObjectFactory.ts similarity index 70% rename from core/templates/dev/head/domain/statistics/SuggestionImprovementCardObjectFactory.ts rename to core/templates/dev/head/domain/statistics/SuggestionImprovementTaskObjectFactory.ts index 600838fe961f..0a1dd1b58036 100644 --- a/core/templates/dev/head/domain/statistics/SuggestionImprovementCardObjectFactory.ts +++ b/core/templates/dev/head/domain/statistics/SuggestionImprovementTaskObjectFactory.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * @fileoverview Factory for creating Suggestion Cards in the Improvements Tab. + * @fileoverview Factory for creating Suggestion Tasks in the Improvements Tab. */ require('domain/statistics/ImprovementActionButtonObjectFactory.ts'); @@ -27,13 +27,13 @@ require( 'pages/exploration-editor-page/suggestion-modal-for-editor-view/' + 'suggestion-modal-for-exploration-editor.service.ts'); -angular.module('oppia').factory('SuggestionImprovementCardObjectFactory', [ +angular.module('oppia').factory('SuggestionImprovementTaskObjectFactory', [ '$q', 'ImprovementActionButtonObjectFactory', 'ImprovementModalService', - 'ThreadDataService', 'SUGGESTION_IMPROVEMENT_CARD_TYPE', + 'ThreadDataService', 'SUGGESTION_IMPROVEMENT_TASK_TYPE', function( $q, ImprovementActionButtonObjectFactory, ImprovementModalService, - ThreadDataService, SUGGESTION_IMPROVEMENT_CARD_TYPE) { - var SuggestionImprovementCard = function(suggestionThread) { + ThreadDataService, SUGGESTION_IMPROVEMENT_TASK_TYPE) { + var SuggestionImprovementTask = function(suggestionThread) { this._actionButtons = [ ImprovementActionButtonObjectFactory.createNew( 'Review Thread', 'btn-primary', @@ -42,30 +42,30 @@ angular.module('oppia').factory('SuggestionImprovementCardObjectFactory', [ this._suggestionThread = suggestionThread; }; - /** @returns {string} - The actionable status of this card. */ - SuggestionImprovementCard.prototype.getStatus = function() { + /** @returns {string} - The actionable status of this task. */ + SuggestionImprovementTask.prototype.getStatus = function() { return this._suggestionThread.status; }; /** - * @returns {boolean} - Whether this card is no longer useful, and hence + * @returns {boolean} - Whether this task is no longer useful, and hence * should be hidden away. */ - SuggestionImprovementCard.prototype.isObsolete = function() { + SuggestionImprovementTask.prototype.isObsolete = function() { return false; // Suggestion threads are always actionable. }; /** @returns {string} - A simple summary of the suggestion thread. */ - SuggestionImprovementCard.prototype.getTitle = function() { + SuggestionImprovementTask.prototype.getTitle = function() { return 'Suggestion for the card "' + this._suggestionThread.suggestion.stateName + '"'; }; /** - * @returns {string} - The directive card type used to render details about - * this card's data. + * @returns {string} - The directive task type used to render details about + * this task's data. */ - SuggestionImprovementCard.prototype.getDirectiveData = function() { + SuggestionImprovementTask.prototype.getDirectiveData = function() { return this._suggestionThread; }; @@ -73,32 +73,32 @@ angular.module('oppia').factory('SuggestionImprovementCardObjectFactory', [ * @returns {string} - Data required by the associated directive for * rendering. */ - SuggestionImprovementCard.prototype.getDirectiveType = function() { - return SUGGESTION_IMPROVEMENT_CARD_TYPE; + SuggestionImprovementTask.prototype.getDirectiveType = function() { + return SUGGESTION_IMPROVEMENT_TASK_TYPE; }; /** * @returns {ImprovementActionButton[]} - The array of action buttons - * displayed on the card. + * displayed on the task. */ - SuggestionImprovementCard.prototype.getActionButtons = function() { + SuggestionImprovementTask.prototype.getActionButtons = function() { return this._actionButtons; }; return { /** - * @returns {SuggestionImprovementCard} - * @param {SuggestionThead} thread - The thread this card is referring to. + * @returns {SuggestionImprovementTask} + * @param {SuggestionThead} thread - The thread this task is referring to. */ createNew: function(thread) { - return new SuggestionImprovementCard(thread); + return new SuggestionImprovementTask(thread); }, /** - * @returns {Promise} - The array of + * @returns {Promise} - The array of * suggestion threads associated to the current exploration. */ - fetchCards: function() { + fetchTasks: function() { var createNew = this.createNew; return ThreadDataService.fetchThreads().then(function() { return $q.all( diff --git a/core/templates/dev/head/domain/statistics/SuggestionImprovementCardObjectFactorySpec.ts b/core/templates/dev/head/domain/statistics/SuggestionImprovementTaskObjectFactorySpec.ts similarity index 86% rename from core/templates/dev/head/domain/statistics/SuggestionImprovementCardObjectFactorySpec.ts rename to core/templates/dev/head/domain/statistics/SuggestionImprovementTaskObjectFactorySpec.ts index 60cb42674ae6..51fc1459f610 100644 --- a/core/templates/dev/head/domain/statistics/SuggestionImprovementCardObjectFactorySpec.ts +++ b/core/templates/dev/head/domain/statistics/SuggestionImprovementTaskObjectFactorySpec.ts @@ -13,11 +13,11 @@ // limitations under the License. /** - * @fileoverview Unit tests for the SuggestionImprovementCardObjectFactory. + * @fileoverview Unit tests for the SuggestionImprovementTaskObjectFactory. */ // TODO(#7222): Remove the following block of unnnecessary imports once -// SuggestionImprovementCardObjectFactory.ts is upgraded to Angular 8. +// SuggestionImprovementTaskObjectFactory.ts is upgraded to Angular 8. import { AngularNameService } from 'pages/exploration-editor-page/services/angular-name.service'; import { AnswerClassificationResultObjectFactory } from @@ -73,18 +73,18 @@ import { WrittenTranslationsObjectFactory } from 'domain/exploration/WrittenTranslationsObjectFactory'; // ^^^ This block is to be removed. -require('domain/statistics/SuggestionImprovementCardObjectFactory.ts'); +require('domain/statistics/SuggestionImprovementTaskObjectFactory.ts'); -describe('SuggestionImprovementCardObjectFactory', function() { +describe('SuggestionImprovementTaskObjectFactory', function() { var $q = null; var $rootScope = null; var $uibModal = null; var ImprovementModalService = null; - var SuggestionImprovementCardObjectFactory = null; + var SuggestionImprovementTaskObjectFactory = null; var SuggestionModalForExplorationEditorService = null; var SuggestionThreadObjectFactory = null; var ThreadDataService = null; - var SUGGESTION_IMPROVEMENT_CARD_TYPE = null; + var SUGGESTION_IMPROVEMENT_TASK_TYPE = null; beforeEach(angular.mock.module('oppia')); beforeEach(angular.mock.module('oppia', function($provide) { @@ -146,34 +146,34 @@ describe('SuggestionImprovementCardObjectFactory', function() { })); beforeEach(angular.mock.inject(function( _$q_, _$rootScope_, _$uibModal_, _ImprovementModalService_, - _SuggestionImprovementCardObjectFactory_, + _SuggestionImprovementTaskObjectFactory_, _SuggestionModalForExplorationEditorService_, _SuggestionThreadObjectFactory_, _ThreadDataService_, - _SUGGESTION_IMPROVEMENT_CARD_TYPE_) { + _SUGGESTION_IMPROVEMENT_TASK_TYPE_) { $q = _$q_; $rootScope = _$rootScope_; $uibModal = _$uibModal_; ImprovementModalService = _ImprovementModalService_; - SuggestionImprovementCardObjectFactory = - _SuggestionImprovementCardObjectFactory_; + SuggestionImprovementTaskObjectFactory = + _SuggestionImprovementTaskObjectFactory_; SuggestionModalForExplorationEditorService = _SuggestionModalForExplorationEditorService_; SuggestionThreadObjectFactory = _SuggestionThreadObjectFactory_; ThreadDataService = _ThreadDataService_; - SUGGESTION_IMPROVEMENT_CARD_TYPE = _SUGGESTION_IMPROVEMENT_CARD_TYPE_; + SUGGESTION_IMPROVEMENT_TASK_TYPE = _SUGGESTION_IMPROVEMENT_TASK_TYPE_; })); describe('.createNew', function() { it('retrieves data from passed thread', function() { var mockThread = {threadId: 1}; - var card = SuggestionImprovementCardObjectFactory.createNew(mockThread); + var task = SuggestionImprovementTaskObjectFactory.createNew(mockThread); - expect(card.getDirectiveData()).toBe(mockThread); - expect(card.getDirectiveType()).toEqual(SUGGESTION_IMPROVEMENT_CARD_TYPE); + expect(task.getDirectiveData()).toBe(mockThread); + expect(task.getDirectiveType()).toEqual(SUGGESTION_IMPROVEMENT_TASK_TYPE); }); }); - describe('.fetchCards', function() { + describe('.fetchTasks', function() { it('fetches threads from the backend', function(done) { spyOn(ThreadDataService, 'fetchThreads').and.callFake($q.resolve); spyOn(ThreadDataService, 'fetchMessages').and.callFake($q.resolve); @@ -181,9 +181,9 @@ describe('SuggestionImprovementCardObjectFactory', function() { suggestionThreads: [{threadId: 'abc1'}, {threadId: 'def2'}] }); - SuggestionImprovementCardObjectFactory.fetchCards().then(function(cards) { - expect(cards[0].getDirectiveData().threadId).toEqual('abc1'); - expect(cards[1].getDirectiveData().threadId).toEqual('def2'); + SuggestionImprovementTaskObjectFactory.fetchTasks().then(function(tasks) { + expect(tasks[0].getDirectiveData().threadId).toEqual('abc1'); + expect(tasks[1].getDirectiveData().threadId).toEqual('def2'); }).then(done, done.fail); // $q Promises need to be forcibly resolved through a JavaScript digest, @@ -192,7 +192,7 @@ describe('SuggestionImprovementCardObjectFactory', function() { }); }); - describe('SuggestionImprovementCard', function() { + describe('SuggestionImprovementTask', function() { beforeEach(function() { var mockSuggestionThreadBackendDict = { last_updated: 1000, @@ -228,45 +228,45 @@ describe('SuggestionImprovementCardObjectFactory', function() { this.mockThread = SuggestionThreadObjectFactory.createFromBackendDicts( mockSuggestionThreadBackendDict, mockSuggestionBackendDict); - this.card = - SuggestionImprovementCardObjectFactory.createNew(this.mockThread); + this.task = + SuggestionImprovementTaskObjectFactory.createNew(this.mockThread); }); describe('.getStatus', function() { it('returns the same status as the thread', function() { this.mockThread.status = 'a unique status'; - expect(this.card.getStatus()).toEqual('a unique status'); + expect(this.task.getStatus()).toEqual('a unique status'); }); }); describe('.getTitle', function() { it('returns the state associated with the suggestion', function() { - expect(this.card.getTitle()) + expect(this.task.getTitle()) .toEqual('Suggestion for the card "state_1"'); }); }); describe('.getDirectiveType', function() { it('returns suggestion as directive type', function() { - expect(this.card.getDirectiveType()) - .toEqual(SUGGESTION_IMPROVEMENT_CARD_TYPE); + expect(this.task.getDirectiveType()) + .toEqual(SUGGESTION_IMPROVEMENT_TASK_TYPE); }); }); describe('.getDirectiveData', function() { it('returns the thread', function() { - expect(this.card.getDirectiveData()).toBe(this.mockThread); + expect(this.task.getDirectiveData()).toBe(this.mockThread); }); }); describe('.getActionButtons', function() { it('contains one button', function() { - expect(this.card.getActionButtons().length).toEqual(1); + expect(this.task.getActionButtons().length).toEqual(1); }); describe('first button', function() { beforeEach(function() { - this.button = this.card.getActionButtons()[0]; + this.button = this.task.getActionButtons()[0]; }); it('opens a thread modal', function() { diff --git a/core/templates/dev/head/domain/statistics/statistics-domain.constants.ajs.ts b/core/templates/dev/head/domain/statistics/statistics-domain.constants.ajs.ts index 73b523a68769..fbb315c480cf 100644 --- a/core/templates/dev/head/domain/statistics/statistics-domain.constants.ajs.ts +++ b/core/templates/dev/head/domain/statistics/statistics-domain.constants.ajs.ts @@ -25,18 +25,18 @@ angular.module('oppia').constant( 'LEARNER_ACTION_SCHEMA_LATEST_VERSION', StatisticsDomainConstants.LEARNER_ACTION_SCHEMA_LATEST_VERSION); angular.module('oppia').constant( - 'ANSWER_DETAILS_IMPROVEMENT_CARD_TYPE', - StatisticsDomainConstants.ANSWER_DETAILS_IMPROVEMENT_CARD_TYPE); + 'ANSWER_DETAILS_IMPROVEMENT_TASK_TYPE', + StatisticsDomainConstants.ANSWER_DETAILS_IMPROVEMENT_TASK_TYPE); angular.module('oppia').constant( - 'PLAYTHROUGH_IMPROVEMENT_CARD_TYPE', - StatisticsDomainConstants.PLAYTHROUGH_IMPROVEMENT_CARD_TYPE); + 'PLAYTHROUGH_IMPROVEMENT_TASK_TYPE', + StatisticsDomainConstants.PLAYTHROUGH_IMPROVEMENT_TASK_TYPE); angular.module('oppia').constant( - 'FEEDBACK_IMPROVEMENT_CARD_TYPE', - StatisticsDomainConstants.FEEDBACK_IMPROVEMENT_CARD_TYPE); + 'FEEDBACK_IMPROVEMENT_TASK_TYPE', + StatisticsDomainConstants.FEEDBACK_IMPROVEMENT_TASK_TYPE); angular.module('oppia').constant( 'SUBMIT_LEARNER_ANSWER_DETAILS_URL', StatisticsDomainConstants.SUBMIT_LEARNER_ANSWER_DETAILS_URL); angular.module('oppia').constant( - 'SUGGESTION_IMPROVEMENT_CARD_TYPE', - StatisticsDomainConstants.SUGGESTION_IMPROVEMENT_CARD_TYPE); + 'SUGGESTION_IMPROVEMENT_TASK_TYPE', + StatisticsDomainConstants.SUGGESTION_IMPROVEMENT_TASK_TYPE); diff --git a/core/templates/dev/head/domain/statistics/statistics-domain.constants.ts b/core/templates/dev/head/domain/statistics/statistics-domain.constants.ts index 492272fe4ac8..269c46a8c2fa 100644 --- a/core/templates/dev/head/domain/statistics/statistics-domain.constants.ts +++ b/core/templates/dev/head/domain/statistics/statistics-domain.constants.ts @@ -18,10 +18,10 @@ export class StatisticsDomainConstants { public static LEARNER_ACTION_SCHEMA_LATEST_VERSION = 1; - public static ANSWER_DETAILS_IMPROVEMENT_CARD_TYPE = 'answer-details'; - public static PLAYTHROUGH_IMPROVEMENT_CARD_TYPE = 'playthrough'; - public static FEEDBACK_IMPROVEMENT_CARD_TYPE = 'feedback'; + public static ANSWER_DETAILS_IMPROVEMENT_TASK_TYPE = 'answer-details'; + public static PLAYTHROUGH_IMPROVEMENT_TASK_TYPE = 'playthrough'; + public static FEEDBACK_IMPROVEMENT_TASK_TYPE = 'feedback'; public static SUBMIT_LEARNER_ANSWER_DETAILS_URL = '/learneranswerdetailshandler//'; - public static SUGGESTION_IMPROVEMENT_CARD_TYPE = 'suggestion'; + public static SUGGESTION_IMPROVEMENT_TASK_TYPE = 'suggestion'; } diff --git a/core/templates/dev/head/pages/exploration-editor-page/improvements-tab/answer-details-improvement-card/answer-details-improvement-card.directive.html b/core/templates/dev/head/pages/exploration-editor-page/improvements-tab/answer-details-improvement-task/answer-details-improvement-task.directive.html similarity index 73% rename from core/templates/dev/head/pages/exploration-editor-page/improvements-tab/answer-details-improvement-card/answer-details-improvement-card.directive.html rename to core/templates/dev/head/pages/exploration-editor-page/improvements-tab/answer-details-improvement-task/answer-details-improvement-task.directive.html index f771b1cb1e8b..001d89d42ea4 100644 --- a/core/templates/dev/head/pages/exploration-editor-page/improvements-tab/answer-details-improvement-card/answer-details-improvement-card.directive.html +++ b/core/templates/dev/head/pages/exploration-editor-page/improvements-tab/answer-details-improvement-task/answer-details-improvement-task.directive.html @@ -1,6 +1,6 @@
State Name: - + <[getStateName()]>
@@ -12,7 +12,7 @@ diff --git a/core/templates/dev/head/pages/exploration-editor-page/improvements-tab/answer-details-improvement-card/answer-details-improvement-card.directive.ts b/core/templates/dev/head/pages/exploration-editor-page/improvements-tab/answer-details-improvement-task/answer-details-improvement-task.directive.ts similarity index 84% rename from core/templates/dev/head/pages/exploration-editor-page/improvements-tab/answer-details-improvement-card/answer-details-improvement-card.directive.ts rename to core/templates/dev/head/pages/exploration-editor-page/improvements-tab/answer-details-improvement-task/answer-details-improvement-task.directive.ts index db9d6975801a..c3e539bc4f3d 100644 --- a/core/templates/dev/head/pages/exploration-editor-page/improvements-tab/answer-details-improvement-card/answer-details-improvement-card.directive.ts +++ b/core/templates/dev/head/pages/exploration-editor-page/improvements-tab/answer-details-improvement-task/answer-details-improvement-task.directive.ts @@ -13,12 +13,12 @@ // limitations under the License. /** - * @fileoverview Answer details Improvement card directive. + * @fileoverview Answer details Improvement task directive. */ require('domain/utilities/UrlInterpolationService.ts'); -angular.module('oppia').directive('answerDetailsImprovementCard', [ +angular.module('oppia').directive('answerDetailsImprovementTask', [ 'UrlInterpolationService', function(UrlInterpolationService) { return { restrict: 'E', @@ -27,8 +27,8 @@ angular.module('oppia').directive('answerDetailsImprovementCard', [ }, templateUrl: UrlInterpolationService.getDirectiveTemplateUrl( '/pages/exploration-editor-page/improvements-tab/' + - 'answer-details-improvement-card/' + - 'answer-details-improvement-card.directive.html'), + 'answer-details-improvement-task/' + + 'answer-details-improvement-task.directive.html'), controller: ['$scope', function($scope) { $scope.getStateName = function() { return $scope.getData().stateName; diff --git a/core/templates/dev/head/pages/exploration-editor-page/improvements-tab/feedback-improvement-card/feedback-improvement-card.directive.html b/core/templates/dev/head/pages/exploration-editor-page/improvements-tab/feedback-improvement-task/feedback-improvement-task.directive.html similarity index 100% rename from core/templates/dev/head/pages/exploration-editor-page/improvements-tab/feedback-improvement-card/feedback-improvement-card.directive.html rename to core/templates/dev/head/pages/exploration-editor-page/improvements-tab/feedback-improvement-task/feedback-improvement-task.directive.html diff --git a/core/templates/dev/head/pages/exploration-editor-page/improvements-tab/feedback-improvement-card/feedback-improvement-card.directive.ts b/core/templates/dev/head/pages/exploration-editor-page/improvements-tab/feedback-improvement-task/feedback-improvement-task.directive.ts similarity index 92% rename from core/templates/dev/head/pages/exploration-editor-page/improvements-tab/feedback-improvement-card/feedback-improvement-card.directive.ts rename to core/templates/dev/head/pages/exploration-editor-page/improvements-tab/feedback-improvement-task/feedback-improvement-task.directive.ts index 1c8162b51d42..16791a692663 100644 --- a/core/templates/dev/head/pages/exploration-editor-page/improvements-tab/feedback-improvement-card/feedback-improvement-card.directive.ts +++ b/core/templates/dev/head/pages/exploration-editor-page/improvements-tab/feedback-improvement-task/feedback-improvement-task.directive.ts @@ -13,12 +13,12 @@ // limitations under the License. /** - * @fileoverview Feedback Improvement card directive. + * @fileoverview Feedback Improvement task directive. */ require('domain/utilities/UrlInterpolationService.ts'); -angular.module('oppia').directive('feedbackImprovementCard', [ +angular.module('oppia').directive('feedbackImprovementTask', [ 'UrlInterpolationService', function(UrlInterpolationService) { return { restrict: 'E', @@ -27,8 +27,8 @@ angular.module('oppia').directive('feedbackImprovementCard', [ }, templateUrl: UrlInterpolationService.getDirectiveTemplateUrl( '/pages/exploration-editor-page/improvements-tab/' + - 'feedback-improvement-card/' + - 'feedback-improvement-card.directive.html'), + 'feedback-improvement-task/' + + 'feedback-improvement-task.directive.html'), controller: [ '$scope', 'DateTimeFormatService', 'ThreadStatusDisplayService', function($scope, DateTimeFormatService, ThreadStatusDisplayService) { diff --git a/core/templates/dev/head/pages/exploration-editor-page/improvements-tab/improvements-tab.directive.html b/core/templates/dev/head/pages/exploration-editor-page/improvements-tab/improvements-tab.directive.html index 100be869411b..c376746431a0 100644 --- a/core/templates/dev/head/pages/exploration-editor-page/improvements-tab/improvements-tab.directive.html +++ b/core/templates/dev/head/pages/exploration-editor-page/improvements-tab/improvements-tab.directive.html @@ -3,9 +3,9 @@
Open Tasks -

- <[getOpenCardCount()]> + <[getOpenTaskCount()]>

@@ -18,42 +18,42 @@
- + -