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