Commit Graph

10 Commits

Author SHA1 Message Date
Bracken Mosbacker e98c5059d7 fix infinite recursion in outcome groups
The learning outcome UI has some bugs that allow you to
drag groups into other groups. This causes groups to have
multiple parents and so they'll show up on the page more
than once. Once that happens you can even drag a group
into itself. Once in that state loading the outcomes
page would cause an infinite render.

This commit makes the page render even with the existing
bad data. It also prevents groups from being added to a
group of any of its ancestors. It also fixes groups
having multiple parents.

This commit doesn't address the current bugs in the UI that
allowed these problems to happen, it just prevents those
from creating relationship loops.

Test Plan:
 * Load outcomes page and create two groups
 * Drag one group into the other group
 * Refresh page, there should not be two of the group you dragged
 * If you want to test the page loading despite existing bad relations:
 * Create a content tag that makes a group point to itself like the specs do. (You can't make this happen in the UI anymore)
 * Loading the outcomes page shouldn't freeze

Change-Id: I416e99b3bc57a3b8c82db5cc895bccd141dc3dab
closes: #6384
Reviewed-on: https://gerrit.instructure.com/7559
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-12-19 16:28:26 -07:00
Brian Palmer 92feb2bcdb replace ActiveRecord::Base calls with subclass calls where it makes sense
This was already a small issue if the job queue was on a different
database driver than the main database, and it'll become more important
as more AR connections are introduced.

Change-Id: I204becadd32bb935df096e8c937a04bb6962f0b2
Reviewed-on: https://gerrit.instructure.com/4601
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-07-18 13:56:08 -06:00
Bracken Mosbacker ccb0aad1c5 import learning outcome groups correctly
when importing learning outcome groups the first group
became the course's default group, this commit makes
sure a default group exists before importing a group

refs #55

Change-Id: I8b7af9dbccfc8490ba3d60a17e8c4223c4fe6b28
Reviewed-on: https://gerrit.instructure.com/4464
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Bracken Mosbacker <bracken@instructure.com>
2011-06-30 10:43:28 -06:00
Bracken Mosbacker 0d8b4fce33 copy learning outcomes during course copy
closes #3805

Change-Id: I186c2ed323c5aeb29a5dfd6c40da1245c72086ee
Reviewed-on: https://gerrit.instructure.com/3846
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-05-25 16:26:30 -06:00
Jon Jensen 6d226272df cast columns in dynamic finders, warn on all-nil argument lists
in production mode we now cast to the appropriate type and issue a warning
if it can't be cleanly cast (e.g. '' -> 0). if all arguments are nil (or
empty arrays, e.g. find_by_id([])) and we aren't in a scope, issue a
warning (sometimes we really do want nil when we're in a scope, e.g. line
216 of app/models/folder/rb).

in development/test mode, we now raise errors in the two warning scenarios
above (though that is configurable).

fixed several places in the code where specs failed due to the change, or
where inputs to dynamic finders looked problematic

Change-Id: Ifea851cb14d3e89b6df08ade8e83934579678f8b
Reviewed-on: https://gerrit.instructure.com/3434
Reviewed-by: Zach Wily <zach@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-05-03 11:06:04 -06:00
Brian Palmer a42a6e3b7c fix LearningOutcomeGroup#root_learning_outcome_group association
Change-Id: Ib5e1b8c86780a8421bfe2390f7b0fb38792d051d
Reviewed-on: https://gerrit.instructure.com/3209
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-04-22 13:46:59 -06:00
Brian Palmer 2882b73335 fix some learning outcome group infinite loop possibilities
If you ever re-saved the default group, infinite recursion. There was
also infinite recursion happening on import, if the course didn't have
any groups at the beginning of the import, because the default group was
being assigned as a child of itself.

Change-Id: Ib504380c28ed9c6e68b2820bdf7549ec63c90061
Reviewed-on: https://gerrit.instructure.com/3132
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-04-18 10:17:55 -06:00
Bracken Mosbacker 84c048e5e6 importing more canvas export types
Added external feeds, grading standards, and learning outcomes

refs #3396

Change-Id: I138f22a6d5793e21ba49388e16be75d5f80f0e12
Reviewed-on: https://gerrit.instructure.com/3043
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-04-18 08:09:23 -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
Brian Whitmer 8b8173dcc9 Initial commit.
closes #6988138
2011-01-31 18:57:29 -07:00