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
Learner dashboard 3.2 #3759
Learner dashboard 3.2 #3759
Changes from 1 commit
f7af522
2e6a78d
58bf6b3
ab3adf9
af9c34c
bb5692c
d0526be
747d7ec
24b58a6
20534ab
98eba4c
82819c2
d74947d
6a044ea
1861d4c
eeeeab2
3aaade0
26dca72
6e37110
55d0131
ac24e6d
35506ca
e792b12
8e02036
1f9287e
08c77d4
3a2669c
8baaeab
84e1588
0fa0688
004900e
9b507b0
dc2f6f7
95be238
fe3dc66
4e77eb6
c16db90
b51066c
577544a
c50e398
5a5c5e7
e349e45
dfce5d3
c96d704
924268d
3f866f0
0a2c049
881d846
43ac635
6fa3718
7d96b5c
45a4cb3
f5c8882
4c63a1c
2dd1286
ada0a9d
aff0b0c
aea81d2
2667e96
883b938
2f0fcfc
43d193e
5523dbe
a4b64b8
fec579a
e0d7e7d
c53fc5b
6897721
921c586
1299523
ae86749
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -960,10 +960,10 @@ def get_activity_progress(user_id): | |
user_id: str. The id of the learner. | ||
|
||
Returns: | ||
LearnerProgress. The learner progress domain object corresponding to the | ||
particular learner. | ||
dict. The numbers of the activities that are no longer present. It | ||
contains four keys: | ||
(LearnerProgress, dict, list(str)). The first return value is the | ||
learner progress domain object corresponding to the particular | ||
learner. The second return value is the numbers of the activities | ||
that are no longer present. It contains four keys: | ||
- incomplete_explorations: int. The number of incomplete | ||
explorations no longer present. | ||
- incomplete_collections: int. The number of incomplete collections | ||
|
@@ -972,9 +972,8 @@ def get_activity_progress(user_id): | |
no longer present. | ||
- completed_collections: int. The number of completed collections no | ||
longer present. | ||
list(str). The titles of the collections to which new explorations have | ||
been added. | ||
|
||
The third return valus is the titles of the collections to which new | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. valus --> value There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done! |
||
explorations have been added. | ||
""" | ||
activity_ids_in_learner_dashboard = ( | ||
get_learner_dashboard_activities(user_id)) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,7 @@ oppia.directive('collectionSummaryTile', [ | |
getThumbnailBgColor: '&thumbnailBgColor', | ||
isLinkedToEditorPage: '=?isLinkedToEditorPage', | ||
getCategory: '&category', | ||
isPlaylistMode: '&playlistMode', | ||
isPlaylistTile: '&playlistTile', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you want the actual directive attr name to also be is-playlist-tile, otherwise it's as though it's naming the playlist tile that's being passed in. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done! |
||
showLearnerDashboardIconsIfPossible: ( | ||
'&showLearnerDashboardIconsIfPossible') | ||
}, | ||
|
@@ -44,9 +44,9 @@ oppia.directive('collectionSummaryTile', [ | |
'collection_summary_tile_directive.html'), | ||
controller: [ | ||
'$scope', 'oppiaDatetimeFormatter', | ||
'COLLECTION_VIEWER_URL', 'COLLECTION_EDITOR_URL', function($scope, | ||
oppiaDatetimeFormatter, COLLECTION_VIEWER_URL, | ||
COLLECTION_EDITOR_URL) { | ||
'COLLECTION_VIEWER_URL', 'COLLECTION_EDITOR_URL', function( | ||
$scope, oppiaDatetimeFormatter, | ||
COLLECTION_VIEWER_URL, COLLECTION_EDITOR_URL) { | ||
$scope.userIsLoggedIn = GLOBALS.userIsLoggedIn; | ||
$scope.DEFAULT_EMPTY_TITLE = 'Untitled'; | ||
$scope.ACTIVITY_TYPE_COLLECTION = constants.ACTIVITY_TYPE_COLLECTION; | ||
|
@@ -76,9 +76,8 @@ oppia.directive('collectionSummaryTile', [ | |
return UrlInterpolationService.getStaticImageUrl(url); | ||
}; | ||
|
||
$scope.collectionIsActive = false; | ||
$scope.toggleCollectionIsActive = function() { | ||
$scope.collectionIsActive = !$scope.collectionIsActive; | ||
$scope.setHoverState = function(hoverState) { | ||
$scope.collectionIsCurrentlyHoveredOver = hoverState; | ||
}; | ||
} | ||
] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,7 @@ oppia.directive('explorationSummaryTile', [ | |
// if it is not specified, it is treated as 0, which means that the | ||
// desktop version of the summary tile is always displayed. | ||
mobileCutoffPx: '@mobileCutoffPx', | ||
isPlaylistMode: '&playlistMode', | ||
isPlaylistTile: '&playlistTile', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done! |
||
showLearnerDashboardIconsIfPossible: ( | ||
'&showLearnerDashboardIconsIfPossible') | ||
}, | ||
|
@@ -118,9 +118,8 @@ oppia.directive('explorationSummaryTile', [ | |
|
||
$scope.MAX_AVATARS_TO_DISPLAY = 5; | ||
|
||
$scope.explorationIsActive = false; | ||
$scope.toggleExplorationIsActive = function() { | ||
$scope.explorationIsActive = !$scope.explorationIsActive; | ||
$scope.setHoverState = function(hoverState) { | ||
$scope.explorationIsCurrentlyHoveredOver = hoverState; | ||
}; | ||
|
||
$scope.getAverageRating = function() { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
// Copyright 2016 The Oppia Authors. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS-IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
/** | ||
* @fileoverview Tests for LearnerDashboardActivityIdsObjectFactory. | ||
*/ | ||
|
||
describe('Learner dashboard activity ids object factory', function() { | ||
var LearnerDashboardActivityIdsObjectFactory = null; | ||
|
||
beforeEach(module('oppia')); | ||
|
||
beforeEach(inject(function($injector) { | ||
LearnerDashboardActivityIdsObjectFactory = $injector.get( | ||
'LearnerDashboardActivityIdsObjectFactory'); | ||
})); | ||
|
||
var learnerDashboardActivityIdsDict = { | ||
incomplete_exploration_ids: ['0', '1'], | ||
incomplete_collection_ids: ['2', '3'], | ||
completed_exploration_ids: ['4', '5'], | ||
completed_collection_ids: ['6', '7'], | ||
exploration_playlist_ids: ['8', '9'], | ||
collection_playlist_ids: ['10', '11'] | ||
}; | ||
|
||
it('should check if activity id is present among learner dashboard ' + | ||
' activity ids', function() { | ||
var learnerDashboardActivityIds = ( | ||
LearnerDashboardActivityIdsObjectFactory.createFromBackendDict( | ||
learnerDashboardActivityIdsDict)); | ||
|
||
expect(learnerDashboardActivityIds.includesActivity('0')).toEqual(true); | ||
expect(learnerDashboardActivityIds.includesActivity('1')).toEqual(true); | ||
expect(learnerDashboardActivityIds.includesActivity('8')).toEqual(true); | ||
|
||
expect(learnerDashboardActivityIds.includesActivity('12')).toEqual(false); | ||
expect(learnerDashboardActivityIds.includesActivity('13')).toEqual(false); | ||
expect(learnerDashboardActivityIds.includesActivity('14')).toEqual(false); | ||
}); | ||
|
||
|
||
it('should add exploration to learner playlist', function() { | ||
var learnerDashboardActivityIds = ( | ||
LearnerDashboardActivityIdsObjectFactory.createFromBackendDict( | ||
learnerDashboardActivityIdsDict)); | ||
|
||
learnerDashboardActivityIds.addToExplorationLearnerPlaylist('12'); | ||
expect(learnerDashboardActivityIds.explorationPlaylistIds).toEqual( | ||
['8', '9', '12']); | ||
|
||
learnerDashboardActivityIds.addToExplorationLearnerPlaylist('13'); | ||
expect(learnerDashboardActivityIds.explorationPlaylistIds).toEqual( | ||
['8', '9', '12', '13']); | ||
}); | ||
|
||
it('should add collection to learner playlist', function() { | ||
var learnerDashboardActivityIds = ( | ||
LearnerDashboardActivityIdsObjectFactory.createFromBackendDict( | ||
learnerDashboardActivityIdsDict)); | ||
|
||
learnerDashboardActivityIds.addToCollectionLearnerPlaylist('12'); | ||
expect(learnerDashboardActivityIds.collectionPlaylistIds).toEqual( | ||
['10', '11', '12']); | ||
|
||
learnerDashboardActivityIds.addToCollectionLearnerPlaylist('13'); | ||
expect(learnerDashboardActivityIds.collectionPlaylistIds).toEqual( | ||
['10', '11', '12', '13']); | ||
}); | ||
|
||
it('should remove exploration from learner playlist', function() { | ||
var learnerDashboardActivityIds = ( | ||
LearnerDashboardActivityIdsObjectFactory.createFromBackendDict( | ||
learnerDashboardActivityIdsDict)); | ||
|
||
learnerDashboardActivityIds.removeFromExplorationLearnerPlaylist('9'); | ||
expect(learnerDashboardActivityIds.explorationPlaylistIds).toEqual( | ||
['8', '12', '13']); | ||
|
||
learnerDashboardActivityIds.removeFromExplorationLearnerPlaylist('8'); | ||
expect(learnerDashboardActivityIds.explorationPlaylistIds).toEqual( | ||
['12', '13']); | ||
}); | ||
|
||
it('should remove collection from learner playlist', function() { | ||
var learnerDashboardActivityIds = ( | ||
LearnerDashboardActivityIdsObjectFactory.createFromBackendDict( | ||
learnerDashboardActivityIdsDict)); | ||
|
||
learnerDashboardActivityIds.removeFromCollectionLearnerPlaylist('11'); | ||
expect(learnerDashboardActivityIds.collectionPlaylistIds).toEqual( | ||
['10', '12', '13']); | ||
|
||
learnerDashboardActivityIds.removeFromCollectionLearnerPlaylist('10'); | ||
expect(learnerDashboardActivityIds.collectionPlaylistIds).toEqual( | ||
['12', '13']); | ||
}); | ||
|
||
it('should fetch the learner dashboard activity ids domain object from the ' + | ||
' backend summary dict', function() { | ||
var learnerDashboardActivityIdsDict = { | ||
incomplete_exploration_ids: ['0', '1'], | ||
incomplete_collection_ids: ['2', '3'], | ||
completed_exploration_ids: ['4', '5'], | ||
completed_collection_ids: ['6', '7'], | ||
exploration_playlist_ids: ['8', '9'], | ||
collection_playlist_ids: ['10', '11'] | ||
}; | ||
|
||
var learnerDashboardActivityIds = ( | ||
LearnerDashboardActivityIdsObjectFactory.createFromBackendDict( | ||
learnerDashboardActivityIdsDict)); | ||
|
||
expect(learnerDashboardActivityIds.incompleteExplorationIds).toEqual( | ||
['0', '1']); | ||
expect(learnerDashboardActivityIds.incompleteCollectionIds).toEqual( | ||
['2', '3']); | ||
expect(learnerDashboardActivityIds.completedExplorationIds).toEqual( | ||
['4', '5']); | ||
expect(learnerDashboardActivityIds.completedCollectionIds).toEqual( | ||
['6', '7']); | ||
expect(learnerDashboardActivityIds.explorationPlaylistIds).toEqual( | ||
['8', '9']); | ||
expect(learnerDashboardActivityIds.collectionPlaylistIds).toEqual( | ||
['10', '11']); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like I shouldn't have to comment on this in three separate passes, but there are still three return values here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!