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

Fix #7021: Add a skill tab in the topic viewer #7287

Merged
merged 47 commits into from
Aug 14, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
0db408e
user skill mastery backend
sophiewu6 Jul 21, 2019
975c124
lint
sophiewu6 Jul 21, 2019
afb044a
review changes
sophiewu6 Jul 23, 2019
3008786
lint
sophiewu6 Jul 23, 2019
ea5d418
review changes
sophiewu6 Jul 23, 2019
dfa9bec
lint
sophiewu6 Jul 23, 2019
03edb30
Merge branch 'develop' of https://github.com/oppia/oppia into fronten…
sophiewu6 Jul 24, 2019
ca1405d
review changes
sophiewu6 Jul 24, 2019
50b9be7
lint
sophiewu6 Jul 24, 2019
e992de5
edit docstring
sophiewu6 Jul 26, 2019
19df2d5
Merge branch 'develop' of https://github.com/oppia/oppia into fronten…
sophiewu6 Jul 27, 2019
47e5d5d
Merge branch 'user-skill-mastery' of https://github.com/sophiewu6/opp…
sophiewu6 Jul 27, 2019
c6404ce
review changes
sophiewu6 Jul 27, 2019
b449149
Merge branch 'user-skill-mastery' of https://github.com/sophiewu6/opp…
sophiewu6 Jul 27, 2019
ad613d2
update and show skill mastery
sophiewu6 Jul 28, 2019
709a4df
lint
sophiewu6 Jul 28, 2019
00c6031
lint
sophiewu6 Jul 28, 2019
658d7f6
travis test error and added log in check
sophiewu6 Jul 28, 2019
d986662
lint
sophiewu6 Jul 28, 2019
396bdba
Merge branch 'develop' of https://github.com/oppia/oppia into fronten…
sophiewu6 Jul 29, 2019
d11e885
fix for e2e test
sophiewu6 Jul 29, 2019
a0ab30d
changed file name
sophiewu6 Jul 29, 2019
029526e
review changes
sophiewu6 Jul 29, 2019
7e29fa8
review changes
sophiewu6 Jul 30, 2019
fa2eba7
review changes and small bug fix
sophiewu6 Jul 30, 2019
00031ae
lint
sophiewu6 Jul 30, 2019
7b1a384
merge with develop
sophiewu6 Jul 30, 2019
ba956fa
added new line at the end of files
sophiewu6 Jul 30, 2019
a6291aa
reverted changes to constants.js
sophiewu6 Jul 30, 2019
75c41be
review changes
sophiewu6 Jul 31, 2019
7a98672
added skill tab
sophiewu6 Aug 3, 2019
71664bb
lint
sophiewu6 Aug 4, 2019
2872a06
merged with develop
sophiewu6 Aug 4, 2019
b1b4a2e
lint
sophiewu6 Aug 4, 2019
a6d16f1
merged with develop
sophiewu6 Aug 4, 2019
d36dab5
review changes and frontend test
sophiewu6 Aug 5, 2019
8766255
merged with develop
sophiewu6 Aug 5, 2019
61d2885
review changes
sophiewu6 Aug 6, 2019
6d668ba
codeowner
sophiewu6 Aug 6, 2019
9a24864
merged
sophiewu6 Aug 6, 2019
22f7b92
lint
sophiewu6 Aug 6, 2019
1f743cf
review changes
sophiewu6 Aug 7, 2019
deda6da
merged with develop
sophiewu6 Aug 7, 2019
de47c02
merged with develop
sophiewu6 Aug 12, 2019
0cd3979
review comments
sophiewu6 Aug 13, 2019
3107f1e
lint
sophiewu6 Aug 13, 2019
b5e5497
minor change
sophiewu6 Aug 13, 2019
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
review changes
  • Loading branch information
sophiewu6 committed Aug 7, 2019
commit 1f743cf14a69247a873b55f14a9b943ad794f56b
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="skills">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name this class such that it starts with oppia- to make it specific. ditto elsewhere

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

<h3 class="form-heading"> Skills included in this topic </h3>
<h4 ng-if="!$ctrl.userIsLoggedIn" style="color: gray;"> Please login to view your skill mastery. </h4>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add style through classname. (ditto elsewhere.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

<table class="skill-mastery-table" ng-if="$ctrl.sortedSkillIds.length > 0">
<table class="skill-mastery-table" ng-if="$ctrl.skillIdsAndMastery.length > 0">
<colgroup>
<col style="width: 40%;">
<col style="width: 60%">
Expand All @@ -16,19 +16,19 @@ <h4 ng-if="!$ctrl.userIsLoggedIn" style="color: gray;"> Please login to view you
Skill Mastery
</th>
</tr>
<tr ng-repeat="skillId in $ctrl.sortedSkillIds"
<tr ng-repeat="item in $ctrl.skillIdsAndMastery | orderBy: '-mastery'"
class="list-item"
style="height: 4em;"
ng-click="$ctrl.openConceptCardModal(skillId)">
<td> <[$ctrl.getSkillDescriptions()[skillId]]> </td>
ng-click="$ctrl.openConceptCardModal(item.skillId)">
<td> <[$ctrl.getSkillDescriptions()[item.skillId]]> </td>
<td>
<div class="oppia-skill-mastery-container">
<div class="score-bar" style="width: <[$ctrl.getMasteryPercentage($ctrl.getDegreesOfMastery()[skillId])]>%; background: <[$ctrl.getColorForMastery($ctrl.getDegreesOfMastery()[skillId])]>"></div>
<div class="score-bar" style="width: <[$ctrl.getMasteryPercentage($ctrl.getDegreesOfMastery()[item.skillId])]>%; background: <[$ctrl.getColorForMastery($ctrl.getDegreesOfMastery()[item.skillId])]>"></div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks complicated, can we use ng-style or some other way to make it look simple?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

</div>
</td>
</tr>
</table>
<h4 ng-if="$ctrl.sortedSkillIds.length === 0" style="color: gray;">
<h4 ng-if="$ctrl.skillIdsAndMastery.length === 0" style="color: gray;">
No skill is assigned to this topic.
</h4>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,14 @@ angular.module('oppia').directive('skillsMasteryList', [
});
ctrl.sortedSkillIds = [];

var sortSkillIdsByMastery = function() {
var degreesOfMastery = ctrl.getDegreesOfMastery();
var skillIdsAndMastery =
Object.keys(degreesOfMastery).map(function(skillId) {
return [skillId, degreesOfMastery[skillId]];
});
skillIdsAndMastery.sort(function(first, second) {
return second[1] - first[1];
var degreesOfMastery = ctrl.getDegreesOfMastery();
ctrl.skillIdsAndMastery =
Object.keys(degreesOfMastery).map(function(skillId) {
return {
skillId: skillId,
mastery: degreesOfMastery[skillId]
};
});
skillIdsAndMastery.forEach(function(skillIdAndMastery) {
ctrl.sortedSkillIds.push(skillIdAndMastery[0]);
});
};

sortSkillIdsByMastery();

ctrl.getMasteryPercentage = function(degreeOfMastery) {
return Math.round(degreeOfMastery * 100);
Expand Down