Commit Graph

70 Commits

Author SHA1 Message Date
Manoel Quirino Neto 63bea65860 Add import outcome API
flag = improved_outcomes_management
closes OUT-4153

Test Plan:

- Setup some global outcomes
- Execute some queries in the /graphiql
- Import a whole group from global outcomes to account
mutation ImportOutcomes {
  importOutcomes(input: {
    contextId: ACCOUNT_ID,
    contextType: "Account",
    groupId: GROUP_ID
  }) {
    errors {
      attribute
      message
    }
    progress {
      id
    }
  }
}
- Import a whole group from account to course
mutation ImportOutcomes {
  importOutcomes(input: {
    contextId: COURSE_ID,
    contextType: "Course",
    sourceContextId: ACCOUNT_ID,
    sourceContextType: "Account",
    groupId: GROUP_ID
  }) {
    errors {
      attribute
      message
    }
    progress {
      id
    }
  }
}
- Try to import some outcomes replacing groupId to
  outcomeIds: [OUTCOME_ID_1, OUTCOME_ID_2, ... OUTCOME_ID_N]
- You can import outcomes that belongs to differents subgroups,
  but they must have at least one common parent group
- The response must be an empty object in case of success,
  check the ui to see if the groups were imported correctly.

Change-Id: I586fcbce9ccf33db956ff5ef57903bb3f5d7f30b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/259131
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Chrystal Langston <chrystal.langston@instructure.com>
QA-Review: Chrystal Langston <chrystal.langston@instructure.com>
Product-Review: Augusto Callejas <acallejas@instructure.com>
2021-06-30 16:58:36 +00:00
Angela Gomba eb06078671 Handle Global Outcome Links
fixes OUT-4498
flag=none

test plan:
- launch the rails console
- create or find an outcome at the global level, and the group it belongs
to
- create or find a different global group
- call adopt_outcome_link on the group you're moving the outcome to
with the outcome passed in
- observe that this successfully moves the outcome
- check that the group includes the outcome
- check that the original group no longer has the outcome

Change-Id: I6b3f79d03a07862341064d3db9703c49d77a4b15
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/267053
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Pat Renner <prenner@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
QA-Review: Pat Renner <prenner@instructure.com>
Product-Review: Augusto Callejas <acallejas@instructure.com>
2021-06-23 16:58:57 +00:00
Manoel Quirino Neto 21fc4b9d82 Add bulk move outcome link mutation
closes OUT-4401
flag=improved_outcomes_management

Test plan:
  - Navigate to canvas.docker/graphiql
  - Test moving an outcome link using the mutation bellow
    mutation {
      moveOutcomeLinks(input: {
        groupId: DESTINATION_GROUP_ID
        outcomeLinkIds: [OUTCOME_LINK_ID]
      }) {
        movedOutcomeLinkIds
        errors {
          attribute
          message
        }
      }
    }
  - Assertions:
    - Required arguments: groupId, outcomeLinkIds
    - Assert group/outcome links exists on database
    - Assert can manage group/outcome links
    - If you pass one outcome link that can be managed
      and other that can't, assert it moves that one who can
      and check for the correct movedOutcomeLinkIds and errors response

Change-Id: I976255a1dadb9bb5f9fcb0def52a7b623c4538d8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/265297
Reviewed-by: Pat Renner <prenner@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Pat Renner <prenner@instructure.com>
Product-Review: Augusto Callejas <acallejas@instructure.com>
2021-05-25 21:12:21 +00:00
Augusto Callejas 09ed9f1d5f Add source outcome group association
closes OUT-4354

flag=improved_outcomes_management

When importing a learning outcome group from one context
to another, its useful to know what group was copied from,
so this association will help us track that source.

test plan:
  - qa-cr

Change-Id: I642b1db42a685dbd81117c037443241b37b52ed7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262149
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Pat Renner <prenner@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Pat Renner <prenner@instructure.com>
Product-Review: Augusto Callejas <acallejas@instructure.com>
2021-04-07 18:26:44 +00:00
Pablo Marti-Gomez 4c65f3f583 Add cache to Outcomes::LearningOutcomeGroupChildren
Updates Outcomes::LearningOutcomeGroupChildren by adding cache
at the queries for getting the total subgroups and outcomes.

closes OUT-4148
flag=improved_outcomes_management

Test plan:
- Create nested learning outcome groups
- For each nested learning outcome group create learning outcomes
> With FF improved_outcomes_management: OFF
- On Rails console: calls to Outcomes::LearningOutcomeGroupChildren
methods should return a default value
- On web: when generating actions over ContentTag, LearningOutcome
and LearningOutcomeGroup it should not lead to clear any cache
> With FF improved_outcomes_management: ON
- On Rails console: call Outcomes::LearningOutcomeGroupChildren
methods for getting total subgroups and outcomes, queries to the
DB should be made (it will need the root context)
- Call again the same methods, it should return the values from
cache
- Create a new instance of the class and call the same methods,
it should return the values from cache
- Clear the cache with `Rails.cache.clear`
- On web (or through GraphiQL) get the total subgroups and total
outcomes multiple times; it should cache the data and should not
run additional queries
- On web: clear the cache by executing the following actions:
  - Add a Learning Outcome Group
  - Adopt a Learning Outcome Group
  - Copy a Learning Outcome Group from global
  - Remove a Learning Outcome Group
  - Add an Outcome
  - Remove an Outcome
- Get the total subgroups and total outcomes, it should run new
queries
- Run the same tests for global context, it should generate and
clear the cache in the same way

Change-Id: I9b0bfc68b84b3e36869d69a926ef84d9989ea96d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257257
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
QA-Review: Chrystal Langston <chrystal.langston@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
2021-03-17 16:49:37 +00:00
Cody Cutrer f299f76b75 add # frozen_string_literal: true for models
Change-Id: I70825be7ec7e24458afe0c63dc48c5a76158f520
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251150
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2020-10-28 22:08:12 +00:00
Cody Cutrer c5227d3f1b shackles was renamed to guardrail
closes FOO-989, FOO-990

Change-Id: I49dfa130cb74c34dd0eb25952790176ae4951058
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249365
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-10-06 19:23:08 +00:00
Michael Brewer-Davis d35a0a7d92 set root_account_id 0 on global groups
refs OUT-3904

Test plan:
- manually create a global outcome group
    g = LearningOutcomeGroup.create! title: 'Global Group'
- verify that root_account_id is set to 0
    g.root_account_id

Change-Id: I0b94880bced635f7cb35206c0ddbaf5fcd7b9428
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/246977
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
2020-09-21 20:50:08 +00:00
Michael Brewer-Davis 89fc71d6d3 set root_account_id on learning_outcome_results
closes OUT-3640, OUT-3639
flag=none

Test plan:
- create an assignment with rubric aligned
  to an outcome
- assess a student using the rubric
- create a question bank aligned to an outcome
- create a quiz using the question bank
- take the quiz
- verify in the console that the created results
  have root_account_id set
  > LearningOutcomeResult.last(2).map &:root_account_id
  > LearningOutcomeQuestionResult.last.root_account_id

Change-Id: I869b794c9d4859caabaf17717c8ac41f582847e9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240010
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Pat Renner <prenner@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
2020-06-15 17:33:07 +00:00
Xander Moffatt d9c7d3b7cc populate root_account_id on new LearningOutcomeGroup
* prereq for root_account on ContentTag

refs PLAT-5727
flag=none

test plan:
* specs
* if you want, save a LearningOutcomeGroup and observe that
its root_account and root_account_id attributes are not nil

Change-Id: Id268ea78377574cdb3bd2cef4a53bb6b4ca135b1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236478
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
2020-06-08 14:47:58 +00:00
Xander Moffatt ffd3af1b8d Revert "populate root_account_id on new LearningOutcomeGroup"
This reverts commit 4b08149c4f.

Reason for revert: dependent migration g/235224 has not yet been merged

Change-Id: I2573cf4ba67b3962914248d89359d2565548720d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236011
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Tested-by: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
2020-05-06 17:19:02 +00:00
Xander Moffatt 4b08149c4f populate root_account_id on new LearningOutcomeGroup
* prereq for root_account on ContentTag

refs PLAT-5727
flag=none

test plan:
* specs
* if you want, save a LearningOutcomeGroup and observe that
its root_account and root_account_id attributes are not nil

Change-Id: I4f275c75620ad3e77f7eea442dc7bdcf7821543f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/235225
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
2020-05-06 16:28:12 +00:00
Pat Renner b4b065bbe9 Ensure outcome_link live events are emitted during a course copy
refs OUT-3561

flag=none

Test-plan:
- Create a course with an outcome group and another outcome
within that group
- Import that course into another course and ensure
that a outcome_link_created event is emitted via live events
(see live_events.md for details on how to set up/view the
live event logs)

Change-Id: I29005a8d63d713ac5866a0d31ef190af36e092a9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/228388
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Pat Renner <prenner@instructure.com>
2020-03-03 16:08:52 +00:00
Michael Brewer-Davis 4198952be4 collapse AcademicBenchmark columns
refs OUT-1107

flag = none

Test plan:
Check the following operations in canvas:
- manually create outcomes, groups
- import outcomes, groups from csv
- import outcomes, groups from Academic Benchmarks
- course copy with outcomes, groups, and rubrics
- account reports with outcomes export and outcome
  results reports

Change-Id: I15d20d216515d0a29d6a5812ac153dd65a15569b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/221528
Reviewed-by: Frank Murphy <fmurphy@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Augusto Callejas <acallejas@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
2020-01-16 19:54:58 +00:00
Michael Brewer-Davis d6a9564128 ensure root outcome group emits live event
closes OUT-3469

flag = none

Test plan:
- In docker-compose.override.yml, set
    STUB_LIVE_EVENTS_KINESIS: "true"
  in the jobs container's environment config.
- restart canvas
- watch logs of web and jobs containers
  in the console:
    dc logs -f web jobs | grep stubbed_kinesis_stream
- create a course called "Downstream"
- create a course called "Blueprint"
- in Blueprint's settings, enable as a blueprint
  course
- Add course outcomes and groups to the Blueprint course
- In the blueprint sidebar, add Downstream
  as an associated course
- wait a minute for course copy job to run
- verify that a live event is received
  for the Downstream root outcome group
    event_name: learning_outcome_group_created
    title: 'Downstream'
    parent_outcome_group_id: nil

Change-Id: Ie7a46472e68e6a3f054a0ba628d520bf8e106a6f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/223098
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Frank Murphy <fmurphy@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
2020-01-15 16:50:28 +00:00
Pat Renner 6121e6f4db Ensure outcome imports update active records over deleted records
It is possible for multiple outcomes/outcome groups with the same
`vendor_guid` to be present in a given context.
When updating an outcome/group via CSV, we should
always prefer to update an active outcome to restoring a deleted outcome.

fixes OUT-3138

test plan:
- For both an outcome/outcome group, create two records
 with identical `vendor_guid's`. To do this, create two records via CSV
with guids that you define. After importing the CSV, manually update both
records to have the same `vendor_guid`.
- Mark one record as deleted and delete (via CSV)
- When updating a record, ensure only
 the active record is updated

Change-Id: I420a2435255af4bfb807be7d5dd761456151a016
Reviewed-on: https://gerrit.instructure.com/204087
Tested-by: Jenkins
Reviewed-by: Frank Murphy III <fmurphy@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
2019-08-12 13:55:01 +00:00
Rob Orton 9cc199fb04 create on the master
refs CORE-2598

test plan
 - specs should pass

Change-Id: I58a0019c623d9c80b7e7591e0f8701826d953f49
Reviewed-on: https://gerrit.instructure.com/187859
Tested-by: Jenkins
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Mysti Lilla <mysti@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2019-04-02 03:16:06 +00:00
Neil Gupta 34e1361ffb stop touching same models repeatedly or right after creation
fixes OUT-2583

test plan:
* Create an outcome group at the account-level
* Create another outcome group at the course-level
* Add the second outcome group to the first

You can do the last step via UI or in rails console:
a = LearningOutcomeGroup.find(id1)
b = LearningOutcomeGroup.find(id2)
a.add_outcome_group(b)

Everything should work as expected, but the account's updated_at column
is only touched once now

Change-Id: I23f405a4bfc75431f719caec507fc22cd0974484
Reviewed-on: https://gerrit.instructure.com/169952
Tested-by: Jenkins
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Neil Gupta <ngupta@instructure.com>
2018-10-30 19:06:30 +00:00
Frank Murphy 87d6183c6e Fix validations, don't hide database errors.
Fixes OUT-2525

Test Plan:
- Import a CSV with a long (>255 character) vendor_guid.
- Verify that on import, you get an email with an error referencing
  the specific line that failed.

Change-Id: I9b71e937666e404ac70d9ff0014d0f81ce541657
Reviewed-on: https://gerrit.instructure.com/168903
Tested-by: Jenkins
Reviewed-by: Neil Gupta <ngupta@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
QA-Review: Dariusz Dzien <ddzien@instructure.com>
Product-Review: Neil Gupta <ngupta@instructure.com>
2018-10-22 17:59:55 +00:00
Frank Murphy 49dd6e6e46 Handle concurrent destroy / import of outcome groups
Fixes OUT-2336

Test Plan:
- Create or import a group with lots of outcomes and groups.
- Attempt to import that group into another context.
- Immediately open another tab and navigate to the parent group of the
  import.
- Verify that the imported group does not appear currently.
- Reload / wait for the import to finish and group to appear.

Change-Id: Ic97f86201932ff7751914e4cc2f95290b6e1c8b8
Reviewed-on: https://gerrit.instructure.com/157757
Tested-by: Jenkins
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
QA-Review: Matt Berns <mberns@instructure.com>
Product-Review: Sidharth Oberoi <soberoi@instructure.com>
2018-08-02 20:01:16 +00:00
Jeremy Stanley e52032d956 blueprint: don't undelete deleted/unlocked items on sync
- have files, quizzes, learning outcomes, outcome groups,
   and modules in a blueprint course. no items should be
   locked.
 - ensure outcome group changes appear in the unsynced
   changes list correctly
 - sync to an associated course
 - delete items in the associated course
 - change the same items in the blueprint in some way
   (i.e., rename them)
 - re-sync
 - the deleted items should not be undeleted in the
   associated course
 - non-deleted outcome groups should not gain a link
   to a deleted outcome (that shows only in the left pane)

fixes ADMIN-559

Change-Id: Ibe8842353760260b050a6330cd27df986b17b5e7
Reviewed-on: https://gerrit.instructure.com/133374
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2017-11-30 15:53:54 +00:00
James Williams 5059ced17e master courses: fix outcome copying on selective export
test plan:
* have a blueprint course with an associated course
* add an outcome to the blueprint course
* it should copy over to the associated course

closes #MC-290

Change-Id: I7baf402be34541db55bc7291b6ad8d1d5c85aae6
Reviewed-on: https://gerrit.instructure.com/125039
Tested-by: Jenkins
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-09-12 12:13:15 +00:00
Landon Wilkins ba2daaf158 da licença part 13
add consistent license headers to all source files
(ruby, coffeescript, javascript)

except for vendor files

Change-Id: I120ddb74d7f2a34153334b01d3ce2fb77000a631
Reviewed-on: https://gerrit.instructure.com/110034
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-04-27 21:51:17 +00:00
Cody Cutrer a9e5f73d77 rails 5: various selenium fixes
refs CNVS-34865

Change-Id: Id0d2b6b7876942eae7eaed4ba00aac2dce59c323
Reviewed-on: https://gerrit.instructure.com/104647
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-03-10 17:41:36 +00:00
James Williams 89370c5f11 remove protected_attributes
refs #CNVS-32574

Change-Id: I3ba018a7110a7530c9af4a59c97422f626a749b6
Reviewed-on: https://gerrit.instructure.com/99260
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-01-12 17:46:18 +00:00
James Williams 05a534f533 strong params part G-L
refs #CNVS-32574

Change-Id: Ied89f6194ea3f63c546b50d056fe7cbe3a038609
Reviewed-on: https://gerrit.instructure.com/94678
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-01-10 20:58:10 +00:00
Augusto Callejas e4badb2694 Add columns for Academic Benchmarks GUID update
refs OUT-450

test plan:
  - enable Academic Benchmarks using v1 credentials
  - import any set of standards
  - confirm that only vendor_guid and migration_id
    columns in learning_outcomes and learning_outcome_groups
    are populated
  - clear out all outcomes and outcome groups
  - configure Academic Benchmarks using v3 credentials
  - enable the use of the new GUID columns by running the following
    in a Rails console:
    * plugin = Canvas::Plugin.find('academic_benchmark_importer')
    * pluginSettings = PluginSetting.find_by_name(plugin.id)
    * pluginSettings.settings[:new_guid_columns]=true
    * pluginSettings.save!
  - import any set of standards
  - confirm that only vendor_guid_2 and migration_id_2
    columns in learning_outcomes and learning_outcome_groups
    are populated
  - restore the use of the current GUID columns by running
    the following in the previous Rails console:
    * pluginSettings.settings.delete(:new_guid_columns)
    * pluginSettings.save!

Change-Id: I77e5d578a55a0967310208029f1c5225188c3455
Reviewed-on: https://gerrit.instructure.com/98347
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
QA-Review: Cemal Aktas <caktas@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
2017-01-09 18:59:38 +00:00
Matthew Berns a1aeb610fb revert OUT-20
closes OUT-1012

test plan:
- full regression testing of outcomes, including:
creation
deletion
moving
migrating
importing
taking
results
report export

Change-Id: Id0708d9133bab8977e6fcf7f91a56fb25f15b735
Reviewed-on: https://gerrit.instructure.com/97729
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
QA-Review: Alex Ortiz-Rosado <aortiz@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
Tested-by: Matt Berns <mberns@instructure.com>
2016-12-20 00:20:34 +00:00
Jayce Higgins a6b8e392fd increase outcome groups spec coverage and remove unused methods
[ci-coverage]

fixes: OUT-512

test-plan:
  - specs pass
  - make sure nothing removed affected live features

Change-Id: I3038072cd3e75d941c4fde6a97b7bb8f929aec4b
Reviewed-on: https://gerrit.instructure.com/95273
Tested-by: Jenkins
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
QA-Review: Alex Ortiz-Rosado <aortiz@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
2016-12-02 16:44:03 +00:00
Matthew Berns b6f60b4a30 add OutcomeLink model for outcomes and outcome groups
closes OUT-20

test plan:
- full regression testing of outcomes, including:
creation
deletion
moving
migrating
importing
taking
results
report export

Change-Id: I63a5d07358e3b3f9a0537b1ec30c4b0bf44f79e9
Reviewed-on: https://gerrit.instructure.com/91126
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
QA-Review: Alex Ortiz-Rosado <aortiz@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
Tested-by: Matt Berns <mberns@instructure.com>
2016-11-29 21:32:49 +00:00
Cody Cutrer fb64908614 expand "native" polymorphic associations to most polymorphics
Change-Id: I0b2ada85ae6d7b32d2940f5c7db6596b27c3bf84
Reviewed-on: https://gerrit.instructure.com/72282
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-02-22 19:14:31 +00:00
Michael Nomitch 757d9202d8 remove unused constants from canvas models
fixes CNVS-26220

test plan:
  - none

Change-Id: I40e675550e25a8c88795a4ddcd0d05e8470ada69
Reviewed-on: https://gerrit.instructure.com/69752
Tested-by: Jenkins
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
QA-Review: Mike Nomitch <mnomitch@instructure.com>
2016-01-12 17:39:22 +00:00
James Williams 3e1481aa6e rails 4.2: s/destroy!/destroy_permanently!
destroy! is now a method in rails

refs #CNVS-26056

Change-Id: I66e512265ff5cda6a12d7820e3cf69c77ef9e746
Reviewed-on: https://gerrit.instructure.com/69721
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-01-07 14:00:13 +00:00
James Williams 8a41991d74 rails4.2: replace Relation#scoped
either with Relation#all or Association#scope

refs #CNVS-26056

Change-Id: Ie370a3c47c575007ce3b0ba75a122d854e6f8fbc
Reviewed-on: https://gerrit.instructure.com/69497
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-12-30 18:42:04 +00:00
Cody Cutrer 7ea94c5ba8 rails 4 style associations
Change-Id: I0f80aa18ecfb73823368b7abb536d61cc0975c38
Reviewed-on: https://gerrit.instructure.com/67543
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-12-01 20:01:34 +00:00
Cody Cutrer 56ccea56d4 use preload/eager_load instead of includes
refs CNVS-21901

Change-Id: Ie9e1b2778b72f649392d8a1c47c0c86dae0ef19c
Reviewed-on: https://gerrit.instructure.com/58660
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-09-08 20:32:05 +00:00
Cody Cutrer e5e6c8b2ee avoid raw sql updates in several places
refs CNVS-20933

Change-Id: I0e742eecf103ee0bb984fb74a7efe649c7e27df5
Reviewed-on: https://gerrit.instructure.com/56368
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-06-16 16:14:48 +00:00
Cody Cutrer 102fdfc849 no more dynamic finders (models)
refs CNVS-15126

Change-Id: I2996e0e262c41274c34d0ea3bfde757074416b8c
Reviewed-on: https://gerrit.instructure.com/40973
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-09-24 20:51:48 +00:00
Cody Cutrer 1277aaae90 stabby lambda scopes for rails4
Change-Id: I34f2527471cdb4d8cab5cde426ba959baa26189e
Reviewed-on: https://gerrit.instructure.com/37151
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-07-04 02:11:56 +00:00
Braden Anderson 45d19f3003 validate types on polymorphic associations
fixes ALYT-26

test plan:
	* regression test

Change-Id: Ie93e89b842e354f1f76d75f3492145b86c79a035
Reviewed-on: https://gerrit.instructure.com/34560
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
2014-05-28 17:05:34 +00:00
James Williams 413e30a4de only try to import active outcomes and groups
test plan:
* create an account-level outcome group
* create an outcome in that group, but then delete it
* in a course, find and import the account-level group
* should not import a broken outcome link to the deleted outcome

fixes #CNVS-2015

Change-Id: I59d3404038960e156cd7b3e8540df286f27d1569
Reviewed-on: https://gerrit.instructure.com/34797
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2014-05-14 12:31:29 +00:00
Anthus Williams 828981e72c define exportable attributes/associations on models
instead of passing an :exportable option to
ActiveRecord::Associations, simply define a constant
on the class containing exportable associations and
attributes. This is due to :exportable breaking
ActiveRecord, and we can't simply monkey-patch in
config/initializers because models are included in
migrations before the initializers are run

Change-Id: I11f1a6b4570c397d8e01010c517bc6efdac7afca
Reviewed-on: https://gerrit.instructure.com/33235
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
QA-Review: Anthus Williams <awilliams@instructure.com>
2014-05-06 23:54:24 +00:00
James Williams 7692af009a move all importing methods into models/importers
test plan:
* migration regressions

Change-Id: Ibed8d4820c05b9c69101b215932af32055c3e006
Reviewed-on: https://gerrit.instructure.com/33728
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-05-02 17:31:15 +00:00
Cody Cutrer 4b48998179 fix usages of scoped? to check rails 3 style x_values
Change-Id: I75142f6a2d758e1f672a79ecf3c7da69ba5c8f30
Reviewed-on: https://gerrit.instructure.com/29558
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-02-07 15:18:42 +00:00
Raphael Weiner 91944495c2 convert sanitize field plugin into proper gem: CanvasSanitize
Change-Id: I5562a318bb3f52c1374a3a69f288bfb2381f8ee7
Reviewed-on: https://gerrit.instructure.com/29405
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stephan Hagemann <stephan@pivotallabs.com>
Product-Review: Stephan Hagemann <stephan@pivotallabs.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2014-01-28 22:36:18 +00:00
James Williams f360597426 remove unnecessary clone_for methods
Change-Id: I8d80d36bde5dfdcff3de2f86aa3223e6c03a23aa
Reviewed-on: https://gerrit.instructure.com/24771
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
2013-10-09 12:13:18 +00:00
Cody Cutrer d3f0b18684 validate nullness in the db on a bunch of columns
fixes CNVS-7414

Change-Id: I60978f66d88d916dc5736dbb975715172bd1e14b
Reviewed-on: https://gerrit.instructure.com/23141
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-09-12 22:20:39 +00:00
Simon Williams dc36705a0a only touch context once after outcome group delete
fixes CNVS-7045

test plan:
- create an outcome group with some outcomes in it
- delete the group and refresh
- the group should stay deleted
- watch a query log when you delete and make sure the context is only touched
  once, not once per outcome in the group

Change-Id: I656f2685b20959f2096820acc604d940e1f1c63d
Reviewed-on: https://gerrit.instructure.com/22842
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-08-05 17:56:50 +00:00
James Williams 566f023bad add vendor_guid to api for outcomes and outcome groups
test plan:
* confirm that the 'vendor_guid' property is accessible
and editable through the API for outcomes and outcome
groups

* confirm that in the api, if an assignment's rubric
criterion is associated with a learning outcome, that it
returns the vendor guid

closes #CNVS-6387

Change-Id: I28d4cfb42172e69f07a03a398ba15011aaab4f7c
Reviewed-on: https://gerrit.instructure.com/21642
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-06-22 03:21:17 +00:00
Cody Cutrer 8c94e53dc7 arel-ify scopes
s/named_scope/scope/g

refs CNVS-4707

Change-Id: I930d229fc9985c7c0096a0f4888933addd4f3aee
Reviewed-on: https://gerrit.instructure.com/18834
Reviewed-by: Duane Johnson <duane@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-04-01 21:57:16 +00:00