I teach computer science, specifically the Python language. In Python, spaces at the beginning of lines of code have important meaning.
I give a lot of comments about my student's code using the Speed Grader. However, I have found that spaces at the beginning of lines in my comments are removed by Canvas.
For example, I might write a comment like this (I will use <b> to represent a space):
In these lines of code:
for i in range(0, 10):
That is, I have indented the second line with 4 spaces - which is meaningful.
However, after submitting the comment, it looks like this:
for i in range(0, 10):
The leading spaces in the second line have been removed.
I spend a lot of time ensuring that my comments are correctly coded, with proper indenting (4 spaces). But when my students read my comments, because Canvas has removed my indenting, the meaning is not clear.
This is important to anyone teaching computer science.
I have submitted this as a bug to the Canvas Support people, and I got an automated response, but nothing has happened with it.
Can anyone recommend a work-around??? (Or a way to raise the priority of this bug?)
I think he's talking about the submission comments, which means this isn't a design bug as much as a case of comments not supporting HTML (rich content), which has been brought up multiple times in the community. Stripping out extraneous spaces at the beginning and ending of the paragraphs is desirable in most cases -- unless you happen to be commenting in Python or some other language where spaces are important. Even then, the font is not a fixed-width font, which means that it's going to be difficult to tell exactly what the indentation is. You might be able to tell that there are two levels of indentation, but not, for example, whether it was 8 spaces or 7 spaces.
There isn't a solution with leaving text in the submission comment field. You would need to use something else like making them in a document and attaching that document or marking it up in Crocodoc (not ideal). Another thing would be to use some website that allows you to paste sample code and then provide a link to that -- several languages even have sites where you can run code from the web browser and test it out.
Alas, programming is another one of those areas like math and science that have very technical requirements that don't quite reach the critical mass needed to fix the existing system when there are plans made to revise how things are done anyway at some point in the future.
Some other programming instructors have gone to using different systems for their students to submit programming work as Canvas is not efficient at that either. At one time, there was an LTI for doing this with GitHub, but I think it's fallen by the wayside (not positive about that).
Yes, @James , that's what I suspected--the submission comments--and I'm hoping that @ikalb can confirm that, because as you've pointed out, that field doesn't support HTML. If that's the case, Irv, have a look at https://community.canvaslms.com/ideas/1128-rich-text-editor-in-speedgrader-comments , a feature idea that is currently open for voting and in Product Radar status.
And if you're referring to a different place altogether (e.g. inline comments on a document in the previewer), please let us know!
Yes, I did submit a ticket with support. Ticket number: 02012382
And yes, I am talking about submission comments in the Speed Grader.
Students submit their homework to me as a file, and I add comments using the Speed Grader to give them feedback on what they wrote. I often want to show a student a snippet of their code (maybe just a few lines) and show how it could have been improved. So, I copy and paste their code, then say, "here's how it could have been done", and type in a few lines of my own code, as a demonstration.
But when they receive the comment, all lines are left aligned, and what I wrote is not clear to my students.
I understand that if I were to make a separate document that it would keep the indentation correctly. But there is just not enough time to do this.
Canvas should keep whatever I type in - independent of the underlying representation of the data.
(I will take a look at the Rich Text Editor in Speed Grader Comments link - thanks.)
Not that I want to do this, but in some bulletin boards that I subscribe to, they allow for "code tags" to distinguish code from pure text. That is, they allow you to enter something like this:
Now I will show you some code:
if a == b:
print 'They are the same'
I tried that in Canvas in a submission comment, and it did not work (it removed the spaces).
Hello there, @ikalb ...
I noticed that there hasn't been any new activity in this particular discussion topic since June 6th, and so I thought that I would check in with you. I've reviewed the conversations above...and I am right there with you in understanding the importance of spaces in code. I'm not sure that any one solution has been found for your question at this time. Have you found anything on your own that you'd be willing to share back here in the Canvas Community? For now, I'm going to mark your question as "Assumed Answered" ... not because an answer has been given, but because there hasn't been any new activity in this topic for a while. I hope that's okay with you. Looking forward to hearing from you soon, Irv.
Unfortunately, I have not found any solution to this. It continues to be a serious annoyance for me - but more so for the students that I am writing comments for. If you have the ability to change the status, please do not leave it as "Assumed Answered", because I have no solution. I am open to suggestions. I am also interested in finding any ways to elevate this bug report (Ticket number: to someone within the company who might take an interest in fixing it.
Hello @ikalb ...
I'm sorry to hear that you've still not found a solution to this. I don't really have an answer for you, but I think there's been some good insights from other Community members above. I've gone ahead and unmarked this as "Assumed Answered". We sometimes mark things with this label not because we've necessarily found an answer but because a particular discussion topic hasn't seen much activity after a month or two. Thanks for responding.
I am still looking for a solution to this problem - Canvas eliminates leading spaces in comments.
If anyone has any suggestions for a solution with the current version of Canvas (maybe some special keys or tags that I don't know about) I would love to hear it.
However ... if anyone knows what I can do (who to contact) to get this actually fixed in Canvas, I would love to hear that too.
i teach basic stats to vocational education students and it would be greate to display a very simple frequency table. initially, i tried to create the table by putting in spaces and was surprised to see that canvas removed them:
Number of pets Frequency
i have tried looking for keyboard characters that would replace the space but a full stop is probably the best:
Number of pets Frequency
This all comes back to being able to put enhanced content in the conversation area of speed grader.