diff --git a/docs/index.rst b/docs/index.rst index 81cf5ea..436dffe 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -37,6 +37,7 @@ Notes :caption: Some useful notes on aspects of using the library on_meta_dot_json + markdown_1 making_links_to_existing_content wishlist unit_tests diff --git a/docs/markdown_1.rst b/docs/markdown_1.rst new file mode 100644 index 0000000..e8cd02d --- /dev/null +++ b/docs/markdown_1.rst @@ -0,0 +1,5 @@ +Making sure markdown renders when there is a
+=================================================== + +Any time you have a "
" (in a header, footer, body, etc.) make sure that the option markdown="1" is included. +Otherwise, markdown will not render properly on Canvas. \ No newline at end of file diff --git a/docs/tutorials/styling_content.rst b/docs/tutorials/styling_content.rst index 9e2d77c..c77c368 100644 --- a/docs/tutorials/styling_content.rst +++ b/docs/tutorials/styling_content.rst @@ -39,10 +39,14 @@ I hope they're self-documenting in purpose and content. Here's what's in the `h -
+
+ +Note the markdown="1" included in the
above. Any time you include a
, make sure that this appears. +Otherwise, markdown will not render. + The footer simply closes the `div` I opened in the header: .. code-block:: html diff --git a/docs/tutorials/uploading_files.rst b/docs/tutorials/uploading_files.rst index 4a97c26..93169b0 100644 --- a/docs/tutorials/uploading_files.rst +++ b/docs/tutorials/uploading_files.rst @@ -1,12 +1,13 @@ How to upload a file -------------------------------------------------------------------------- - +When uploading a file `FILE.XXX`, a `meta.json` file should be created in a folder named `FILE.file`, +specifying where the file is sent on Canvas. The `meta.json` file ==================== -Filenames and titles of files are distinct on canvas: +Filenames and titles of files are distinct on Canvas: the latter is what you will see when the file is placed in a module, while the former is what is shown in the file structure. You can place a file in as many modules as you wish by specifying the modules in the `meta.json` file. @@ -16,7 +17,7 @@ If no module with the specified name exists, a module will be created to house t The `destination` key specifies where in the file structure you would like the file to be placed. Note that while a file cannot be simultaneously placed in multiple file structure locations using `meta.json`, if `meta.json` is updated, -the file will not automatically be deleted from any previous location unless that instance is specifically deleted. +the file will **not** automatically be deleted from any previous location unless that instance is specifically deleted. Example @@ -34,7 +35,7 @@ If the `meta.json` file looks like: "destination": "course_info/syllabus_schedule" } -then the file `F24_Math100_syllabus.pdf` will be put into two modules: `Course Information` and `Week 1`. +then the file in question will be named `F24_Math100_syllabus.pdf` and put into two modules: `Course Information` and `Week 1`. Within these two modules, its title will appear to students as `Syllabus`. The file will be located in `course_info/syllabus_schedule`, which will be created if it did not already exist. diff --git a/test/test_droplets.py b/test/test_droplets.py index ca69255..7170bd8 100644 --- a/test/test_droplets.py +++ b/test/test_droplets.py @@ -57,17 +57,17 @@ def test_doesnt_find_deleted(self, course, page): name = page.name page.publish(course,overwrite=True) - assert mc.is_page_already_uploaded(name,course) - f = mc.find_page_in_course(name,course) + assert mc.course_interaction_functions.is_page_already_uploaded(name,course) + f = mc.course_interaction_functions.find_page_in_course(name,course) f.delete() # print([i.name for i in course.get_pages()]) - assert not mc.is_page_already_uploaded(name,course) + assert not mc.course_interaction_functions.is_page_already_uploaded(name,course) def test_can_find_published(self, course, page): page.publish(course,overwrite=True) - assert mc.is_page_already_uploaded(page.name,course) + assert mc.course_interaction_functions.is_page_already_uploaded(page.name,course) diff --git a/test/test_file.py b/test/test_file.py index 66b221a..06cee04 100644 --- a/test/test_file.py +++ b/test/test_file.py @@ -82,7 +82,6 @@ def test_already_online_raises(self, course, content): def test_attributes(self, course, content, current_file): content.publish(course,overwrite=True) assert current_file.filename == 'ds150_course_logo.pdf' - assert current_file.modified_at_date.day == datetime.date.today().day diff --git a/test/test_image.py b/test/test_image.py index 6140773..6d2f8bd 100644 --- a/test/test_image.py +++ b/test/test_image.py @@ -45,15 +45,17 @@ def test_can_find_published_image(self, course, image): def test_doesnt_find_deleted_image(self, course, image): image.publish(course,'images',overwrite=True) assert mc.course_interaction_functions.is_file_already_uploaded(file_to_publish,course) - f = mc.find_file_in_course(file_to_publish,course) + + f = mc.course_interaction_functions.find_file_in_course(file_to_publish,course) f.delete() + assert not mc.course_interaction_functions.is_file_already_uploaded(file_to_publish,course) def test_can_get_already_published_image(self, course, image): # first, definitely publish image.publish(course,'images',overwrite=True) - img_on_canvas = mc.find_file_in_course(file_to_publish,course) + img_on_canvas = mc.course_interaction_functions.find_file_in_course(file_to_publish,course) assert img_on_canvas.filename == filename diff --git a/test/test_link_to_local_file.py b/test/test_link_to_local_file.py index 4dbb790..a63d956 100644 --- a/test/test_link_to_local_file.py +++ b/test/test_link_to_local_file.py @@ -60,17 +60,17 @@ def test_doesnt_find_deleted(self, course, page): name = page.name page.publish(course,overwrite=True) - assert mc.is_page_already_uploaded(name,course) - f = mc.find_page_in_course(name,course) + assert mc.course_interaction_functions.is_page_already_uploaded(name,course) + f = mc.course_interaction_functions.find_page_in_course(name,course) f.delete() # print([i.name for i in course.get_pages()]) - assert not mc.is_page_already_uploaded(name,course) + assert not mc.course_interaction_functions.is_page_already_uploaded(name,course) def test_can_find_published(self, course, page): page.publish(course,overwrite=True) - assert mc.is_page_already_uploaded(page.name,course) + assert mc.course_interaction_functions.is_page_already_uploaded(page.name,course) diff --git a/test/test_page_in_module.py b/test/test_page_in_module.py index 9e50f94..cebe368 100644 --- a/test/test_page_in_module.py +++ b/test/test_page_in_module.py @@ -33,7 +33,7 @@ def destination_modules(page_plain_text_in_a_module): def _delete_test_modules(course, destination_modules): for m in destination_modules: - mc.delete_module(m, course, even_if_doesnt_exist=True) + mc.course_interaction_functions.delete_module(m, course, even_if_doesnt_exist=True) @@ -58,23 +58,23 @@ def test_already_online_raises(self, course, page_plain_text_in_a_module): def test_can_make_modules(self, course, destination_modules): for m in destination_modules: - mc.create_or_get_module(m,course) + mc.course_interaction_functions.create_or_get_module(m,course) def test_can_delete_modules(self, course, destination_modules): _delete_test_modules(course, destination_modules) for m in destination_modules: - mc.create_or_get_module(m,course) + mc.course_interaction_functions.create_or_get_module(m,course) for m in destination_modules: - mc.delete_module(m, course, even_if_doesnt_exist=False) + mc.course_interaction_functions.delete_module(m, course, even_if_doesnt_exist=False) def test_page_in_module_after_publishing(self, course, page_plain_text_in_a_module, destination_modules): page_plain_text_in_a_module.publish(course,overwrite=True) - assert mc.is_page_already_uploaded(page_plain_text_in_a_module.name,course) + assert mc.course_interaction_functions.is_page_already_uploaded(page_plain_text_in_a_module.name,course) page_plain_text_in_a_module.ensure_in_modules(course) @@ -89,15 +89,15 @@ def test_page_in_module_after_publishing(self, course, page_plain_text_in_a_modu # name = self.page.name # self.page.publish(self.course,overwrite=True) - # self.assertTrue(mc.is_page_already_uploaded(name,self.course)) + # self.assertTrue(mc.course_interaction_functions.is_page_already_uploaded(name,self.course)) # f = mc.find_page_in_course(name,self.course) # f.delete() # # print([i.name for i in self.course.get_pages()]) - # self.assertTrue(not mc.is_page_already_uploaded(name,self.course)) + # self.assertTrue(not mc.course_interaction_functions.is_page_already_uploaded(name,self.course)) # def test_zzz_can_find_published(self): # self.page.publish(self.course,overwrite=True) - # self.assertTrue(mc.is_page_already_uploaded(self.page.name,self.course)) + # self.assertTrue(mc.course_interaction_functions.is_page_already_uploaded(self.page.name,self.course))