-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Conversation
…d-skill-mastery
…d-skill-mastery
… into frontend-skill-mastery
… into frontend-skill-mastery
…d-skill-mastery
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.
Looks good! @aks681 @DubeySandeep please take a look!
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.
@sophiewu6, PR looks good to me, left a few simple comments! (Approved!)
Note: I haven't reviewed the UI!
@@ -0,0 +1,107 @@ | |||
<div class="oppia-skills-list-container"> | |||
<md-card class="oppia-page-card oppia-long-text"> | |||
<div class="skills"> |
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.
name this class such that it starts with oppia-
to make it specific. ditto elsewhere
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.
<md-card class="oppia-page-card oppia-long-text"> | ||
<div class="skills"> | ||
<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> |
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.
Add style through classname. (ditto elsewhere.)
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.
<td> <[$ctrl.getSkillDescriptions()[item.skillId]]> </td> | ||
<td> | ||
<div class="oppia-skill-mastery-container"> | ||
<div class="score-bar" style="width: <[$ctrl.getMasteryPercentage($ctrl.getDegreesOfMastery()[item.skillId])]>%; background: <[$ctrl.getColorForMastery($ctrl.getDegreesOfMastery()[item.skillId])]>"></div> |
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.
this looks complicated, can we use ng-style or some other way to make it look simple?
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.
</div> | ||
|
||
<style> | ||
skills-mastery-list .oppia-page-card { |
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.
indent by 2. (ditto elsewhere)
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.
<style> | ||
skills-mastery-list .oppia-page-card { | ||
margin-top: 2%; | ||
margin-left: 10%; |
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.
Arrange in alphabetic order. (Ditto elsewhere.)
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.
var ctrl = this; | ||
ctrl.userIsLoggedIn = null; | ||
UserService.getUserInfoAsync().then(function(userInfo) { | ||
ctrl.canCreateCollections = userInfo.canCreateCollections(); |
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.
make it userCanCreateCollection*
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.
Uh, actually this is not needed for this PR. I have removed that.
@@ -21,6 +26,9 @@ | |||
<div ng-if="$ctrl.activeTab === 'practice'" class="oppia-practice-tab"> | |||
<practice-tab topic-name="$ctrl.topicName"></practice-tab> | |||
</div> | |||
<div ng-if="$ctrl.activeTab === 'skill'" class="oppia-skill-tab"> |
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.
Do we have a constant for "skill" if yes then let's use it as I see "skill" string is used in multiple places in this file?
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.
This part is removed due to @aks681 's comment.
* @fileoverview Constants for the skills mastery list. | ||
*/ | ||
|
||
angular.module('oppia').constant('MASTERY_CUTOFF', { |
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.
With the latest develop, this should be split into *constants.ts
and *constants.ajs.ts
files. You can check some existing files like topic-viewer-domain.constants.ts
and topic-viewer-domain.constants.ajs.ts
.
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.
@@ -13,6 +13,11 @@ | |||
<a class="oppia-topic-viewer-tabs-text" ng-click="$ctrl.setActiveTab('practice')" translate="I18N_TOPIC_VIEWER_PRACTICE"> | |||
</a> | |||
</span> | |||
<span ng-class="{'oppia-topic-viewer-tabs-active': $ctrl.activeTab === 'skill'}"> | |||
<a class="oppia-topic-viewer-tabs-text" ng-click="$ctrl.setActiveTab('skill')"> | |||
Skills |
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.
This should be added as a constant to the translation files (en.json and qqq.json), since it is user facing header.
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.
This part is removed.
@seanlip Since we renamed the other tabs to be 'Play', 'Train' and 'Review' (for the subtopic pages tab), should we have a similar name here also, or is 'Skills' fine? |
How about having it be part of the Train tab, somehow? Keeping those three tabs at the top (Play/Train/Review) is nice and I think the point where viewing skill mastery is the most relevant would be when you're training. Maybe it can be below the existing "menu of skills to choose from". |
@aks681 @seanlip By 'Train' do you mean the current 'Practice' tab? If so, I do like that idea because the current practice tab just has a single button and is pretty empty. @sophiewu6 FYI |
@sophiewu6 Yeah, the old "Story" tab is renamed to "Play" and "Practice" to "Train". I am adding the subtopic pages in #7354, which goes into the "Review" tab. The renaming is done in that PR and should be merged in a few hours. |
@vinitamurthi Yep, that's the one I mean! |
@aks681 Sounds good. I will make the changes after the PR is merged. |
Hi @sophiewu6. Due to recent changes in the "develop" branch, this PR now has a merge conflict. Please follow this link if you need help resolving the conflict, so that the PR can be merged. Thanks! |
@sophiewu6 The PR is merged now |
@aks681 Comments are addressed. PTAL! |
Explanation
This PR aims to add a skill tab to display all skills and their skill mastery in the topic.
The skills are sorted based on their skill mastery degrees.
When the user is not logged in, all skill mastery appear to be None.
Checklist
python scripts/pre_commit_linter.py
andbash scripts/run_frontend_tests.sh
.