fixes CNVS-8045
test plan:
* as a teacher with new conversations, navigate to new
conversations and click the compose button;
* verify that the "Bulk message" checkbox appears
below the subject line;
* attempt to send two messages to an entire class: one
with the bcc checkbox selected, and another with it
unchecked;
* as a student in the class using old conversations,
navigate to conversations and verify that you have two
messages: one group conversation with the entire class,
and one group conversation between you and the
instructor.
Change-Id: Ic3bab8ce406c565a50ca50ad19d74b949f1caad1
Reviewed-on: https://gerrit.instructure.com/24515
Reviewed-by: Braden Anderson <banderson@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
* asset_id and asset_type aren't used for queries
* we often look up by both uuid and url, so add an index on url, and
split the index on (external_feed_id, uuid) into two
Change-Id: I654e7521d3246fc86a74babf8f190c86a7b6c005
Reviewed-on: https://gerrit.instructure.com/24403
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>
This data fixup would be very expensive to run in production, as it
touches every quiz question record in the database. Besides, quiz
questions will update their workflow_state to "active" the next time
they are saved, .active? responds true for questions with nil
workflow_state, and the `active` scope on QuizQuestion already includes
quiz questions whose workflow_state is nil.
Change-Id: I72fecc53e2f46fd1c2086ec2dc13d448d74486ab
Reviewed-on: https://gerrit.instructure.com/24553
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
Adds workflow state to QuizQuestion models.
Test plan:
- Make a quiz, have a student take the quiz.
- Set some regrade options on the quiz and republish the quiz.
- Go back to the edit page for the quiz and delete a quiz question.
You should not get a error when you do this.
- Make sure the quiz question does not show up by refreshing the
quiz's edit page.
Change-Id: If4bcb0ad28217a527080da9aa32ce6bf7921bfdb
Reviewed-on: https://gerrit.instructure.com/24111
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
only postgres can use the conditions, and mysql complains about us removing
the index supporting the FK, so only do it for postgres
Change-Id: I0700887169ef4e1efe54cf7bb70529fdb7c571ab
Reviewed-on: https://gerrit.instructure.com/24386
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>
also fix migration that was broken cause of this
Change-Id: Icbba288d606a1b9d1ad266fdb2ee4d351e98616a
Reviewed-on: https://gerrit.instructure.com/24276
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
we recently started using unique_constraint_retry instead of
wonky code with Rails validations, but this index didn't exist.
so create it, and clear out dups first
Change-Id: I5abcc6f85f85021128f7eef8ccc5309184b87830
Reviewed-on: https://gerrit.instructure.com/24275
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
This reverts commit 7750505a3d.
There's a lot of duplicates (thousands) already in our production
database, including new ones still being created. Going to track down
cause and fix and determine how to sanitize before adding this index.
reopens CNVS-1194
Change-Id: I14409f8705f356db97d92083ab642717d41df230
test-plan: N/A
Reviewed-on: https://gerrit.instructure.com/24130
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
test plan:
- in a course with no pages (new course is best)
* manually update the course object:
* set default_view to 'wiki'
* manually update the course's wiki object:
* set front_page_url to nil
* set has_no_front_page to true
* navigate to the course home page
- there should not be an error on the page
fixes CNVS-7744
Change-Id: I047db32d2fa7a376be994a1314c0e55a0cadffde
Reviewed-on: https://gerrit.instructure.com/23751
QA-Review: Hannah Bottalla <hannah@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
test plan:
bundle exec rake db:migrate should work
test plan for quiz regrades should still work
Change-Id: I67228b914018fe21358ff08daa1db12988fc43fd
Reviewed-on: https://gerrit.instructure.com/23758
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
postgres is using the indexes to search all objects' titles (in
any context), and then filtering the results by context,
whereas it's a lot faster to use the existing index to filter by
context first and do a linear search through these results.
for example, the wiki sidebar has done this for years (searching
a course's attachments for those whose mime type matches "image/%")
test plan:
- api searches should not be painfully slow
Change-Id: I6a4cd1f64b20bcccea6fe4d56ec78298d26e7b7d
Reviewed-on: https://gerrit.instructure.com/23691
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
fixes CNVS-7620
test plan:
- NOTE: before apply this patchset
* create some rubrics with and without outcomes attached to assignments
* remove some of them
- after applying this patchset, the active ones should still be active, and
the deleted ones should still be deleted.
- if you had old alignments that should have been deleted, but where not, they
should now be deleted (it's difficult to get them to test, at this point)
Change-Id: I813e083357a99a38eb22611b5b5848fbf9525156
Reviewed-on: https://gerrit.instructure.com/23475
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
cause it's pointless. the primary key will always be used instead
Change-Id: Ia5cd67e6111c6bc2f6e67066acbef6fce55701f2
Reviewed-on: https://gerrit.instructure.com/23633
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>
notifications are unsharded, so the data only applies to the default
shard
Change-Id: I742e39c0ae131bc8ce37358285ae35a71e9d928f
Reviewed-on: https://gerrit.instructure.com/23610
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>
This commit gives teachers the ability to regrade quizzes by using
different options per quiz question:
* Current Correct Only
* Full Credit (regardless of answer choice)
* Previous and Current Correct
* No Point change (for updating the display of a question)
Test Plan:
You'll want to run through each question regrade option making sure
scores change appropriately.
"I seldom end up where I wanted to go, but almost always end up where I
need to be." - Douglas Adams
Change-Id: I9dbb88154cd3ac630bf59dbf3e997a87f75649dc
Reviewed-on: https://gerrit.instructure.com/22018
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
migrations are already run once per shard; no need to explode it
into n^2
Change-Id: Id994105b7ed77602b51f30f2d34f96a16536399c
Reviewed-on: https://gerrit.instructure.com/23433
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>
fixes CNVS-7551
unless specifically told otherwise, write cassandra page views straight
to cassandra without putting them through the redis queue first. can
still cause them to go through redis queue by setting
'page_view_cassandra_uses_redis' to 'true'.
test-plan:
- have cassandra page views enabled and set up
- turn off delayed jobs
- navigate to some pages
- generated page views still show up
- set 'page_view_cassandra_uses_redis' setting to 'true'
- navigate to some more pages
- generated page views don't show up (yet)
- restart delayed jobs
- generated page views show up
Change-Id: I66a2991d41e18e1440e5eb68db6aa3d217577f41
Reviewed-on: https://gerrit.instructure.com/23325
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
if the same user answers the same aligned question (through a question
bank) in multiple quizzes, let each quiz's question instance get its own
learning outcome result.
fixes CNVS-1194
test-plan:
- create an account-level outcome
- create an account-level question bank
- align the outcome with the question bank
- create a question in the question bank
- create two quizzes in course(s) under the account using that question
from the bank
- have one student take both quizzes
- look at the student's generated outcome results for that outcome;
there should be two results, one per quiz.
- retake one or both quizzes; there should still only be one result per
quiz, updated with the new score.
Change-Id: I1d27fb51bbe76ebfd66b0ded8c4a579f7381d88e
Reviewed-on: https://gerrit.instructure.com/23276
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
Change-Id: I4fd88488a9e9f19a6fbe924d0a53854fc249c5af
Reviewed-on: https://gerrit.instructure.com/23200
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
QA-Review: Stanley Stuart <stanley@instructure.com>
fixes CNVS-7202
test plan:
* without the CNVS-7202 commits,
make an api request that gets logged as a page view such as
/api/v1/courses/X/discussion_topics?access_token=XXX
* then apply this commit and run the data fixup, and verify that the
data was fixed in the page views store (test with both db store and
cassandra store)
Change-Id: Id10e1ba69cd8c82797fd5b7bcf6309afa0773288
Reviewed-on: https://gerrit.instructure.com/22729
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
slow migrations that aren't strictly necessary for the new code
should wait until after the deploy
Change-Id: I1bc5837567bccddd3babff57495d46996e45508b
Reviewed-on: https://gerrit.instructure.com/23229
Reviewed-by: Paul Hinze <paulh@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
In new conversations, the list of people able to see a
particular message will no longer be equiavalent to the
conversation_participants, so we need to preserve who was able
to see messages so we can display this information in the
interface.
fixes CNVS-7129
test plan:
- regression test old conversations; there should be no
behavioral changes there. Especially look at:
- deleting messages and conversations
- submission comments (deleting these messages and then
adding another comment)
- the internal "delete_for_all" api call (support uses this
to remove naughty conversations)
- when deleting messages/conversations, verify with the
console that the conversation_message_participants are still
present with a workflow_state that is "deleted".
Change-Id: If17c8f2982fd9187f5b7b5e5acb6ecb24c58d4df
Reviewed-on: https://gerrit.instructure.com/22853
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
test plan:
- as a teacher, make a quiz that needs a manual grading type (such as
essay question or file upload)
- change your settings for "All Submissions" to "immediately"
- as the student, turn in the quiz. as the teacher, you should
receive a notification that the quiz needs grading.
fixes CNVS-7403
Change-Id: I5d090ede1b2de1fcdd822bd61cb251e5c744dce1
Reviewed-on: https://gerrit.instructure.com/23124
QA-Review: Myller de Araujo <myller@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
fixes CNVS-7128
test plan
- create a new conversation from the api, specifying context_type
and context_id
- create a batch private conversation from the api, specifying
context_type and context_id
- ensure that the contexts for those conversations are set
(no ui for that, check in the console)
Change-Id: I3268af61ffb2bd9f358ada2d8ca1ecfc7455fade
Reviewed-on: https://gerrit.instructure.com/22804
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Zach Pendleton <zachp@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
fixes CNVS-7131
test plan:
* verify that the conversations API docs include subject
* verify that you can create a new conversation through
the API with a subject
* verify that you can create a new conversation through
the API with a subject to multiple recipients
* verify that conversations API responses include subjects
* open conversations beta interface
* verify that the conversation list includes subjects
* select a conversation
* verify that the subject is displayed above the messages
Change-Id: Ib4f32dc8348d08c10db42ddbe2022565de88dd9d
Reviewed-on: https://gerrit.instructure.com/22754
Reviewed-by: Joel Hough <joel@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
test plan:
* test the new /courses/:course_id/files index endpoint,
which should return all files that belong to a course
* refer to the API documentation to test the
search_term parameter (which should work as with other
API index actions), for:
- Files (both folder and course specific)
- Modules
- Module Items
closes #CNVS-6904
Change-Id: I4c6f80792cda453d53bf48741d14e851f5040dd4
Reviewed-on: https://gerrit.instructure.com/22746
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
closes#6331
test plan:
1. create a new quiz with one question
2. preview it as the teacher (and submit)
3. publish the quiz
4. take the quiz as a student (and submit)
5. go to quiz statistics as the teacher
6. click the "item analysis" link on the right
- observe there is only one row in the csv
download, previously quiz previews created
new rows but shouldn't have
Change-Id: Idedd643d02d6af23006852a2e35620f430a133d8
Reviewed-on: https://gerrit.instructure.com/22527
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Ryan Florence <ryanf@instructure.com>
test plan:
- As a teacher, create a quiz with an essay question and publish the
quiz. Set your notification preferences for grading to
"Immediately".
- As a student, take the quiz.
- As the teacher, you should get a notification that the submission
needs reviewing.
fixes CNVS-6524
Change-Id: I185a10175fcc9528100a1157049ecca5ffcccff5
Reviewed-on: https://gerrit.instructure.com/22642
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
test plan:
* test that the 'search_term' argument can be used
(as documented) in the api 'index' actions for the following:
- assignments
- discussion topics
- external tools
- quizzes
and they behave identically to the wiki pages api
closes #CNVS-7047
Change-Id: I133a9571f134563deb06cd62956238d1e4a57d22
Reviewed-on: https://gerrit.instructure.com/22587
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: August Thornton <august@instructure.com>
* automatically does with_exclusive_scope
* if the scope has an order or group by, use an alternate
implementation so it's not broken
* alternate methods are cursors (postresql only) or temporary
tables. if a transaction is already open, or we're on a slave,
prefer a cursor (even over the normal method, since the query
might be slow even without an order or group by)
test plan:
* migrations should still work (especially data fixups)
* lots of account reports use find_each; make sure they still run
Change-Id: If876b7b3401e6cda1d41f1c94b93af4810b78cf4
Reviewed-on: https://gerrit.instructure.com/22364
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
the api was accepting an array, which was skipping the parsing, stripping of
'.' and whitespace, and downcasing that happened when the parameter was given
as a string. this caused the validation to try to match a file name against
' .DOC' which would always fail.
this fixes the problem and also runs a datafix to correct existing data that
is in this bad state
fixes CNVS-4622
test plan:
- before checking out the patchset, create an assignment and set the allowed
extensions to ".DOC, .XLS"
- check out the patchset and run migrations
- your assignment allowed extension value should have changed to 'doc,xls'
- try to enter the bad value again
- it should save and automatically become the good value
Change-Id: Iea45dd0d5251e418878567b9267eb6252f1e1250
Reviewed-on: https://gerrit.instructure.com/22299
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
fixes CNVS-390
stores and allows querying by user/account/pseudonym of login/logout
events.
test-plan:
[setup]
- set up an 'auditors' keyspace in cassandra and run migrations
- have shardX and shardY on one database server, and shardZ on a
different database server
- have accountW and accountX on shardX
- have accountY and accountZ on shardY and shardZ, respectively
- have userA on shardX with pseudonymAW in accountW and pseudonymAX in
accountX (cross-account, single-shard user)
- have userB on shardY with pseudonymBY in accountY and pseudonymBX in
accountX (cross-shard user)
- have userC on shardZ with pseudonymCZ in accountZ and pseudonymCX in
accountX (cross-db-server user)
- log in and out of each pseudonym above multiple times
[index isolation]
- /api/v1/audit/authentication/pseudonyms/<pseudonymAX> should
include logins and logouts from pseudonymAX only
- /api/v1/audit/authentication/accounts/<accountX> should include
logins and logouts from pseudonymAX, pseudonymBX, and pseudonymCX
but not pseudonymAW
- /api/v1/audit/authentication/users/<userA> should include logins
and logouts from both pseudonymAW and pseudonymAX but not
pseudonymBX or pseudonymCX
[permission isolation]
(in each of these, either :view_statistics or :manage_user_logins on
an account qualifies as "having permission")
- /api/v1/audit/authentication/pseudonyms/<pseudonymAX> should be
unauthorized if the current user doesn't have permission on
accountX
- /api/v1/audit/authentication/accounts/<accountX> should be
unauthorized if the current user doesn't have permission on
accountX
- /api/v1/audit/authentication/users/<userA> should be unauthorized
if the current user doesn't have permission on either of accountW
or accountX
- /api/v1/audit/authentication/users/<userA> should include logins
and logouts from accountW but not from accountX if the current
user has permission on accountW but not on accountX
[sharding]
- /api/v1/audit/authentication/users/<userB> should include logins
and logouts from both pseudonymBY and pseudonymBX
- /api/v1/audit/authentication/users/<userB> should not include
duplicate logins and logouts from either pseudonymBY and
pseudonymBX (potential for bug due to both pseudonyms' shards
being on the same database server)
- /api/v1/audit/authentication/users/<userC> should include logins
and logouts from both pseudonymCZ and pseudonymCX
Change-Id: I74b1573b346935f733fe5b07919d2d450cf07592
Reviewed-on: https://gerrit.instructure.com/21829
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
refs CNVS-6135
This change allows the progress model to track progress for things in
the cache, in addition to the "context" things that it can already
track.
Test Plan:
- use an API that returns a progress_url
- progress model should behave as it did
Change-Id: I63002618e8debc9bfff71deaf6e904da149ba2d5
Reviewed-on: https://gerrit.instructure.com/21978
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
test plan:
* use the API index according to the documentation
with the parameter 'search_term' to search for pages
that contain a given term in their title
closes #CNVS-6748
Change-Id: I68eb652a2f11ec535f91cd10d8b419aa4e7f2eb7
Reviewed-on: https://gerrit.instructure.com/22095
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
on postgres, limit the index to the conditions we use in the scope
test plan:
* n/a
Change-Id: Ie6ea43fde3da0264f0a4bed24f65f017483a1844
Reviewed-on: https://gerrit.instructure.com/22138
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>
closes CNVS-5992
test plan:
- make sure existing turnitin still works
- go to account settings, leave turnitin host blank, save
- it should still work
- change it to api.turnitin.com
- it should still work
- change it to another valid turnitin endpoint
- it should still work
Change-Id: I442871d35f3a8440f49485252cf88dd4cd441ec2
Reviewed-on: https://gerrit.instructure.com/21969
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
fixes CNVS-6742
to keep mysql happy
test plan:
* run migrations on mysql
Change-Id: Ib1d0c78660d096e026bf7e588c790dbcfab94c0b
Reviewed-on: https://gerrit.instructure.com/22076
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>
refs CNVS-6742
mysql requires that FKs have an index, so be sure that the new index
is created before the old index is dropped
test plan:
* migrations should work on mysql
Change-Id: Ife79933a8de7831bc56337b1b63bbcc20b2dde24
Reviewed-on: https://gerrit.instructure.com/22075
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>
fixes CNVS-6592
test plan
- ensure discussion topic locking works as before
- delete and undelete a topic
- ensure that undeleted topic remembers whether it was locked
Change-Id: I389dc68ac181283b77fd23e5ca9b71b8bf6a0b55
Reviewed-on: https://gerrit.instructure.com/21923
Reviewed-by: Mark Ericksen <marke@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
data fixup for wiki pages that were imported during a
certain period when they were set to unpublished by default
but linked to active module content items
test plan:
(Note: the problem should no longer occur, so we will have
to manually re-create the problem)
* create a wiki page
* add the page as a module item
* identify the item id by observing the module item's url
on the modules page -
e.g. (/courses/:course_id/module/items/:item_id)
* open the console and run the following instructions:
id = [INSERT THE ITEM ID HERE]
WikiPage.where(:id => ContentTag.find(id).content_id
).update_all(:workflow_state => 'unpublished')
* now, as a student, clicking the link should give an
'unauthorized' message, as in #CNVS-6177
* run the data fixup by running the following command in
the console:
DataFixup::FixImportedWikiPageWorkflow.run
* now the page should be accessible by students
closes #CNVS-6323
Change-Id: Iffb74de96cb4d3603ccd8a6ecb55567714d95db4
Reviewed-on: https://gerrit.instructure.com/21513
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Clare Strong <clare@instructure.com>
Special survey account notifications (announcements) can be set up on the
site_admin account. These survey notifications will only appear for
accounts that have the "Account Surveys" setting enabled in their
account settings, and they'll only show up for 1/N users in
those accounts each month. N is configurable, defaults to 9.
closes CNVS-6036
test plan:
* On a regular account, create an announcement in account settings.
There shouldn't be any options related to surveys available.
* On the site admin account, create an announcement. Select to make it a
survey. You can leave N at 9 or change it.
* Verify that the survey doesn't show up for any users on accounts
that don't have "Account Surveys" enabled.
* Enable the "Account Surveys" setting on an account. Verify that the
survey shows up for (roughly) 1 out of every N users in the account,
on their dashboard. Change the time on the computer running canvas
to another month. Verify that the survey shows up for a different
set of 1/N users in the account.
Change-Id: If11467d2153acee24a010ba45d516b0b320a4634
Reviewed-on: https://gerrit.instructure.com/21432
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
fixes CNVS-6238
test plan
using the api:
- view a discussion topic as a user that did not author it
- ensure that subscribed: false
- view a discussion topic as the authoring user
- ensure that subscribed: true
- unsubscribe from a discussion topic that the user authored
- ensure that subscribed: false
- subscribe to a discussion topic
- ensure subscribed: true
- subscribe to a topic that requires an initial post with a user
that hasn't posted yet
- ensure that it is an invalid request
- subscribe to a topic that requires an initial post with a user
that has posted
- ensure subscribed: true
Change-Id: Ie76a046bb6e9b5253088c371ffdc4dc6ddf08231
Reviewed-on: https://gerrit.instructure.com/21402
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
refs CNVS-5805
with efficient calculation of all due dates for any submissions for a
given assignment when related records (the assignment, its overrides,
related enrollments, and related group memberships) changes.
compares this cached due date to the submitted_at or current time when
determining lateness.
populates the column for existing submissions in a post-deploy
data-fixup migration.
test-plan:
- run lib/data_fixup/initialize_submission_cached_due_date.rb
- all submissions' cached_due_dates should be updated over several
jobs
- enroll a student in a course and create submissions in that course
- create a second enrollment in a second section; the
cached_due_dates for the user's submissions should recalculate
- destroy the second enrollment; the cached_due_dates for the user's
submissions should recalculate
- create a group assignment
- add the student to a group in the assignment's category; the
cached_due_dates for the user's submissions should recalculate
- remove the student from the group; the cached_due_dates for the
user's submissions should recalculate
- enroll more students in the course
- change an assignment's due date; the cached_due_dates for the
assignment's submissions should recalculate
- create an override for the assignment; the cached_due_dates for
the assignment's submissions should recalculate
- change the due date on the override; the cached_due_dates for the
assignment's submissions should recalculate
- delete the override; the cached_due_dates for the assignment's
submissions should recalculate
- during any of the above recalculations:
- the most lenient applicable override should apply
- if the most lenient applicable override is more stringent than the
assignment due_at, it should still apply
- the assignment due_at should apply if there are no applicable
overrides
Change-Id: Ibacab27429a76755114dabb1e735d4b3d9bbd2fc
Reviewed-on: https://gerrit.instructure.com/21123
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
Tested-by: Jacob Fugal <jacob@instructure.com>
test plan:
* in account settings - quotas tab,
set the default group storage quota
* attempt to upload files to a new group (without a set
quota) until the quota is hit or exceeded, confirming
that the set default is in effect
refs #CNVS-271
Change-Id: Ia4cbd84da19eb07d188dcc85c81c6b45bc2fa7ce
Reviewed-on: https://gerrit.instructure.com/21191
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
fixes CNVS-5708
discussion topics can now be pinned to preserve their
position at the top of the discussion topics index page.
pinned discussions can be manually sorted, while all
other topics remain sorted by most recent activity.
test plan:
* in a course with existing discussion topics, attempt
to drag a topic into the pinned area and verify that
it properly moves to that group and persists on page
refresh;
* move multiple topics into the pinned area and verify
that they can be manually sorted and that the sort
persists on page refresh;
* drag a pinned topic to the open discussion area and
verify that it properly moves there and persists on
page refresh;
* verify that pinned and open topics cannot be dragged
into the locked area;
* verify that open topics offer a pin option in their
gear menus and that pinned topics offer an unpin
option. verify that these options work as expected.
Change-Id: I65dccba5eed11dd8b0996ecd930b93a1d61dbebc
Reviewed-on: https://gerrit.instructure.com/21260
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
QA-Review: Zach Pendleton <zachp@instructure.com>
Tested-by: Zach Pendleton <zachp@instructure.com>
this was removed from the UI in Mar 2011 but was never completely ripped out.
we'd like to remove it now since it was adding extra complexity for no benefit.
closes CNVS-5929
refs #3974
test plan:
- create/update/delete an assignment from the index page, and the show page
- grade an assignment (with and without muting)
- test assignment notifications (with and without muting)
- creating an assignment
- editing an assignment
- changing a due date (after 3 hours of being edited)
- grading an assignment
Change-Id: Ie455bed41154018b5bd2c9c0e69e1e3285a0ac09
Reviewed-on: https://gerrit.instructure.com/20778
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
add an index on updated_at, and effectively use it
Change-Id: I0830a9c6089ba21f0b79a83e36fd0fe8e0d08348
Reviewed-on: https://gerrit.instructure.com/21165
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
closes CNVS-6155
test plan:
- make sure you can upload files for a submission
Change-Id: Id3043682a0784bc5064c8fda1ba09329facea4e5
Reviewed-on: https://gerrit.instructure.com/21154
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
the association isn't smart enough to include conditions on
context_type and context_id in order to utilize the existing index
Change-Id: I62bef79de1b729c6717dadced9a122e856832504
Reviewed-on: https://gerrit.instructure.com/21162
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>
test plan:
* confirm that wiki pages can be created and updated
with the parameter wiki_page[front_page]
* if true, this will set the wiki page as the
front page for the context (assuming the page is
not hidden to students)
* if false, this will unset the page as the front page
(assuming it was the front page to begin with)
* confirm that /courses/:course_id/front_page acts
as a proper endpoint for show/update/destroy and
acts just as /courses/:course_id/pages/:url
for whichever page is set as the front page
* confirm that none of the above page breaks
normal wiki functionality
closes #CNVS-5528
Change-Id: I3f51d740e90ff0a5a39f2aafc988a1a33947ca18
Reviewed-on: https://gerrit.instructure.com/20938
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
adds a parameter to fetch discussion topics ordered by
`last_reply_at` instead of by `position`. Defaults to position
for backwards compatibility. Added a database index to make
fetching this order from the database more efficient.
fixes CNVS-5707
test plan:
- see api documentation for "list discussion topics" and see
the new `order_by` parameter:
- <canvas-url>/doc/api/discussion_topics.html
- create a bunch of discussion topics and modify their order.
- post some replies to some of the topics.
- call api to fetch the list of discussion topics
- fetched topics should be ordered by position, as they
appear on the index page.
- call api to fetch the list of discussion topics and specify
`order_by=recent_activity`
- the fetched topics should be ordered by how recently they
have receieved replies. The most recent should be first.
Change-Id: I4b576677ecf56133c98186171a11dfeb5f987a34
Reviewed-on: https://gerrit.instructure.com/20987
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
to collect data about when scribd (or crocodoc) documents
are not being used and can be purged from third party servers
to save money
fixes CNVS-5310
note: this data is not yet exposed; it can only be queried
from the database manually for now
test plan: make sure the last_inline_view attribute for an
Attachment is updated whenever the attachment is viewed via
scribd or crocodoc. this can be done in several ways:
- via the preview icon that appears next to a document link
in rich text
- on the files page
- for student submissions on SpeedGrader
the easiest way to check this is in the Rails console.
get the attachment id from the canvas url, then,
in the console (after switching to the correct shard),
do
Attachment.find(id).last_inline_view
Change-Id: I137ab631ad4eefdf4d9af353dd11191b7f2ca140
Reviewed-on: https://gerrit.instructure.com/20810
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
to make replication easier for things like slony
Change-Id: I394eca7942b6a4546176d587f37be8f73bc681f2
Reviewed-on: https://gerrit.instructure.com/20807
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
it has been so far, but I'm paranoid
Change-Id: Ic4920da484b82b381c606a606e9584d5d372cbc0
Reviewed-on: https://gerrit.instructure.com/20794
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
fixes CNVS-1667
test plan:
- submit lots of files to an assignment
(lots is ~45 in prod or ~130 in a fresh canvas install)
- you should not get an error
Change-Id: I100830b4cdb9b0cd0f96e7faa0198d1f1c87602c
Reviewed-on: https://gerrit.instructure.com/20521
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
also added a warning to migration_lint about tables with no primary keys
test plan:
* run the migration; it should not fail
Change-Id: I67a065355bb516b84b00313725f079842bbd8974
Reviewed-on: https://gerrit.instructure.com/20705
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
allows creating content migration through the api
Test Plan:
* Create a content migration through the api along with a file upload
* You should be able to follow along with the progress and
the migration should be complete when the progress is done
* Try to update the migration type, you should get an error
* Upload a wrong file type the first time, then go through
the file upload process again on the update endpoint.
refs CNVS-4228
Change-Id: Iab1082ca68b61d1b0493c191b48169a164444d06
Reviewed-on: https://gerrit.instructure.com/19108
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
remove the partialness. we do some queries without specifying
"learning_outcome_group_id IS NULL", so make the index useful to
that query as well
Change-Id: I7f96a93f8cf868afdc45680b34e536c110834f71
Reviewed-on: https://gerrit.instructure.com/20581
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>
Don't automatically mark a discussion entry as read if the user
manually marks the entry as unread.
fixes CNVS-5705
test plan:
- As one user, create a discussion with lots of posts.
- As a different user, go to the discussion, see the entries
are automatically marked as read. Don't scroll all the way
to the bottom of the discussion so there are still some
unread posts.
- Click the gray circle to manually mark some of the read
entries as unread.
- Refresh the page. The manually marked entries should show
as unread and should not be automatically marked as read.
- Scroll down. Unread entries that were not manually marked as
unread should still be automatically marked as read.
Change-Id: I963d1dea9fc961a28a0a5c488399d4e3964c8d10
Reviewed-on: https://gerrit.instructure.com/20414
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
when a user explicitly logs out of one pseudonym session, invalidate all
the others
fixes CNVS-1923
test-plan:
- create a user in two different accounts
- log them in to both accounts
- click "log out" in one account
- should be logged out of both accounts
Change-Id: I79e70017d753c8201429901421e015f5d20e2000
Reviewed-on: https://gerrit.instructure.com/20096
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
fixes CNVS-4106
test steps:
- go to create a discussion topic and ensure that you can toggle between
the 'Graded' and non-graded availability dates. If the Graded is not
checked, you should see the Available From/Until.
- create a discussion topic with a past from and past until. ensure that
the discussion is locked for a student
- create a discussion topic with a future from and future until. ensure
the discussion cannot be seen by the student
- update the above created discussion topic and switch it to be graded
and set a future due, from, until date. ensure that the student cannot
see the discussion.
- edit the discussion and ensure that the graded checkbox is checked and
the group assignment fields are showing
- update the assignment with a past due, from, until and make sure the
discussion is locked for the student.
- do all above with current dates (from in past, until in future) and
make sure the student can see and reply to them.
- create an announcement and ensure that the functionality and forms are
the same as before
- verify that you are able to lock and unlock discussion topics on the
show view by using the gear drop-down
Change-Id: I99c9d54763fe3a74aa8a4bb37c22f09d4765d41e
Reviewed-on: https://gerrit.instructure.com/20339
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
test plan:
- go to the groups page of a course or account
/courses/*/groups or /accounts/*/groups
- edit a group category by clicking on the pencil icon or
click 'make a new set of groups'
- check the 'Allow self sign-up' checkbox
- a textbox should appear to limit group members
- enter a number (2 or 3) for the group limit and save
- add at least on group
- masquerade as students in the course and join a group until it's full
- once the group is full students should not be able to join the group
- also, when editing a group category you should be able to remove the group limit
Change-Id: I0d035320a171b03a7cd2e4d81ecb0648c5aacad0
Reviewed-on: https://gerrit.instructure.com/20309
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Product-Review: Joe Tanner <joe@instructure.com>
this is necessary since csrf protection is disabled for certain quiz submission
actions.
closes CNVS-3986
test plan:
- make sure taking a quiz and submitting still works normally
- make sure previewing a quiz still works normally
- create a new quiz
- start a quiz with one user, answer a few questions
- in a separate tab, log out and log in as another user
- if you change anything, you will get the "logged out" message
- if you try to quickly submit, the answers won't count for you
Change-Id: I2222975ea0cc6ecb346d03dc2077dc411e759084
Reviewed-on: https://gerrit.instructure.com/20051
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Create an event_stream_failures table, and add to it when an EventStream
operation intended for cassandra fails. intentionally swallows the
error, so the code inserting/updating the event stream doesn't notice
and bail on the failure, but we can keep an eye our for new rows and
also have enough data to replay those failures once fixed.
fixes CNVS-4161
test-plan:
- enable cassandra page views but intentionally misconfigure so that
inserts into cassandra fail
- generate traffic in canvas that should create page views
- the browsing user should not notice any errors
- but page views should stay empty
- event_stream_failures should be getting new rows
Change-Id: I1acabfef785ee0637b241924c6ff254c41d3d1e3
Reviewed-on: https://gerrit.instructure.com/19975
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
closes #CNVS-4511
refactor of some of the QuizStatistics model so it can be used with multiple report types
test plan:
just ensure the current quiz stats page and csv report still work,
the item analysis UI commit will have a more comprehensive test plan
Change-Id: I2973a2e3aa572bc272c59b4b97015c7f93d756d7
Reviewed-on: https://gerrit.instructure.com/20057
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Joe Tanner <joe@instructure.com>
QA-Review: Joe Tanner <joe@instructure.com>
test plan:
* import a package containing an item that is
invalid so it will create a
"Couldn't import the" item warning, but also
have an extremely long title (~250 characters)
(an example is attached to the ticket)
* confirm that when trying to import,
the entire migration does not fail silently,
and thus hang in the import phase,
but instead creates a proper migration issue
for the invalid item and continues the import
normally
fixes #CNVS-5467
Change-Id: I2659ac0c5531ad609f3f58abc1fc0960e9d85c51
Reviewed-on: https://gerrit.instructure.com/19961
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
fixes CNVS-5339
a previous datafix dissociated some discussion topics from
their related assignments; this fix restores the
assignment_id for those discussions.
test plan:
* run specs
Change-Id: I5deaea1b4969588b2bcc12e62de063c6e47a48f8
Reviewed-on: https://gerrit.instructure.com/19671
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
QA-Review: Zach Pendleton <zachp@instructure.com>
removed unused code to import an ical feed into a calendar,
and dropped the external_feed_id from the calendar_events
table because it isn't being used.
Change-Id: I9c093f4f2f63cc503d74bfc1cde089bf24ea0d73
Reviewed-on: https://gerrit.instructure.com/19615
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Eric Berry <ericb@instructure.com>
QA-Review: Zach Pendleton <zachp@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>