Merge branch 'release'

Conflicts:
	cms/templates/widgets/source-edit.html
This commit is contained in:
Chris Dodge
2014-04-14 14:17:03 -04:00
291 changed files with 40243 additions and 468850 deletions

View File

@@ -20,6 +20,7 @@ from student.models import unique_id_for_user
from util.json_request import expect_json
from open_ended_grading.utils import does_location_exist
from dogapi import dog_stats_api
log = logging.getLogger(__name__)

View File

@@ -124,7 +124,7 @@ class StaticPdfBookTest(StaticBookTest):
response = self.client.get(url)
self.assertContains(response, "Chapter 1 for PDF")
self.assertNotContains(response, "options.chapterNum =")
self.assertNotContains(response, "page=")
self.assertNotContains(response, "options.pageNum =")
def test_book_chapter(self):
# We can access a book at a particular chapter.
@@ -132,8 +132,8 @@ class StaticPdfBookTest(StaticBookTest):
url = self.make_url('pdf_book', book_index=0, chapter=2)
response = self.client.get(url)
self.assertContains(response, "Chapter 2 for PDF")
self.assertContains(response, "file={}".format(PDF_BOOK['chapters'][1]['url']))
self.assertNotContains(response, "page=")
self.assertContains(response, "options.chapterNum = 2;")
self.assertNotContains(response, "options.pageNum =")
def test_book_page(self):
# We can access a book at a particular page.
@@ -142,7 +142,7 @@ class StaticPdfBookTest(StaticBookTest):
response = self.client.get(url)
self.assertContains(response, "Chapter 1 for PDF")
self.assertNotContains(response, "options.chapterNum =")
self.assertContains(response, "page=17")
self.assertContains(response, "options.pageNum = 17;")
def test_book_chapter_page(self):
# We can access a book at a particular chapter and page.
@@ -150,8 +150,8 @@ class StaticPdfBookTest(StaticBookTest):
url = self.make_url('pdf_book', book_index=0, chapter=2, page=17)
response = self.client.get(url)
self.assertContains(response, "Chapter 2 for PDF")
self.assertContains(response, "file={}".format(PDF_BOOK['chapters'][1]['url']))
self.assertContains(response, "page=17")
self.assertContains(response, "options.chapterNum = 2;")
self.assertContains(response, "options.pageNum = 17;")
def test_bad_book_id(self):
# If the book id isn't an int, we'll get a 404.

View File

@@ -80,9 +80,6 @@ def pdf_index(request, course_id, book_index, chapter=None, page=None):
raise Http404("Invalid book index value: {0}".format(book_index))
textbook = course.pdf_textbooks[book_index]
if request.GET.get('viewer','') == 'true':
return render_to_response('pdf_viewer.html')
if 'url' in textbook:
textbook['url'] = remap_static_url(textbook['url'], course)
# then remap all the chapter URLs as well, if they are provided.
@@ -102,6 +99,7 @@ def pdf_index(request, course_id, book_index, chapter=None, page=None):
},
)
@login_required
def html_index(request, course_id, book_index, chapter=None):
"""