* merged Api::V1::Enrollment into Api::V1::User because of a circular
dependency
* adding enrollments and email fields to #user_json
* adding associated_user_id, updated_at, and locked fields to
#enrollment_json
/api/v1/courses/:course_id/users
test plan:
* create a course
* enroll a user twice in the course (e.g. a TA)
* call the api with 'enrollments' and 'email' in include[]
* verify that the user data includes an email and two enrollments
Change-Id: I2f09c72c0e60fb7d2cd5bc7b585834970ad7a7cf
Reviewed-on: https://gerrit.instructure.com/9607
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
fixes#6873, #7286
Test plan:
- open the gradebook in a course with an assignment that has a very
long name
- verify that the assignment name is truncated
- verify the tooltips on the column headers are sensible
Change-Id: I2309f05e0426f5d855f9e385c13934a05efa6da1
Reviewed-on: https://gerrit.instructure.com/8791
Reviewed-by: Jake Sorce <jake@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
fixes#7888
Test plan:
- make an appointment group
- reserve one of the appointments as a student
- as the teacher, go to the month calendar view
- edit the appointment group event
- make sure the event doesn't disappear
Change-Id: I01574c7c343ff0681e13acd00773dc564814a437
Reviewed-on: https://gerrit.instructure.com/9661
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
closes#7769
Test plan:
- create an appointment group
- open the appointment groups and edit one of its appointments
- change the number of users allowed to attend the appointment
- make sure that no more users can reserve the appointment than
configured
Change-Id: I4365113d81d123bd8c3cdc24af8761cc6b9027a3
Reviewed-on: https://gerrit.instructure.com/9648
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
allows course admins to view the course from a student perspective. this is
accessible from a button on the course/settings page. They should be able to
interact with the course as a student would, including submitting homework and
quizzes. Right now there is one student view student per course, so if the
course has multiple administrators, they will all share the same student view
student.
There are a few things that won't work in student view the way the
would for a normal student, most notably access to conversations is disabled.
Additionally, any publicly visible action that the teacher takes while in
student view will still be publicly visible -- for example if the teacher posts
a discussion topic/reply as the student view student, it will be visible to the
whole class.
test-plan:
- (the following should be tried both as a full teacher and as
a section-limited course admin)
- set up a few assignments, quizzes, discussions, and module progressions in
a course.
- enter student view from the coures settings page.
- work through the things you set up above.
- leave student view from the upper right corner of the page.
- as a teacher you should be able to grade the fake student so that they can
continue to progress.
- the student should not show up in the course users list
- the student should not show up at the account level at all:
* total user list
* statistics
Change-Id: I886a4663777f3ef2bdae594349ff6da6981e14ed
Reviewed-on: https://gerrit.instructure.com/9484
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Add an avatar in the top right of SpeedGrader to show
the currently visible student. Also add avatars for
submission comments made on the submission.
test plan:
- enable avatars on the account
- go to SpeedGrader for an assignment
- make sure student avatars appear correctly in the top left
- add a comment to the submission
- make sure your avatar appears correctly next to your comment
- disable avatars on the account
- go back to the same SpeedGrader view
- make sure no avatars appear
Change-Id: Iac0e2305f24340a984ff5546eed7e4789f8337b5
Reviewed-on: https://gerrit.instructure.com/9675
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
In courses and groups, add the avatar picture below
each user's name.
test plan:
- enable avatars on an account
- load a course roster
- make sure avatar pictures appear correctly
- load a group roster
- make sure avatar pictures appear correctly
- disable avatars on the account
- load the course roster
- make sure avatar pictures appear correctly
Change-Id: Ib1f91edb153b42a20a3212aa5d12d5383d8b3325
Reviewed-on: https://gerrit.instructure.com/9024
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
closes#7560
Test plan:
- reserve a time slot with one or more students
- as a teacher, click on the reserved time slot (in either scheduler
or month view)
- you should be able to remove the student from the appointment
Change-Id: I2b5faf813ebafe50fbf185ee8f61764667afa941
Reviewed-on: https://gerrit.instructure.com/9594
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
closes: #7562
Test plan:
- create an appointment group that has a limit on per-participant
appointments
- make sure a student can sign up for no more than that many appointments
- remove the limit
- make sure that a student can sign up for all slots
Change-Id: Id6d323c056369b4e76671ef10c0fa5e2dfa740ca
Reviewed-on: https://gerrit.instructure.com/9422
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
If all the items of a specific types are selected it
doesn't need to list each individual item. So remove all
the unneeded options to reduce the number of hash keys
sent to the server
Test Plan:
* Import some packages from other systems
* Check that the expected items are/aren't selected in the submitted post data
* The import should work as expected
closes#7699
Change-Id: Ib56b2aaf4044fc3e433ca64563ff517c9db304c7
Reviewed-on: https://gerrit.instructure.com/9711
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
add the selective course copy back in and change it to
use the updated format for what items are selected
Test Plan:
* Copy some courses and selectively choose items
* Only the items you selected should copy
refs #4645
Change-Id: Id5043b4e5e4a285b1f5cefd2ab16473052026484
Reviewed-on: https://gerrit.instructure.com/9763
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
This adds the ability for ContentMigration to copy courses
by exporting to a content package and then importing that
package. For attachments it just creates a new Attachment
object instead of exporting/importing them.
The course copy API did not change.
The endpoints used by the course copy UI did change and this
commit doesn't allow selective copying, it only has the
option to copy everything. Selective copying will come in
another commit.
There are also various bug fixes for export/import
Test Plan:
* copy a course through the API
* copy a course through the Content Imports path
* copy a course through the Copy Cours button on the course settings page
* export a course
refs #4645
Change-Id: Ie577329ab7caaea8dfb9359542224a1a2657e167
Reviewed-on: https://gerrit.instructure.com/9742
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Test Plan:
* There is no UI for this yet, so check the specs.
refs #4645
Change-Id: Ibe159d222ba9a05e2edc4ead5eeb3e48b77c3542
Reviewed-on: https://gerrit.instructure.com/9741
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
test plan:
* create a new pseudonym without a password in script/console
* after saving, pseudonym.password should return a value, and
it should not start with "tmp-pw-"
Change-Id: Idb49ada75d0212fd068e09fbf4e77d837b25e9c4
Reviewed-on: https://gerrit.instructure.com/9778
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
rather than proxy attachments through the conversations controller and
cause a long-running db transaction, we now just send them to the right
place (files controller, s3, whatever), and then create the message. we
now store the attachment in a special folder on the user so that they
can more easily be tracked in the future for quota management.
because we now just store one instance of each attachment, sending a
bulk private message w/ attachments should be a bit less painful.
known regression:
if a user deletes a conversation attachment from their files area, it
deletes if for all recipients. this is essentially the same problem as
tickets #6732 and #7481 where we don't let a "deleted" attachment to
still be viewed via associations with other objects.
test plan:
1. send an attachment on a new conversation and confirm that was sent
correctly and can be viewed by recipients
2. send an attachment on an existing conversation and confirm that was
sent correctly and can be viewed by recipients
3. send an attachment on a bulk private conversation and
1. confirm that was sent correctly and can be viewed by recipients
2. confirm that only one attachment was actually created, but each
message in each conversation is linked to it
4. send multiple attachments and confirm that they were sent correctly
and can be viewed by recipients
5. perform steps 1-4 for both local and s3 uploads
Change-Id: I7cb21c635f98e47163ef81f0c4050346c64faa91
Reviewed-on: https://gerrit.instructure.com/9046
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
Add a small user avatar icon to the left of each student's
name in the gradebook.
test plan:
- enable avatars for the account
- load a course gradebook
- make sure avatars appear correctly
- disable avatars for the account
- load a course gradebook
- make sure no avatars appear
Change-Id: Ibecbe25936979c115dcaa5af4f454320128bbd1c
Reviewed-on: https://gerrit.instructure.com/9397
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
several changes to make things more correct/consistent across browsers:
1. remove blur handlers, since they are redundant
2. normalize numerical answers *before* updating the submission
3. fix regression around the numerical answer validation (the error box
had stopped showing up) and refactor it a bit
4. simplify window blur/focus -> active input event triggering, and make
it so it only (and always) happens in take_quiz (eventually we may want
it in the entire app). we no longer blur/focus the input, we just
trigger those handlers. this lets us avoid the IE infinite loop
5. by virtue of 4., fix an issue with tiny re-adding the window blur/focus
handlers every time tiny got focus (since these editors had explicit
ids and thus editorBoxIdCounter never got incremented)
6. add a tiny hook to ensure the change callback fires when tiny loses
focus (fixes issue in FF and Safari)
test plan:
1. create a quiz with numerical questions, essay questions, and others
2. take the quiz in every browser (ff, safari, chrome, ie8, ie9) and:
1. ensure that answers get marked as answered/unanswered whenever you
change the content AND
1. tab out of the input/editor
2. click out of the input/editor
3. click out of the viewport entirely
2. ensure that numerical answers show the error box whenever the
content is invalid, and it goes away when it becomes valid
Change-Id: I7e34a99e9b81772b3a91b7a76cab59102bcc4c90
Reviewed-on: https://gerrit.instructure.com/9677
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
fixes#7430
Test-plan:
- create an appointment group
- click on one of the appointment group calendar events
- confirm that your eyes aren't bleeding
Change-Id: Ie22bc1a190d2b202a926d1c7c76245bf6e56d478
Reviewed-on: https://gerrit.instructure.com/9445
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
fixes#7959
Test plan:
* Use firefox
1. On calendar2, click on a day to create an event.
2. Click the 'more options' link
3. Make sure it takes you to the new calendar event page
4. Repeat steps 1-3 but for assignments
5. Repeat steps 1-4 for the existing events/assignments
Change-Id: I22eb38b5c3b0ec90815b78cca15452846662f788
Reviewed-on: https://gerrit.instructure.com/9752
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
fixes#7380
test plan:
1. click "take quiz" as fast as you can
2. observe the next page isn't broken
Change-Id: I1dae0414e0db6bc4972f97e6cb56abca347433d1
Reviewed-on: https://gerrit.instructure.com/9735
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
various tweaks to speed up bulk message sending (~75% backend runtime
reduction, for both current and stale caches. ~55% frontend runtime
reduction. ymmv). highlights:
1. lots of preloading. some vanilla rails stuff, more hand-rolled.
2. conversation model hooks to reuse existing ruby objects if requested
(e.g. c.conversation_participants[0].conversation.equal?(c)
when done in a ModelCache.cache block).
3. more (and better) caching. some User# methods are now cached up to a
day (or until the user is touched).
4. various model tweaks to reduce redundant or unnecessary queries.
5. don't animate existing private conversations after the response
comes back. for bulk private messages going out to tons of existing
conversations, this would peg the client CPU and cause sadness.
6. defer delayed job creation
test plan:
1. run rails in production mode (so stream items and notifications
happen in delayed jobs, otherwise it's going to be *really* slow)
2. confirm that sending a bulk private message to a lot of people (e.g.
500) is faster
3. also confirm that nothing is broken :)
Change-Id: I92094f27ac51094a8047cb67f2cbb680a1839779
Reviewed-on: https://gerrit.instructure.com/9157
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Avatar pictures had an explicit height, but
the width could be whatever. Setting the max-width
will help keep it horizontally bounded for
layout purposes.
test plan:
- pick an avatar image that is really wide
- go to a discussion where you have posted
- make sure the avatar picture is not wider than 50px
Change-Id: I1a3d26bf28f70cb6948010f096c8b940f0a0ca26
Reviewed-on: https://gerrit.instructure.com/9022
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
test plan
* create a course that has ended
* that course should not be in the dropdown
* other courses should be in drop down
* old course should be in pst enrollments
Change-Id: Ibf31fe72125eb05fff42dd6d8fbe123f6b6368f6
Reviewed-on: https://gerrit.instructure.com/9448
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
for both calendar events and assignments
test plan: create a calendar event and an assignment with rich text
descriptions. download the .ics for the course, verify that you don't
get html tags in the descriptions in ical, outlook, etc
Change-Id: I1d69e2a9338fdc3d8c9228b7e6cb70d58614bdac
Reviewed-on: https://gerrit.instructure.com/9666
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
affects: course model, api
test plan:
* add a course with the api, included a public description;
* verify that public description field is returned and
exists on the course in the db.
Change-Id: If2766cf7ba946af5cb8a5cafebaa8209754ec2b3
Reviewed-on: https://gerrit.instructure.com/9723
Tested-by: Cody Cutrer <cody@instructure.com>
Tested-by: Zach Wily <zach@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
question data should use the :question_name key for question
names, so that key should be used when showing the title.
Test Plan:
* Import a quiz from a QTI package
* Take the quiz and view the statistics page
* The title should be there.
closes#7065
Change-Id: I39a650cf0f0aa8a8534a0158d6b073dc261c87c3
Reviewed-on: https://gerrit.instructure.com/9738
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
also search for the default developer key on the default shard
refs #7788
test plan:
* create an api key (on the default shard)
* access the api on a non-default shard
* it should still work
* create an oauth token in the UI on a different
shard
* it should work, and reference a key on the default shard
Change-Id: I8c8aa36ab38f45ba9af2422a42552faeff28ac73
Reviewed-on: https://gerrit.instructure.com/9492
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Fixes a race condition where the view might get generated by the job
without the new entry.
test plan: this is difficult to duplicate by hand, but you could put a
breakpoint in and verify the job doesn't get inserted before the
transaction commits.
Change-Id: I6c373553dfae409adab25dd9e3bafc7126169231
Reviewed-on: https://gerrit.instructure.com/9710
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
Apparently there are some cases where this can happen, so it needs to be
handled.
test plan:
* Create a topic with some entries
* In console, set the user_id of some of those entries to nil
* Ensure you can still load the topic (and it says Unknown Author for the
ones with user_id = nil)
Change-Id: Idbcd82204d8b936d5d50af5ff6e5dd338bbba87a
Reviewed-on: https://gerrit.instructure.com/9762
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
We were trying to act on an element not on the page. This adds a check for
that and a spec.
test plan:
* Create a "post first" discussion.
* As a student, attempt to load it and post to it.
* It should work.
Change-Id: I68459145ff740562fe07eb71080401981c2285d2
Reviewed-on: https://gerrit.instructure.com/9758
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
- init after entries are created
- don't start timers on collapseView false (this
marked everything as read when choosing "expand
all" from the view switcher")
Change-Id: I814c1a9f50b098e022e1ae4882279e6dc951ed0b
Reviewed-on: https://gerrit.instructure.com/9745
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
unfortunately the poor decision was made to return the rubric as an
array of rows, rather than an object that can hold other attributes, so
i've added a 'rubric_settings' object to the assignment response to hold
these other attributes.
test plan: make an api call for an assignment, verify the rubric
response
Change-Id: Ia7ad4c31038454eca28150e7d55ecebaa8fd7195
Reviewed-on: https://gerrit.instructure.com/9714
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Mark Suman <marks@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
test plan:
* set "teachers can create courses" but *not* "users with no
enrollments can create courses" on an account
* as a site admin, ensure you can masquerade as a teacher in that
account
Change-Id: Id63ac979aafc42b70b3303dc4cbe9c924582f448
Reviewed-on: https://gerrit.instructure.com/9731
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
affects: pseudonym/login api
test plan:
* create a user with multiple pseudonyms across accounts;
* make request to /api/v1/users/:user_id/logins and verify that
all of that user's pseudonyms are returned.
* make same request as unauthorized user and verify that 401 is
returned.
Change-Id: Ic932ce9bef6bcfbe3ecb3340f640f44fbf4115a4
Reviewed-on: https://gerrit.instructure.com/9718
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
when threaded discussions were converted to
side_comment discussions the right padding kept
nesting, now its flat
Change-Id: I256392518b24e05fa61dfa49670ec8d657063537
Reviewed-on: https://gerrit.instructure.com/9736
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
consumers can use this to update the view client-side and ensure it's
always up-to-date even if the view is behind.
Change-Id: I1ff0cd80a758a113f8881ef74de78cc28e2fa16b
Reviewed-on: https://gerrit.instructure.com/9717
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
test plan:
* have a user not associated with the default account at all
* log in on the default account's domain
* should get a scary warning at the bottom of the screen that
doesn't go away until you click another link
Change-Id: Icbe9953119e80ec3f2e761f35ceb042ceec6372e
Reviewed-on: https://gerrit.instructure.com/9722
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
the todo on the dashboard was being cached, keyed on the user, which didn't get
cleared when an assignment's needs_grading count changed. since computing all
the assignments needing grading a significant part of the computation we're
trying to save, we don't want to include that in the cache key, so just expire
after 3 minutes for now.
test-plan:
- as a teacher, look at your todo list on the dashboard.
- go grade something that needs grading.
- wait 3 minutes
- go back to dashboard, count should be updated
Change-Id: I5b2626656c74684dd52aeb667ffd7cefffc9f552
Reviewed-on: https://gerrit.instructure.com/9672
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
fixes#7494
test plan: start taking a quiz, then delete your session from the
database. the subsequent backups should result in an error. (there is a
separate ticket filed to put the user back on the initial quiz page or
something when this happens)
Change-Id: I598012af1ee8f0595e95b81dd6caeb9bcfbc5428
Reviewed-on: https://gerrit.instructure.com/9703
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
ensure that excessively long words in quiz responses get wrapped
test plan:
1. take a quiz with an essay question
2. enter a really long word (wider than the viewport)
3. in each supported browser:
1. confirm that it wraps on the quiz result page
2. confirm that it wraps in the speedgrader
Change-Id: Ie634dd09cd0d9360b486ede9155bfb750e592c13
Reviewed-on: https://gerrit.instructure.com/9695
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
a lot of times when you bind to an event the first
thing you do in your handler is event.preventDefault()
not a big deal unless you are trying to bind a class
method to the handler and you have to wrap in an
anonymous function just to get the event.preventDefault
Change-Id: I17a8fc3e9fdf1e75e900eb25a51aecc74daa69d6
Reviewed-on: https://gerrit.instructure.com/9264
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
basically for detailed reports, have a row per account, instead of
stuffing everything into one massive hash with every account
test plan:
* ensure that the account statistics page still works
* ensure that the statistics update when the delayed job runs
Change-Id: I2d4c9ff5a86c8df6d82097aa4f0203a0f55ddb2d
Reviewed-on: https://gerrit.instructure.com/9565
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>