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

Conversation

sophiewu6
Copy link
Contributor

@sophiewu6 sophiewu6 commented Aug 4, 2019

Explanation

This PR aims to add a skill tab to display all skills and their skill mastery in the topic.
Screen Shot 2019-08-02 at 3 23 18 PM
The skills are sorted based on their skill mastery degrees.
Screen Shot 2019-08-03 at 4 36 11 PM
When the user is not logged in, all skill mastery appear to be None.

Checklist

  • The PR title starts with "Fix #bugnum: ", followed by a short, clear summary of the changes. (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • The PR explanation includes the words "Fixes #bugnum: ..." (or "Fixes part of #bugnum" if the PR only partially fixes an issue).
  • The linter/Karma presubmit checks have passed.
    • These should run automatically, but if not, you can manually trigger them locally using python scripts/pre_commit_linter.py and bash scripts/run_frontend_tests.sh.
  • The PR is made from a branch that's not called "develop".
  • The PR has an appropriate "PROJECT: ..." label (Please add this label for the first-pass review of the PR).
  • The PR has an appropriate "CHANGELOG: ..." label (If you are unsure of which label to add, ask the reviewers for guidance).
  • The PR follows the style guide.
  • The PR addresses the points mentioned in the codeowner checks for the files/folders changed. (See the codeowner's wiki page.)
  • The PR is assigned to an appropriate reviewer.
    • If you're a new contributor, please ask on Gitter for someone to assign a reviewer and don't tick this checkbox.
    • If you're not sure who the appropriate reviewer is, please assign to the issue's "owner" -- see the "talk-to" label on the issue. Do not only request the review but also add the reviewer as an assignee.

Copy link
Contributor

@vinitamurthi vinitamurthi left a 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!

Copy link
Member

@DubeySandeep DubeySandeep left a 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">
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.

<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>
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.

<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>
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>

<style>
skills-mastery-list .oppia-page-card {
Copy link
Member

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)

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.

<style>
skills-mastery-list .oppia-page-card {
margin-top: 2%;
margin-left: 10%;
Copy link
Member

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.)

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.

var ctrl = this;
ctrl.userIsLoggedIn = null;
UserService.getUserInfoAsync().then(function(userInfo) {
ctrl.canCreateCollections = userInfo.canCreateCollections();
Copy link
Member

Choose a reason for hiding this comment

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

make it userCanCreateCollection*

Copy link
Contributor Author

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">
Copy link
Member

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?

Copy link
Contributor Author

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.

@DubeySandeep DubeySandeep removed their assignment Aug 10, 2019
* @fileoverview Constants for the skills mastery list.
*/

angular.module('oppia').constant('MASTERY_CUTOFF', {
Copy link
Contributor

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.

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.

@@ -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
Copy link
Contributor

@aks681 aks681 Aug 11, 2019

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This part is removed.

@aks681
Copy link
Contributor

aks681 commented Aug 11, 2019

@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?

@aks681 aks681 assigned sophiewu6 and unassigned aks681 Aug 11, 2019
@seanlip
Copy link
Member

seanlip commented Aug 11, 2019

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".

@vinitamurthi
Copy link
Contributor

@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
Copy link
Contributor Author

@aks681 @seanlip I am confused about the 'Play', 'Train', and 'Review' tabs. From what I saw, there are only two tabs ('Story' and "Practice') right now. Also, I didn't see "menu of skills to choose from".

@aks681
Copy link
Contributor

aks681 commented Aug 11, 2019

@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.

@seanlip
Copy link
Member

seanlip commented Aug 11, 2019

@vinitamurthi Yep, that's the one I mean!

@sophiewu6
Copy link
Contributor Author

@aks681 Sounds good. I will make the changes after the PR is merged.

@oppiabot
Copy link

oppiabot bot commented Aug 12, 2019

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!

@aks681
Copy link
Contributor

aks681 commented Aug 12, 2019

@sophiewu6 The PR is merged now

@sophiewu6 sophiewu6 assigned aks681 and unassigned sophiewu6 Aug 13, 2019
@sophiewu6
Copy link
Contributor Author

@aks681 Comments are addressed. PTAL!

@sophiewu6 sophiewu6 changed the title Add a skill tab in the topic viewer Fix #7021: Add a skill tab in the topic viewer Aug 13, 2019
@aks681 aks681 merged commit 36a4e23 into oppia:develop Aug 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants