fixes#9422
when a submission was graded via grade passback, it was being
assigned a grader_id of 4 because grade passback isn't sending
any grader information.
this fix replaces a potential call to nil.id with nil.try(:id),
which will properly return nil instead of 4.
Change-Id: I9d131043e716a2b4d04e7fba1104d04cd0b15ff3
Reviewed-on: https://gerrit.instructure.com/12266
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
our old jquery ui theme css was float:right'ing these
which means to have them show up in the right order
you would have to create them in the wrong order.
we fixed that with the new jquery-ui-theme but now
we need to fix places where they were in the wrong
order in code.
also the class name to make them blue has changed
so I fixed that too
Change-Id: If0cbebce4788b0c68cd71a08cd2880076e139bc0
Reviewed-on: https://gerrit.instructure.com/12214
Reviewed-by: Joe Tanner <joe@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
when creating a course from the new dashboard, have self enrollment on by
default (provided that the account allows self enrollment)
test plan:
1. enable the new dashboard
2. on your root account, allow self enrollment for manually created
courses
3. create a new course from the dashboard
4. it should have self enrollment turned on
5. on your root account, disallow self enrollment
6. create a new course from the dashboard
7. it should have self enrollment turned off
Change-Id: I79f22b720cf86872b479b3b0fec4bd2a97d08d4e
Reviewed-on: https://gerrit.instructure.com/12225
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Also adds showing a help dialog on two of the options where there are
already more users per time slot than allowed or a user signed up for
more than the allowed appointment limit.
test plan:
* option editing
- as a teacher create an appt group with some or all of the options
checked
- edit the appt group and change the options
- save
- edit the group again to verify that the changes remain
* per slot help dialog
- edit the appt group and uncheck 'Limit each time slot'
- save
- reserve one of the appointments with two students
- as a teacher edit the appt group and check 'Limit each time slot'
- verify that when the input value is '1' the help icon shows
- and verify that when the input is increased to '2' the help icon
disappears
* limit appointments help dialog
- edit the appt group and uncheck 'Limit participants to attend'
- save
- as a student reserve more than one appointment slot
- as a teacher edit the appt group and check 'Limit participants to attend'
- verify that when the input value is '1' the help icon shows
- and verify that when the input is increased to '2' the help icon
disappears
Change-Id: I34cd4e0604db30e7e752fd092fd70c6af2443dfe
Reviewed-on: https://gerrit.instructure.com/11863
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
closes: #9243
test plan: look at how breadcrumbs look
Change-Id: Ib55dfd8b0eb7c30bab08b38732b7eb108baa73f2
Reviewed-on: https://gerrit.instructure.com/12232
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
test plan:
go to a page that has a date picker,
make sure it looks good
Change-Id: I02d2846e5bc7064e261bfb26cf0b23d8bae7ec75
Reviewed-on: https://gerrit.instructure.com/12160
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
fixes#6227
test plan: Make a non-SIS course. Verify that teachers and designers can
still delete and reset the course, but TAs cannot.
They shouldn't see the buttons to do so, either.
Change-Id: I413a7646eaf7132b6b41d51bce4b05bb1b490b1c
Reviewed-on: https://gerrit.instructure.com/12151
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
our current version of require.js is unable to optimize loadDir correctly.
just explicitly include each template and create a map.
test plan:
1. on unoptimized canvas, go to the registration page
2. dialogs should appear when you click the buttons
3. on optimized canvas, go to the registration page
4. dialogs should appear when you click the buttons
Change-Id: Ifb55d739ac0bc485e64969bc4251c3a2d678d4c6
Reviewed-on: https://gerrit.instructure.com/12224
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
refs #3341
there is some backend support for anonymous peer reviews but it was never
finished and exposed in the UI, except for when posting a peer review via ajax.
this removes the visible traces of the feature until it can be completed.
test plan:
- leave a peer review comment on an assignment
- when the comment is inserted into the page, the author should be your name,
rather than 'Anonymous'
Change-Id: I8ecaf4ab8941b4c0f3f80605445d7361ed2b2747
Reviewed-on: https://gerrit.instructure.com/12171
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
API documentation and examples for Calendar Events and Appointment Groups.
Clean up some value_as_boolean usage, and fix a couple little issues in
the calendar APIs
test plan:
* build documentation
* it should generate and be correct
* run API specs
* they should pass
Change-Id: I4c57ac91a99e4eb04f5ba1741bb4f5968d0a0b14
Reviewed-on: https://gerrit.instructure.com/12209
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
a masquerading user should not be able to see a list of the masqueradee's
google docs file. additionally, a masquerader should not have the google docs
tab as an option for file upload submission.
test plan:
- in an account with google docs enabled
- in a course with a file upload assignment
- masquerade as a student who has google docs enabled
- go to the assignment tab and click submit
- google docs should not be an option
- stop masquerading, and log in as the student
- go to the assignment tab and click submit
- you should be able to successfully commit and file from google docs
Change-Id: I31ca6e7ca4b89331c9eabca7130eb7fc47417875
Reviewed-on: https://gerrit.instructure.com/12170
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
fixes: #9244
test plan: in all the browsers you can, look
at the wiki sidebar and make sure the tabs don't
wrap to a new line
Change-Id: Ifcd630c86f97fb42a9ca2cfa463ac1cf47a2b311
Reviewed-on: https://gerrit.instructure.com/12206
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
... so that it will be set on both login and logout requests.
test plan:
* Open network inspector and login. Verify that on the login request,
X-Canvas-User-Id is set.
* Log out.
* Verify that on the logout request, X-Canvas-User-Id is still set.
Change-Id: Ib849185cc3e289ae288e1ed2fe0ebae48f26de97
Reviewed-on: https://gerrit.instructure.com/12221
Tested-by: Zach Wily <zach@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
fixes: #9247 refs: #9244
since ie8 can't do gradients we weren't setting a bg
color at all, this will use the middle of the top and bottom
colors
test plan:
look at the tabs of wiki-sidebar
or the date picker popup,
make sure they look good
Change-Id: I518aa5f40670f5184cb2c353454ca238ecfb569b
Reviewed-on: https://gerrit.instructure.com/12205
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
test plan:
1. Start a new course
2. Observe the light gray colors for "hidden" tabs
screen shot: http://cl.ly/0h1e0c461e3K2n0P2h1r
Change-Id: Id94b4ea647e48590fe11b85788b8fa41077f85c3
Reviewed-on: https://gerrit.instructure.com/12199
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Ryan Florence <ryanf@instructure.com>
it always created them in the default account, so it didn't make sense
anyway
test plan:
* go to the profile page, and add an e-mail address
* on a default account, it should have a checkbox to create an
associated login
* on a non-default account, it shouldn't
Change-Id: I38d216df828c5bbf4fd9579e2ead06241692c8dd
Reviewed-on: https://gerrit.instructure.com/12198
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
fixes#8845
originally, this issue was that if a student was concluded from a course
they would still show up in the list of students to be added to both
collaborations and conferences. this commit fixes that and also prevents
the student view student from showing up in the list of students when
creating a new conference.
test plan
- be a teacher in a course with a few students and collaborations and
conferences enabled
- go to a collaboration and a conference and see the students listed
there (when starting a new collaboration/conference)
- conclude a student from the course
- click student student view, then leave student view
- back in the collaborations and conferences, the concluded student
should no longer be listed, and test student should not be listed
Change-Id: I08da39a79ef1508e53064adf54bfacac0c527457
Reviewed-on: https://gerrit.instructure.com/12100
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Sam Olds <sam@instructure.com>
There is some wording that should change as well, but I think we're
redoing the settings page soon so I'm going to leave that alone for now.
Test plan:
* Click on the page to edit your profile, the URL should be
/profile/settings instead of /profile/edit
Change-Id: Ida9ff2b24c1dc53b07cdf6c17a99152f8c5956af
Reviewed-on: https://gerrit.instructure.com/12134
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Cameron Matheson <cameron@instructure.com>
while refactoring, a css class got dropped from the fixed warning bar at the
bottom of the page.
test plan:
- this is currently only testable in the cloud beta environment
- make sure the bottom warning bar looks right, with the light red background
Change-Id: Id115c14d458e0f0c2ba737cd380f58f1e6dfc39a
Reviewed-on: https://gerrit.instructure.com/12180
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
This commit also:
- links assignment popup header to the assignment's url
- brings back the styles for the 'x' in the C2 event popup
test plan:
- create an assignment that is locked until a future date
- as a student click on the event in C2
- the popup should show "This assignment is locked until ..."
- and the popup header should link to the assignment
Change-Id: I3700db6820e39b9711e62ed0f80793f2b66fb81a
Reviewed-on: https://gerrit.instructure.com/11895
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
A complete api for folder and file management
Also updates the alphabetical sorting features to escape
a backslash caused errors when casting a string to a
bytea in postgres
Test Plan:
* CRUD yourself some files
* CRUD yourself some folder
closes#9163
Change-Id: I0b937f9273077b66ab9d6c37171bec1fcc5380dd
Reviewed-on: https://gerrit.instructure.com/12085
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
fixes issue #137 from the github tickets.
test plan
go to change password as user
should show error if original password is wrong
Change-Id: Ib7fe4472d16f9e95272f9a33190c10c5fd9fa212
Reviewed-on: https://gerrit.instructure.com/11821
Reviewed-by: Jake Sorce <jake@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
test plan:
make a wiki page.
go to the html view.
type:
<button class="element_toggler" aria-controls="thing">Show Dialog</button>
<form id="thing" data-turn-into-dialog style="display:none">
if you see this it worked
</form>
save the page.
click the 'Show Dialog' button.
if it shows the dialog it works.
Change-Id: I818546b7e7cf396b9e8993e5d0067d79240c21fa
Reviewed-on: https://gerrit.instructure.com/11645
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
fixes#9386
Test plan:
* Click on the 'Profile' link in the header, you should go to the
profile settings page
- There should not be a 'Profile' tab in the left nav
* Enable the 'enable_profiles' account setting for your user's
account. Clicking on 'Profile' should now take you to the new-style
profile page
Change-Id: Ie2bcd41ae98ec93d6a423e00936d79fac291be0c
Reviewed-on: https://gerrit.instructure.com/12132
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Users can validly be nil for wikis/discussions from content
imports. This makes the UI a little nicer for those cases
Test Plan:
* Import content from a .zip that has wiki pages in it
* The wiki page history should say Content Importer instead of having no name
* The individual revision page should say it was imported at a time
closes#8053
Change-Id: I5e382c3186d439b2e820c4b4c9103566792f4da3
Reviewed-on: https://gerrit.instructure.com/11897
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
overhaul the FavoritesController to implement an API,
and retarget the web UI on top of this API.
note: /favorites was capable of adding favorite _anythings_,
not just courses - however, in a publicly documented API,
we don't want to encourage users to start creating
favorite files or sections or discussions and then
expect these to have meaning.
it would not be much effort to generalize the API a bit
(parameterizing the object type, but limiting the
allowed types to ["Course"] for the time being) -
if we think this won't make the documentation too
awkward. (we can, of course, make this change once
we actually _need_ it, without breaking backward
compatibility.)
test plan:
- make sure the web UI for course favorites works;
it has been retargeted on the API
- view the API documentation for Favorites;
verify that it was generated properly
- exercise the new APIs:
* GET /api/v1/users/self/favorites/courses
* POST /api/v1/users/self/favorites/courses/:id
* DELETE /api/v1/users/self/favorites/courses/:id
* DELETE /api/v1/users/self/favorites/courses
Change-Id: Ib4b6590af0202896846a5eb75f59a8fabb95fe6c
Reviewed-on: https://gerrit.instructure.com/12032
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
this creates a fixed bottom bar that shows up on every page when you are in
student view, serving as both a reminder and a place for the buttons to leave
student view or to reset the test student. resetting the test student is a new
piece of functionality which removes all course artifacts created by the test
student, letting a teacher "start over" the test student.
test plan:
- enter student view
- there should be a permanant bar at the bottom of the page, with buttons
- there should no longer be a [Leave Student View] link in the top right corner
- the leave button should work
- as the test student, interact with the course (submit assignments, take
quizzes, comment in discussions, etc)
- click the reset student link in the bottom bar
- all of the interactions above should be gone
Change-Id: If73be7a28f6af5378da26f92e82a69a72352d831
Reviewed-on: https://gerrit.instructure.com/12057
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
fixes#9252
test plan: Set up a course A with at least one file. Clone course A to
make course B. Then copy course B back into course A. Also try copying a
course into itself. None of these actions should cause loading
/courses/A/files or /courses/B/files to break. You can also check the db
directly to verify that root_attachment_id doesn't equal id for any of
the rows.
Change-Id: Iee662358d8cc68f30ef7116cdb1bfa46eb99d996
Reviewed-on: https://gerrit.instructure.com/12061
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
test plan:
* create two courses via SIS CSV
* enroll a user in course 1 via SIS CSV by course_id only
* xlist course 1's default section to course 2
* enroll another user in course 1 via SIS CSV by course_id only again
* the user should end up in the xlisted section in course 2
Change-Id: I3a114d70a109594a56915b705de77b87a177e966
Reviewed-on: https://gerrit.instructure.com/12122
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
avoids N+1 queries
test plan:
* run specs for enrollments api
Change-Id: I8704677379521a42fbaf5c0f3c06ccb6b88f6806
Reviewed-on: https://gerrit.instructure.com/12118
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
fixes#9370
a typo (instance_eval instead of class_eval) was causing submission comments to
not check permissions, so peer reviewers were receiving extra comments in ajax
responses.
test plan:
- submit an assignment, and comment on it
- also comment as the teacher
- set up a peer review
- load the page as the peer reviewer, it should not show the other comments
- make a comment as the reviewer. the other comments should not appear
Change-Id: I067e323a813ff836cfcadb5400e313de47be0e37
Reviewed-on: https://gerrit.instructure.com/12101
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
fixes#8904
test plan:
* enter a formula into any rich content editor (like an assignment
description or something)
* make sure it is vertically aligned to the center with normal text
before and after saving
Change-Id: I056e6ca9fc24c3114777cd7bf654ca59c0270a57
Reviewed-on: https://gerrit.instructure.com/11875
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
This modifies the API to return information on the required user_content
params for api responses. The javascript then processes the api response
fields and replaces the user content with iframe posts to safefiles,
same as we do server-side in erb currently for user_content in non-api
responses. This is done before the html is inserted on the page.
The current implementation requires the api to respond with these extra
data attributes all the time, not just for in-app requests. This isn't
ideal, but other api users will safely ignore those extra data
attributes.
test plan: in a discussion, post a reply that contains an object or
embed tag. reload the page and verify that the flash or java or whatever
still appears. inspect the html, and check that it is contained inside
an iframe pointing to the safefiles domain, rather than embedded
directly on the main canvas domain.
Change-Id: I5f1c5f4f267f654ec339ee422f0743f33ee2564f
Reviewed-on: https://gerrit.instructure.com/12111
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Move CoursesController#sections to SectionsController#index, api-ify
SectionsController#show, refactor out sections_json, and bring docs
up to newer standards (@returns)
test plan:
* ensure /api/v1/courses/:id/sections still lists sections, and
includes of students works as well
* /api/v1/courses/:id/sections/:id should return some basic
section info
* test that you can't find a section for the wrong course
* test /api/v1/sections/:id works for raw ids and section ids
Change-Id: Ie6bf2257e0138ff7a76a5670a6cc041fcce0cd54
Reviewed-on: https://gerrit.instructure.com/12117
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
adds (root) account-level setting for (default) user file quotas. defaults
to 50 MB.
test plan:
1. on a root account, change the default user quota to something other
than 50 MB (e.g. 1 MB)
2. as a user in that account:
1. go to /users/self/files/quota . you should see the new quota
2. attempt to upload files. once you have hit/exceeded the quota, you
should not be able to upload additional files
3. as a user in multiple (root) accounts:
1. go to /users/self/files/quota . your quota should be the sum of the
root account user quotas
2. attempt to upload files. once you have hit/exceeded the quota, you
should not be able to upload additional files
note that the previous behavior does not change in that one file can exceed
your quota. e.g. if your quota is 1 MB, you can upload a 2 MB file. only
then will you be prevented from uploading additional files
Change-Id: If7f5903fb54eb2b62d80a2b4ee8adfcc48a63683
Reviewed-on: https://gerrit.instructure.com/12005
Reviewed-by: Joe Tanner <joe@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
fixes#8673
test plan:
- set up a course with students and observers
- link an observer to a student
- as a student, go to Inbox and click the address book icon
- verify that the only Observers that show up are those that
are linked to you
Change-Id: I2d9dfac1717c43b4327b48ef43efcffba34b30b1
Reviewed-on: https://gerrit.instructure.com/11971
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
fixes#7831
test plan
- start a new course
- course name, assignments, students, blah blah, save
- go to the 'publish course' step of the course setup wizard box
- it should no longer say that an email is sent out when the course is
published
Change-Id: I4e81a88ab111b605da8e542ec711d8a227147777
Reviewed-on: https://gerrit.instructure.com/12099
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jake Sorce <jake@instructure.com>
fixes#9159
the student view student was showing up as one of the users listed on the
collaborations page, but adding the student view student to a collaboration
resulted in an error. this simply removes the student view student as an option
on the page and disallows the student view student from using collaborations.
test plan:
- in a course with collaborations enabled
- enter student view
- go to the collaboration page, you should receive an unauthorized message
- leave student view
- go to the collaborations page
- the student view student should not be in the list
- select all and create
- the collaboration should work
Change-Id: I574f4f2caa6b0627dcd1a91acd4cb3699be4583a
Reviewed-on: https://gerrit.instructure.com/11927
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
fixes 8816
Test plan:
* as a teacher, open canvasations
* use the address book (don't search) to compose a message to a student
- you should see a 'add as a faculty journal entry' option
- you should not see the 'this is a group conversation' option
Change-Id: I1c43a9a721dca0de58d91db5a40d9fa53b3c43e9
Reviewed-on: https://gerrit.instructure.com/11746
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
In a group graded discussion assignment, when creating the child topics for
each group, the new discussion topics were touching their root topics, kicking
off a new job to refresh the subtopics. This created a race condition where
duplicate subtopics for the group could get created, in addition to a lot of
unnecessary jobs. This commit moves the touch to only happen when an entry in
a subtopic is updated, tightens up some conditions in the way soft-destroys
cascade between assignment and discussion, and adds a unique index on
context+root_topic to prevent this from happening in the future.
test plan:
- ensure that creating a group discussion assignment still creates all
necessary sub-topics for the groups
- in a course with many student groups, create a new group discussion
assignment.
- each group should only have one unique topic for this assignment
- delete a group discussion assignment, it should delete all associated topics
at the course and group levels
- also try initiating the delete from the root topic. the assignment and sub
topics should be deleted
Change-Id: I9b0fb79c2c2b3b9512802a781b8ea0f4364af541
Reviewed-on: https://gerrit.instructure.com/11712
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>