Commit Graph

26 Commits

Author SHA1 Message Date
Cody Cutrer 9834937c8c don't autorequire a bunch of gems that are rarely used
Change-Id: I09ed3686629b62849d392684d587f30cb2047013
Reviewed-on: https://gerrit.instructure.com/51853
Tested-by: Jenkins
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-04-09 18:47:50 +00:00
Cody Cutrer 9c1e2a539c clean up render :action/:template calls
specific forms of :template were deprecated, and you don't even
need to specify that as the option (it's the default first
argument)

Change-Id: I8db2860cdaf46b105b2f981ed3e0bd923af4ef89
Reviewed-on: https://gerrit.instructure.com/51389
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2015-04-01 20:27:50 +00:00
Simon Williams 8d159face9 always include student replies in group discussion topic podcast feed
fixes CNVS-9825

test plan:
- as a teacher, create a course discussion, with 'Enable podcast feed'
  checked
- reply (still as teacher), and include a link to an uploaded mp3 file
- as a student, reply with a link to another uploaded mp3
- if 'Include student replies in podcast feed' and the student access
  the podcast feed (link is on the discussion show page), it should
  include both mp3s. if that options is false, it should only include
  the mp3 from the teacher.
- repeat the process for a group discussion, but notice that for group
  discussions, 'Include student replies in podcast feed' is not an
  option.
- group discussions should always include student replies in the feed

Change-Id: I54b8b3498d0d428576b904526702814930ec9d55
Reviewed-on: https://gerrit.instructure.com/50658
Tested-by: Jenkins
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
QA-Review: Adam Stone <astone@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2015-03-30 22:29:02 +00:00
James Williams e57003b645 require context read access for discussion topics
test plan:
* create a course with a discussion topic
* keep it unpublished but add a student
* as a student, should not be able to
 view the discussion topic through a direct link

closes #CNVS-6384

Change-Id: I0c0bc66e377d870de6c97555e25e82a8226264f4
Reviewed-on: https://gerrit.instructure.com/48278
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Adam Stone <astone@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2015-02-06 21:32:20 +00:00
Cody Cutrer dacf060160 no more dynamic finders
fixes CNVS-15126

Change-Id: I48b99ff69942463df6d6c355fe6f8a2fc679e69a
Reviewed-on: https://gerrit.instructure.com/41969
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>
2014-10-03 16:22:49 +00:00
James Williams 81558f728c remove rails 2 support
closes #CNVS-14261

Change-Id: I1b0e8a4438ab659ecd1ac8462bc3559d810989b3
Reviewed-on: https://gerrit.instructure.com/38744
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-08-06 18:16:19 +00:00
Nick Cloward e9595976c1 clean up permission calls for grants_rights?
refs: CNVS-11425

Change-Id: Ia0145e4b4d1da9e0f83a1845647ce203b3586057
Reviewed-on: https://gerrit.instructure.com/34280
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-06-19 18:10:30 +00:00
James Williams 6f2b03a56b create temporary records with .scoped.new for rails 3 compatibility
in rails 3, .new is analogous to .build for collections, so otherwise
temporary records will be added to the collection (and be autosaved)

Change-Id: I08ce7b4b35ee35646aff3afd237bbe896162a014
Reviewed-on: https://gerrit.instructure.com/30334
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2014-02-20 20:55:11 +00:00
James Williams 2add6031a8 fix for discussion_entries_controller for rails 3
Change-Id: Ib1ac230cefdc984d6709893ea47278f793037369
Reviewed-on: https://gerrit.instructure.com/29963
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2014-02-11 20:18:01 +00:00
Zach Pendleton 908dfb1e57 reduce duplication in DiscussionEntriesController
fixes CNVS-10132

test plan:
  * run specs

Change-Id: Ie7ee61b6ab88a5b79bfc7333c586a8b13c39e380
Reviewed-on: https://gerrit.instructure.com/27787
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
QA-Review: Zach Pendleton <zachp@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
2013-12-20 22:00:57 +00:00
Rob Orton fc80fa2b77 change api doc examples to be https instead of http
closes CNVS-3912

test plan
- api docs should be updated and display

Change-Id: Ie6d4c80b91e3e3c8cee4b6d2e93c000f1040fd35
Reviewed-on: https://gerrit.instructure.com/25657
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2013-10-25 18:32:42 +00:00
Jacob Fugal b12791aa99 to_json unnecessary (and wrongish) in render :json
refs CNVS-7597

render :json => thing will call ActiveSupport::JSON.encode(thing) unless
thing is a String. ActiveSupport::JSON.encode(thing) just calls
thing.to_json but with some circular reference checking that we want. we
may also want enhance ActiveSupport::JSON.encode to do additional
processing, and calling to_json straight up would bypass that.

in the cases where we do need to do the structural transformation before
passing to render :json (e.g. because of need to pass arguments), use
as_json to do structural transformation only, vs. to_json that does
serialization of the as_json result.

adds a rake task to lint the controllers to enforce as_json over to_json
in render json calls.

test-plan: heavy regression testing; no end behavior should change
(except a pair of serialization bugs that got fixed)

Change-Id: I7a91a9fe0eca70456bc5bca233f0ed6b27a54aaf
Reviewed-on: https://gerrit.instructure.com/23650
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-10-02 18:05:22 +00:00
Duane Johnson 4cd394fc76 API doc standardization - part 7
discussion, enrollment controllers

Change-Id: Icafd128b6bebcd84dc05a8eafec59ffc573a2aaa
Reviewed-on: https://gerrit.instructure.com/23300
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
QA-Review: Duane Johnson <duane@instructure.com>
2013-08-16 14:49:33 +00:00
Brian Palmer de0574994c keep media comment information in API round trip
closes CNVS-5218

test plan: insert audio and video comments into rich text that goes
through the api (for instance assignment descriptions, and discussion
entries). modify the content multiple times, the audio and video should
still play correctly. use the api to pull the same content, modify it,
and push it back through the api. the content should still play
correctly.

Change-Id: Id38ef78aaa478c66ae2314b30d33ec3f2199a6bd
Reviewed-on: https://gerrit.instructure.com/19598
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-04-26 19:39:08 +00:00
Brian Palmer 581fe4330d api documentation updates
* Allow linking to individual endpoints on the page.
* Give each endpoint a summary string, and list the summaries at the top
  of the page, with links to the endpoint details.
* Make an omnibus "all resources reference" page, which has been a
  common request. This only includes the endpoint details, not the
  summary descriptions of the resources.
* Syntax highlighting for JSON

test plan: visit /doc/api/index.html and see the changes (run rake
doc:api first if on a dev box)

Change-Id: Ib126805825d40770c36b3688668c62938348412d
Reviewed-on: https://gerrit.instructure.com/10516
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2012-05-04 11:19:51 -06:00
Simon Williams e4e34ca31d ensure atom feeds have absolute urls and authors; fixes #7047
named_context_url wasn't always giving back absolute urls where it needed to
for atom feeds. additionally, some atom entries did not author entries which
are needed when the main feed does not have an author entry.

test-plan:
- view a modified atom feed in the browser and make sure all links are absolute
  and all entries have an author.
- if the url is externally available, run it through http://feedvalidator.org/
  and check that it validates.

Change-Id: I9bc2b99cd15ed5677bfd9d2cb977a29568ae4016
Reviewed-on: https://gerrit.instructure.com/9833
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-04-09 09:02:56 -06:00
Brian Palmer 0a2e19fb8d store full message in materialized view, not summary
test plan: pull a materialized view from the /view api (making sure it
was generated with this changeset), verify you get the message back
rather than the summary

Change-Id: Ifd61218d40c67f43b85ed0171f3b90f8a20dd291
Reviewed-on: https://gerrit.instructure.com/9632
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
2012-03-27 14:32:37 -06:00
Brian Palmer d17286f789 update/delete discussion entry apis, refs #7567
test plan: no UI yet. update an entry, verify it gets the new message
(and updated at time). delete an entry, verify it's deleted. attempt
both as a user without permission on that entry, verify you get a 401
and the content doesn't change. also update/delete a student's entry as
a teacher.

Change-Id: I8433aa78e70b3c0597e76de1b8e1634c9f0dd27b
Reviewed-on: https://gerrit.instructure.com/9366
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-03-22 15:33:31 -06:00
Simon Williams 258e6b36f3 read/unread state + counts for discussions; closes #7173
the backend for tracking read/unread state of discussion entries/topics and
unread counts for discussion topics. the strategy is to assume that an entry is
unread unless there is an an entry in the join table indicating otherwise.

interface:
- DiscussionEntry has #read_state, #read?, and #unread?. You can use these
  either by passing in a user directly, or by setting the current_user
  attribute on the object before calling the method (useful for json). This
  should already be handled for existing controllers.
- DiscussionTopic read_state functionality as above, plus #unread_count. Same
  general idea with current_user as above.
- routes are setup through the api, use PUT to mark read, DELETE to mark
  unread, or rails helpers like course_discussion_topic_mark_read_path

test plan:
- click through discussion pages, and make sure they all still work (no visible
  changes though, this is backend only)
- manually call some of the above methods from the console
- make sure sql for updates is reasonable

Change-Id: I655ab6a69a8cbdf1c7c99a5548b8ed0d7eadba02
Reviewed-on: https://gerrit.instructure.com/8671
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-02-24 13:34:54 -07:00
Brian Palmer aab48241da remove extraenous respond_to { format.xml } blocks
closes #6511

we don't ever actually use or support xml responses, this is just cruft
and possible data leakage.

testplan: Hit URLs like /courses/XX/assignments/YY.xml, you should get a
406 error response or the HTML response rather than XML.

Change-Id: I0182a1dfb2bfb3ee0da896b98246a5b94604b1b2
Reviewed-on: https://gerrit.instructure.com/7245
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-12-05 08:56:08 -07:00
Bracken Mosbacker 5c57abea78 don't show discussion responses in stream when not allowed
Discussions have an option to not allow users to see replies
until they've posted themselves. This worked correctly on the
discussion page itself, but the user would still see the
replies in their stream

This also removes that option, and the delayed posting option
from group discussion topics. These settings are useless in
that context because all users are admins and can see the
topics anyway.

Test Plan:
 * create a topic in a course and check the box "Replies are not visible until after users post"
 * post a reply to that topic as the teacher
 * log in as a student in that course and go to your dashboard
 * you should see the topic in the stream but not the response you created as a teacher

closes #4706

Change-Id: I0c50a3adb8e18ea74d209f4c9a5ac429b7faaf0e
Reviewed-on: https://gerrit.instructure.com/6684
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-11-04 12:27:27 -06:00
JT Olds 3f01120262 discussion entry i18n
Change-Id: I26ec39847448911074e96a5780ceb7f75630209f
Reviewed-on: https://gerrit.instructure.com/4112
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-06-09 16:29:59 -06:00
Brian Palmer c3d98b2fd0 must_contribute context module progressions, fixes #4734
Change-Id: I5301593def5de7d3fc72c2b51f95b13d7f2eaae8
Reviewed-on: https://gerrit.instructure.com/3989
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-06-02 10:37:14 -06:00
Brian Whitmer 5e9f3eaba7 option to require initial post before seeing replies
Teachers can specify that before students see any
messages in a topic they need to post at least once
in the topic themselves.  This is used for
assignment topics or to help encourage students
to think for themselves instead of just posting
"what he said".

fixes #3871

Change-Id: I946b71ec47bfe135f06faff68598c6f19c088a27
Reviewed-on: https://gerrit.instructure.com/2370
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2011-03-29 22:56:45 -06:00
Brian Whitmer 76bfff3157 topic podcasts
Each topic can now have its own podcast stream.  Teachers
have to manually turn on the podcast for the topic, and
can specify whether student comments show up in the stream
or not.

fixes #3538

Change-Id: I19b1b44fc2eec864cfeb298163ef34a0b0181067
Reviewed-on: https://gerrit.instructure.com/2369
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-03-28 14:32:16 -06:00
Brian Whitmer 8b8173dcc9 Initial commit.
closes #6988138
2011-01-31 18:57:29 -07:00