Commit Graph

45 Commits

Author SHA1 Message Date
Landon Wilkins e5ca22c923 da licença part 5
add consistent license headers to all source files
(ruby, coffeescript, javascript)

except for vendor files

Change-Id: If23fe3b449317df66cf4b0f52629d7fbe851e948
Reviewed-on: https://gerrit.instructure.com/110025
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:30:43 +00:00
Cody Cutrer 556f0b64bf rails 5: s/_filter/_action/g
fixes CNVS-34832

the arguments to these methods have not changed, just their names. and the
new methods became available in Rails 4, so we can start using them now

and prevent someone from doing old-style in the future

Change-Id: I61aa5512995dc8f25f3f7bd009a6cfa0a030e274
Reviewed-on: https://gerrit.instructure.com/101401
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-02-09 23:03:40 +00:00
James Williams a9fab4f4af remove strong_params
refs #CNVS-32574

Change-Id: I4e255b989f8ad3fc6ec2f2699d4950dc0e5a419a
Reviewed-on: https://gerrit.instructure.com/99483
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-13 12:49:15 +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
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
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
Jim Simon d7405f36f8 Add popover menu and modal dialog for outcomes landing page
fixes: OUT-465

test plan:
 - login as a user who can manage rubrics
 - go to the Outcomes page
 - verify that the "Manage Rubrics" button has been replaced with a menu
 - verify that the menu contains a "Manage Rubrics" option
 - switch to a user that doesn't have permission to manage rubrics
 - verify that the menu does not show up
 - Note: the "Add to course" option mentioned in the ticket is currently
   disabled since we don't want incomplete functionality accidentally
   going to production.  This button will get tested in the next card or
   two for this epic.

Change-Id: Ib4a8d7a30f2bccd0dfd2442ad7ba89c2c66044e9
Reviewed-on: https://gerrit.instructure.com/93638
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
Tested-by: Jenkins
QA-Review: Cemal Aktas <caktas@instructure.com>
Product-Review: McCall Smith <mcsmith@instructure.com>
2016-11-16 18:34:59 +00:00
James Williams a4bf5cb21d use multi-column plucks some more
Change-Id: Ifc1589c3457677b94917263f91b9759593939700
Reviewed-on: https://gerrit.instructure.com/89125
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-08-30 16:51:51 +00:00
Jacob Fugal 78258f420a include JWT in js ENV for RCS sidebar
test-plan:
 - visit an RCE page
 - ENV.JWT in the web console should be set

Change-Id: I63e5d6750732a4a9ff0fed04e915b60e85c9f58b
Reviewed-on: https://gerrit.instructure.com/74789
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2016-03-30 18:03:11 +00:00
Ethan Vizitei 6889c3fef1 Syllabus RCE
closes CNVS-27638
closes CNVS-27733

Start RCE service integration with granular
feature flags for sidebar areas

Also fix some items in the RCE abstraction
layer for graceful fallback, and refactors
abstraction layer for injecting context
both for testing and for use cases
that perform the same wrapper work
over and over.

TEST PLAN:
 1) regression test creating a syllabus (should not break)
 2) with RCE service in the mix and the RICH_CONTENT_SIDEBAR_ENABLED
    flag on (the medium risk flag), side bar should show replaced
    by dummy sidebar from RCE service
 3) note that we do not expect the sidebar to be functional yet
    with the service, this is just making sure we can flip the
    switch, and didn't break syllabus in the process

Change-Id: I775669214b2541b037daf0c55caa00e452487927
Reviewed-on: https://gerrit.instructure.com/73426
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2016-03-08 17:00:31 +00:00
Michael Brewer-Davis 2e4ec219c3 fix user outcome results for accounts
- Workaround of rails bug affecting account.all_users.find

Fixes CNVS-26170

Test plan:
As account admin:
1.  ensure account has student users and outcomes
2.  go to the user page for a student user
3.  click "See Outcome Results for ..."
4.  Verify that the page shows a table of outcome results
    instead of a server error

Change-Id: I71cac5d9250dc6601213f81a970a7d6d1798e1de
Reviewed-on: https://gerrit.instructure.com/70364
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Tested-by: Jenkins
Product-Review: McCall Smith <mcsmith@instructure.com>
2016-01-27 23:48:31 +00:00
Michael Brewer-Davis 154d34fa26 Allow outcome result details for Quiz alignments
Fixes CNVS-25911

Test plan:

Align an outcome to a question bank
Create a quiz
Import question bank into quiz
Have student take quiz
Go to outcome show page
Click on the quiz result within "Artifacts"
Should redirect to quiz submission, not show error

Change-Id: Ibb25d4fae21ccce29d49325bd593de3eafd866e3
Reviewed-on: https://gerrit.instructure.com/70093
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Tested-by: Jenkins
Product-Review: McCall Smith <mcsmith@instructure.com>
2016-01-27 23:48:03 +00:00
Michael Nomitch 4837d03d5c RCS - load tinymce on outcomes page remotely
fixes CNVS-26185

test plan:
  - with and without remote RCS flag
    - go to outcomes indes
    - you can edit the description
      of outcomes groups and outcomes
      like normal

Change-Id: Ifb294a2be5671938d4c42420bc7dfd6922689572
Reviewed-on: https://gerrit.instructure.com/69660
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2016-01-14 23:41:05 +00:00
James Williams 2f8bbc1e15 use manage_rubrics permission for rubrics pages
test plan:
* create an account admin with "Manage courses"
 permission disabled, but "Create and edit assessing rubrics"
 enabled

* should be able to view and manage course rubrics

closes #CNVS-22331

Change-Id: Ifb93fea5dc96c0ae07b7603805cfa84fa319e43f
Reviewed-on: https://gerrit.instructure.com/60193
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2015-08-10 15:07:16 +00:00
Zach Wily 51c8eefb2b send asset accesses as live events
We already have several asset accesses instrumented via
log_asset_access, so this captures those and sends them to the live
events as well. In order to better categorize the data, the synthetic
keys generated like "syllabus:course_1234" have been changed to arrays,
so that we can break that data apart in the live events without parsing
the string.

test plan:
 * Ensure that asset accesses are still being logged normally
 * Ensure that asset accesses also get sent as live events. (See
   change Id799688c972205a1eee84a673912f84b0c7abb57 for more information
   about that.)

Change-Id: I947a7f8b1d104bfafba96c30b81d0cb9bae81b9d
Reviewed-on: https://gerrit.instructure.com/50521
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Zach Wily <zach@instructure.com>
2015-05-05 12:52:50 +00:00
John Corrigan 925f936907 allows deletion of alignments from outcomes/show
Adds a React view to handle deletion of alignments from
outcomes/show view (this js had been removed ages ago).
Cleaned up LearningOutcome#remove_alignment. Added
an AlignmentsHelper with some view helper methods
to clean up the outcome_alignment partial.

fixes CNVS-15610

test plan:
- Create alignments for an outcome via the Magic Marker app.
- View outcome and its alignments at /courses/:cource_id/outcomes/:id.
- Click the red 'x' button.
- Press yes on the js confirmation box that pops up.
- The alignment line item will be removed.

Change-Id: I8cbf88dc8e8dc074e7b603f8082192a1942c7866
Reviewed-on: https://gerrit.instructure.com/47430
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Adam Stone <astone@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
2015-02-19 23:14:06 +00:00
Benjamin Porter dd10a77297 Cleanup the outcomes controller a bit to make it easier to read through
This cleans up the code, reorganizes it a bit, updates some stale
comments, adds some new comments, and follows the 'return unless
authorized' pattern which replaces the deeply nested if blocks.  So
something like this:

Instead of:

    def my_method
        if authorized_action(@context, @current_user, :read)
            code_line 1
            code_line 2
            if authorized_action(@context, @current_user, :write)
                code_line 3
            end
        end
    end

We get:

    def my_method
        return unless authorized_action(@context, @current_user, :read)
        code_line 1
        code_line 2
        return unless authorized_action(@context, @current_user, :write)
        code_line 3
    end

Fixes CNVS-16963

Test Plan:

    Make sure that all of this works:
        - Create an outcome group
        - Create an outcome in that group
        - Create more groups and outcomes and make sure they can be
          connected
            - An outcome can belong to more than one group
        - Edit an outcome
        - Delete an outcome

    Make sure that the above all fail when unauthorized


Change-Id: I31c8791cb1bbbe004462b0720f221eded0e95932
Reviewed-on: https://gerrit.instructure.com/44633
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Product-Review: Benjamin Porter <bporter@instructure.com>
2014-11-20 00:41:06 +00:00
James Williams 61c51c7724 add user access logging to various endpoints
test plan:
* with cassandra and page views enabled, should be able to
log user access to:
 - course home
 - course modules index
 - outcomes index,
 - assignments index
 - pages index
 - external urls
 - external tools tools

(and be able to view them in the user access report)

* also confirm that visiting the discussions index
does not register multiple views when visiting once

closes #CNVS-15321

Change-Id: I43329b1764cdf0c313f548f6aefa3af26c03f300
Reviewed-on: https://gerrit.instructure.com/42075
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
2014-10-03 14:22:48 +00:00
Cody Cutrer 1522718bfb no more dynamic finders (controllers)
refs CNVS-15126

Change-Id: Icdea762c810c541d99c30922ee92d6c36686e1fa
Reviewed-on: https://gerrit.instructure.com/39670
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-09-17 02:42:30 +00:00
Joshua Simpson ae814421e0 namespace all of quiz into quizzes module
This commit namespaces the rest of quiz related code into a Quizzes
namespace: controllers, views, models, and classes that previously lived
under lib/ that are Quiz-related.

Test plan:

Full regression test on all quiz related items

refs CNVS-10457

Change-Id: If54b61213945056539e03271a936d233abb66188
Reviewed-on: https://gerrit.instructure.com/29351
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2014-02-18 22:17:13 +00:00
Jacob Fugal 16cc93d2f7 cleanup per_page values for json pagination
if the response is json and paginated, make sure it honors the per_page
parameter. also, make sure we don't accidentally allow arbitrarily large
per_page values.

test-plan:
  [check this per endpoint]
  - have more than <max> entries (e.g. apps in the app center)
  - fetch <endpoint>
    - should get a page with <default> results
    - link with rel="next" should embed per_page=<default>
  - fetch <endpoint>?per_page=<max+1>
    - should get a page with <max> results
    - Link header should have a link with rel="next". that link should
      embed per_page=<max>
  - fetch <endpoint>?per_page=1
    - should get a page with 1 result
    - link with rel="next" should embed per_page=1

  [endpoints]
  /api/v1/courses/:course_id/app_center/apps
    default: 72
    max: 72

  /api/v1/courses/:course_id/app_center/apps/:app_id/reviews
    default: 15
    max: 50

  /conversations/discussion_replies.json
    default: 15
    max: 50

  /courses/:course_id/users/:user_id/usage.json
    default: 50
    max: 50

  /courses/:course_id/group_unassigned_members.json
    default: 15
    max: 100

  /courses/:course_id/outcomes/:outcome_id/results
    default: 10
    max: 50

  /courses/:course_id/question_banks/:question_bank_id/questions
    default: 50
    max: 50

  /courses/:course_id/quizzes/:quiz_id/moderate.json
    default: 50
    max: 50

  /api/v1/courses/:course_id/activity_stream
    default: 21
    max: 50

Change-Id: Iacb0b413de1175fb70d9b073fccef3e70082e60e
Reviewed-on: https://gerrit.instructure.com/26095
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2013-11-12 21:24:18 +00:00
Derek DeVries 6b3e8a58df correctly calculate number of questions affected by multiple regrades
fixes CNVS-8717

test plan:
- things to check for original regrade count ticket
  - add a quiz with at least 3 questions and allow multiple attempts
  - take the quiz as a student
  - regrade the quiz once only changing one question - choose correct only option
  - regrade the quiz again choosing 2 more questions - choose correct only option
  - view the quiz results as a student
  - it should show the correct total number of questions affected by the regrade
  - make a second attempt as a student
  - regrade notifications should no longer appear
  - regrade the question 2 more times and make sure that the questions affected counts are correct

- other things to check that were touched by this commit
  - make sure the versions table for attempts on quizzes#show works correctly
  - make sure that viewing submissions for past versions works correctly
  - make sure student analysis generates correctly for previous versions

Change-Id: If8bac35094cb7d73820ab826041d3089a6151b52
Reviewed-on: https://gerrit.instructure.com/25628
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2013-11-04 15:00:51 +00:00
Cody Cutrer 266a89e7db use unicode sorting for ruby and db stuff
fixes CNVS-7199, CNVS-4414

abstract some ICU stuff out to Canvas::ICU, and add some missing
functionality in FFI-ICU

test plan:
 * create a bunch of groups in the same category, named 1-10.
   10 should sort after 9, not 1
 * repeat for creating and publishing quizzes *with the same due date*.
   go to the quiz index, and 10 should sort after 9, not 1

Change-Id: I323eb12dfb5bd23dbcbb3b543fa1b90a72f4341b
Reviewed-on: https://gerrit.instructure.com/24732
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-10-02 21:38:03 +00:00
Jacob Fugal b12791aa99 to_json unnecessary (and wrongish) in render :json
refs CNVS-7597

render :json => thing will call ActiveSupport::JSON.encode(thing) unless
thing is a String. ActiveSupport::JSON.encode(thing) just calls
thing.to_json but with some circular reference checking that we want. we
may also want enhance ActiveSupport::JSON.encode to do additional
processing, and calling to_json straight up would bypass that.

in the cases where we do need to do the structural transformation before
passing to render :json (e.g. because of need to pass arguments), use
as_json to do structural transformation only, vs. to_json that does
serialization of the as_json result.

adds a rake task to lint the controllers to enforce as_json over to_json
in render json calls.

test-plan: heavy regression testing; no end behavior should change
(except a pair of serialization bugs that got fixed)

Change-Id: I7a91a9fe0eca70456bc5bca233f0ed6b27a54aaf
Reviewed-on: https://gerrit.instructure.com/23650
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-10-02 18:05:22 +00:00
Cody Cutrer e149fae7bc arel-ify controllers
closes CNVS-4706

Change-Id: I694a06a0d1d5ea83cc1b742e46e7ddfdcba6915a
Reviewed-on: https://gerrit.instructure.com/18672
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-03-22 20:12:59 +00:00
Mark Severson caf40051cb disable the outcome mastery page for large_roster courses
test plan:
 * add an outcome on a course
   (note the outcome id/url)
 * set the large_roster flag on the course
 * ensure that the outcomes are still listed
 * ensure that the outcome mastery page cannot be accessed
   * through a direct url
   * through the course outcomes page
   * through the assignments page
   * through the a course rubric page
     (Edit > Find Outcome Criterion)
   * through the quizzes page
     (Edit > * > Show Rubric)
   * through the discussions page
     (* > Add Rubric)
   * through question banks
     (Align Outcome)

 ! Note:
   this does not change the way account outcomes are handled!
   outcome mastery pages will still be shown for account outcomes.

fixes #CNVS-3094

Change-Id: Iaaaf437e3e76fb7c102641d55d5b6c8930a23d39
Reviewed-on: https://gerrit.instructure.com/18287
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-03-08 14:16:47 -07:00
Simon Williams 6f707352d1 use correct setting key for common core outcomes
fixes #11906

test plan:
- make sure common core shows up in account outcomes for several different
  shards

Change-Id: Ife61ef56be73a43e37c6518607d337236ec61e2a
Reviewed-on: https://gerrit.instructure.com/15568
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-11-26 09:20:53 -07:00
Mark Ericksen 6477d5e41c Don't display "State Standards" group in Course context. Fixes #11557
In the context of a course, when Finding an outcome to import,
don't show the "State Standards" group. Only show Account-level
outcomes that the admin has imported or created.

Testing Notes:
===========
* In a course, visit "Outcomes" and hit "Find" on toolbar
* No "State Standards" group should appear.
* In an Account, visit "Outcomes" and hit "Find" on toolbar
* The "State Standards" should be an option for browsing.

Change-Id: I8385b45e522e99c23c8c4542011d7551848fa002
Reviewed-on: https://gerrit.instructure.com/15001
Reviewed-by: Marc LeGendre <marc@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
2012-11-08 16:18:24 -07:00
Joe Tanner 27edbc1e8b Nested outcomes UI, closes #9158
test plan for course, account, and sub-account
outcomes page:
- using the 'New' buttons in the toolbar
  create, edit, and delete a bunch of outcomes
  and groups and nested groups
- when editing an outcome, insert, edit, and delete the criterion ratings
- find dialog
  - inside any top level standard group
  - select an individual outcome or a group to import
  - after importing, the outcome or group should show up in the
    seleced group of the main window and show it's details on the right
  - account standards
    - the account groups (the first level under 'Account Standards') should
      not be importable
- pagination
  - add 20-30 outcomes and groups to a group
  - groups should load first and then the outcomes
  - a 'Loading more results' item should be displayed when fetching
    more pages
- test out the 'Back' button

Change-Id: Iba1bb0533fb962ac6d206179c82c388f5fee1d84
Reviewed-on: https://gerrit.instructure.com/13086
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Tested-by: Bryan Madsen <bryan@instructure.com>
2012-10-25 11:03:21 -06:00
Jacob Fugal ca87014644 Outcome API
Change-Id: I6c33d2ab364522930b908d8edd162b20634e54b5
Reviewed-on: https://gerrit.instructure.com/12762
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2012-08-22 14:05:36 -06:00
Jacob Fugal 976c33ada6 fixup failing specs and add temporary plugin shims
the shims will be removed in a later commit. that commit will need to
wait for the plugins to be fixed before it can be submitted.

test-plan:
 - specs pass

Change-Id: Ifd6e2a254f0272a58d507c845cdae58b7392801c
Reviewed-on: https://gerrit.instructure.com/12798
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2012-08-22 09:53:19 -06:00
Bracken Mosbacker 82d4003320 learning outcomes refactor
This list is *NOT* complete, some items may have snuck in that I forgot
to note, and/or some of the noted items may not be completely functional
yet.

Specs need to be written around a lot of this, other specs will no doubt
need to be fixed.

Some things, particularly around LearningOutcomeGroups will need data
migrations that aren't there yet.

 * remove LearningOutcome.non_rubric_outcomes? and replace with false
   where invoked
 * remove LearningOutcome.enabled? and replace with true where invoked
 * remove never-taken branches
 * remove the shared/aligned_outcomes partial and it's supporting
   javascript, since it's now empty
 * remove js handler for add_outcome_alignment_link and supporting
   method since it only occurred in never-taken branches
 * mix LearningOutcomeContext into Course and Account
 * replace LearningOutcomeGroup.default_for(context) with
   LearningOutcomeContext#root_outcome_group
 * rename LearningOutcome#content_tags to LearningOutcome#alignments
 * rename LearningOutcomeGroup#content_tags to
   LearningOutcomeGroup#child_links, and properly restrict
 * remove ContentTag[Alignment]#rubric_association_id, add
   ContentTag[Alignment]#has_rubric_association? that looks at the
   presence of the content's rubric_association_id
 * condition off the assignment having a rubric_association rather than
   filtering tags by has_rubric_association (which just looks back at
   the assignment). all or none of the assignment's alignments are
   forced to have the association (via the assignment). this was true in
   practice before, is now codified (and more efficient)
 * rename AssessmentQuestionBank#learning_outcome_tags to
   AssessmentQuestionBank#learning_outcome_alignments
 * rename Assignment#learning_outcome_tags to
   Assignment#learning_outcome_alignments
 * rename Rubric#learning_outcome_tags to
   Rubric#learning_outcome_alignments
 * move/rename (Course|Account)#learning_outcome_tags to
   LearningOutcomeContext#learning_outcome_links
 * move/rename Account#learning_outcomes (corrected) and
   Course#learning_outcomes to
   LearningOutcomeContext#linked_learning_outcomes
 * move/rename Account#created_learning_outcomes and
   Course#created_learning_outcomes to
   LearningOutcomeContext#created_learning_outcomes
 * clarify and correct usage of linked_learning_outcomes vs.
   created_learning_outcomes
 * move/rename (Account|Account)#learning_outcome_groups to
   LearningOutcomeContext#learning_outcome_groups
 * remove unused Account#associated_learning_outcomes
 * just remove one link to a learning outcome when deleting
 * merge Account#has_outcomes?, Course#has_outcomes? and
   Course#has_outcomes into LearningOutcomeContext#has_outcomes?, add a
   use in Context#active_record_types
 * kill LearningOutcomeGroup#root_learning_outcome_group (unused)
 * rename LearningOutcomeResult#content_tag to
   LearningOutcomeResult#alignment
 * kill unused (and broken) OutcomesController#add_outcome_group
 * kill unused OutcomesController#update_outcomes_for_asset
 * kill unused OutcomesController#outcomes_for_asset
 * remove unused (outside specs, correct specs)
   AssessmentQuestionBank#outcomes=
 * remove unused ContentTag#learning_outcome_content
 * replace ContentTag.learning_outcome_tags_for(asset) (only ever called
   with asset=an assignment) with call to
   Assignment#learning_outcome_alignments
 * remove unused ContentTag.not_rubric
 * remove (now) unused ContentTag.include_outcome
 * remove unused LearningOutcome#learning_outcome_group_associations
 * avoid explicit use of ContentTag in outcome-related specs
 * replace LearningOutcomeGroup#learning_outcome_tags with
   LearningOutcomeGroup#child_outcome_links (and only use for outcome
   links; not tags for child groups)
 * split ContentTag#create_outcome_result into
   Submission#create_outcome_result,
   QuizSubmission#create_outcome_result, and
   RubricAssessment#create_outcome_result. fix some bugs along the way
 * refactor ContentTag.outcome_tags_for_banks and some code from
   QuizSubmission#(track_outcomes|update_outcomes_for_assessment_questions)
   into QuizSubmission#questions_and_alignments
 * refactor RubricAssociation#update_outcome_relations and
   Rubric#update_alignments into LearningOutcome.update_alignments
 * don't use ContentTag#rubric_association with outcome alignments; use
   the tag's content's rubric_association in its place (they should have
   been equal anyways)
 * refactor LearningOutcome.available_in_context and
   @context.root_outcome_group.sorted_all_outcomes (only time
   sorted_all_outcomes is used) into
   LearningOutcomeContext#available_outcomes and
   LearningOutcomeContext#available_outcome
 * overhaul LearningOutcomeGroup#sorted_content and rename to
   LearningOutcomeGroup#sorted_children. it not returns ContentTags
   (outcome links) and LearningOutcomeGroups, vs. LearningOutcomes and
   LearningOutcomeGroups; fix usages appropriately
 * fix UI for arranging/deleting outcome links and groups within a group
   to refer to the outcome link rather than the outcome

Change-Id: I85d99f2634f7206332cb1f5d5ea575b428988d4b
Reviewed-on: https://gerrit.instructure.com/12590
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jacob Fugal <jacob@instructure.com>
2012-08-22 09:51:39 -06:00
Simon Williams ce0bd8924a remove require_user_for_context from lib/authentication_methods
this method was a thin wrapper around get_context that redirected to the root
page if a context didn't exist.  Ostensibly it also showed the http error as in
flash message if a context did exist but the user didn't, or didn't belong to
the context, but this branch of code never worked due to a state vs
workflow_state bug that rendered the if statement always false.

Change-Id: I5a7353ddf3e1fc082324384a5ea3d3b6196c0dfd
Reviewed-on: https://gerrit.instructure.com/8499
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-02-06 13:27:41 -07:00
Brian Palmer 471943632e AR select and order options do not take an array
This problem was hidden in 1.8 because Array#to_s is an alias for
Array#join , but manifests itself in 1.9 where it aliases Array#inspect

Change-Id: I118696cdc129f71f31997ad852d8d7c6d3ad0fc9
Reviewed-on: https://gerrit.instructure.com/5842
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2011-09-27 12:05:51 -06:00
Brian Palmer 21b4db002d change some lambdas to procs
starting in 1.9.x, the number of args passed to a lambda is enforced --
procs still allow variable number of args

Change-Id: Id1a4338d10b87b870cd53989ea17ea422d848278
Reviewed-on: https://gerrit.instructure.com/5834
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2011-09-27 11:02:32 -06:00
Jacob Fugal 1a761c2d1f explicit utc db times in update_all
update_all's update hash doesn't have any magic performed on bare Time
objects; it assumes any Time object it's given is already in UTC. using
a TimeWithZone object (regardless of timezone), which Fixnum#ago and
friends happen to return, is still fine.

Change-Id: I297b2a3211b896b5225ebcfaaee3c1eb56e55fb6
Reviewed-on: https://gerrit.instructure.com/5351
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2011-08-30 16:46:25 -06:00
Jacob Fugal c6dd22a4c3 show course items aligned to account outcomes
when displaying the aligned items to an outcome at the account level,
include items defined in any courses associated with the account.

also, finish killing off vestigial alignment reordering at the account
level

fixes #5140

Change-Id: I7ce8250d707f8a1283b130801f1d7c0ca7e0fe26
Reviewed-on: https://gerrit.instructure.com/5276
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-08-25 16:43:55 -06:00
Cody Cutrer 42e89f907d cinch down course permissions for admins refs #4952
Basically, being an admin doesn't imply full access.  Instead, it
only implies :read_as_admin, which only lets you see things like
course name and section names.

Add two new role overrides:
 * :read_course_content implies :read on the course
 * :manage_content is now a full fledge RoleOverride instead of
   an internal permission implicitly given to Teachers and Admins

Actually start using :view_all_grades override so that Admins
without it won't see grades (replaces :read_as_admin that was
granted to concluded teachers; :view_all_grades is always granted to
concluded teachers, but not to Admins).

Spiffy up several helper functions to take an array of permissions,
and return if any of them are true.

Make sure not to show course tabs that the user does not have access
to.

Fix up lots of permission checks, especially around viewing users
(:read_roster, :manage_students, or :manage_admins might allow you
to see the users in a course; :read_roster only allows you to see
prior enrollments if it was granted to you as an account admin).

Change-Id: Iafcab7956649e9d28e17bd5eedcb155a9ea76af4
Reviewed-on: https://gerrit.instructure.com/5092
Reviewed-by: JT Olds <jt@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-08-19 10:19:21 -06:00
JT Olds 828bf5a9f5 outcomes i18n
Change-Id: I18719a70a3c3c7841eb6035414bcf283d2a0b284
Reviewed-on: https://gerrit.instructure.com/4235
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2011-07-05 16:44:48 -06:00
Brian Palmer b66081c2e5 call user_content on fields returned via json to be displayed, refs #3669
Change-Id: If9476570c505534668f2933982ba9ce3abc60bef
Reviewed-on: https://gerrit.instructure.com/3709
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-05-19 15:47:06 -06:00
Jon Jensen 8b78ba02d5 let students see outcome details, closes #4469
Change-Id: Ic1ae04eaabaf1077086c22a153da2bf31c395c35
Reviewed-on: https://gerrit.instructure.com/3472
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
2011-05-04 11:02:36 -06:00
Zach Wily 20092fb2c9 fix more find_by_id cases where we could pass in an empty string
Change-Id: I6bd72dd78f739edac6377f863f298fa14283be38
Reviewed-on: https://gerrit.instructure.com/3299
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-04-27 10:45:09 -06:00
Brian Whitmer b7f1d5ae18 align question banks to outcomes
Question banks can be aligned to outcomes that
are part of the same context.  Whenever students
take a quiz with questions from the bank they'll
get evaluated for the linked outcomes based on
the points they got for each bank question.

Also fixed a bug which may or may not have existed
before this commit that unexpectedly deleted quiz
submissions when a user tried to re-take a quiz.

refs #3317

Change-Id: I744af3915672a5e260b078503e0bc648c238eca9
Reviewed-on: https://gerrit.instructure.com/2641
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2011-03-25 15:39:56 -06:00
JT Olds 65b6f07050 add cross-listed account id to associated course accounts
Change-Id: I2d54baf24c704825a23be3d3c33d2a2d1da28462
Reviewed-on: https://gerrit.instructure.com/2517
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
2011-03-09 09:24:53 -07:00
Brian Whitmer 8b8173dcc9 Initial commit.
closes #6988138
2011-01-31 18:57:29 -07:00