Skip to content

Metrics included/excluded categories#1507

Merged
xinyis991105 merged 29 commits into
masterfrom
metrics-config-frontend
May 3, 2022
Merged

Metrics included/excluded categories#1507
xinyis991105 merged 29 commits into
masterfrom
metrics-config-frontend

Conversation

@ashleyzhang

@ashleyzhang ashleyzhang commented Apr 26, 2022

Copy link
Copy Markdown
Contributor

Screen Shot 2022-04-26 at 5 56 49 PM

Description

Add a configurations tab to metrics feature that includes a "Considered Categories" section enabling professors to decide what assessment categories are or are not included in watchlist calculations.

Motivation and Context

Some courses have optional assessments that do not factor into determining whether or not a student is at risk. Allowing instructors to exclude a category of assessments reduces false positive rates for students appearing in the watchlist.

How Has This Been Tested?

Navigate to the configurations tab in the student metrics dashboard. Exclude a category in the watchlist, and save the changes. Ensure that the change is reflected in the watchlist.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have run rubocop for style check. If you haven't, run overcommit --install && overcommit --sign to use pre-commit hook for linting
  • My change requires a change to the documentation, which is located at Autolab Docs
  • I have updated the documentation accordingly, included in this PR

Other issues / help required

If unsure, feel free to submit first and we'll help you along.

@xinyis991105 xinyis991105 mentioned this pull request Apr 28, 2022
6 tasks
@victorhuangwq

Copy link
Copy Markdown
Contributor

Note: this change requires rails migration

@victorhuangwq

Copy link
Copy Markdown
Contributor

Tested. It seems like the default behavior for when you resolve and then change the configuration is to archive everything (just like a change of metrics). Is that intended behavior?

@victorhuangwq victorhuangwq left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Left some comments with regards to schema.rb. Apart from that tested the functionality of the feature and it works as expected. Looks fantastic btw :)

Comment thread db/schema.rb Outdated
t.datetime "resolved_at"
t.integer "resource_owner_id"
t.string "access_code"
t.index ["application_id"], name: "fk_rails_4035c6e0ed"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this seems to be a bit odd to push up @ashleyzhang, as this looks like a config?

Comment thread db/schema.rb Outdated
ActiveRecord::Schema.define(version: 2022_04_04_193451) do

create_table "annotations", force: :cascade do |t|
create_table "annotations", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this DB options are MySQL specific. I wonder if there's a way to not push this up?

Comment thread db/schema.rb Outdated
t.datetime "created_at", null: false
t.datetime "revoked_at"
t.string "scopes"
t.index ["application_id"], name: "fk_rails_b4b53e07b8"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Similarly here, as this looks like a configuration key . Is this a normal thing to do?

Comment thread db/schema.rb Outdated
t.datetime "created_at", null: false
t.string "scopes"
t.string "previous_refresh_token", default: "", null: false
t.index ["application_id"], name: "fk_rails_732cb83ab7"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Similarly here

@xinyis991105

Copy link
Copy Markdown
Contributor

Tested. It seems like the default behavior for when you resolve and then change the configuration is to archive everything (just like a change of metrics). Is that intended behavior?

Yes this is expected! Currently a change in metrics config has the same effect on watchlist instances as a change in risk conditions, i.e. refreshing the list, archiving old instances.

@xinyis991105

Copy link
Copy Markdown
Contributor

In addition, I've had some misunderstanding of the use of the word "allowlist" and currently allowlist contains all the categories that are not considered in the calculation of metrics. Do we want to change this to blocklist afterwards?

@victorhuangwq

Copy link
Copy Markdown
Contributor

I think that would be confusing - would it be possible to change that in this PR? I'm afraid we might forget that later

@xinyis991105

Copy link
Copy Markdown
Contributor

I think that would be confusing - would it be possible to change that in this PR? I'm afraid we might forget that later

See the latest changes. I rollbacked and changed the relevant migration file instead of writing another migration file for renaming.

@victorhuangwq victorhuangwq left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Did a rails db:reset and utilized the new schema. Feature works as expected. Refactor looks fine.
LGTM!

@xinyis991105 xinyis991105 merged commit 2f394c6 into master May 3, 2022
@xinyis991105 xinyis991105 deleted the metrics-config-frontend branch May 3, 2022 15:19
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.

3 participants