Community

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ikalb
New Member

Keeping spaces in Speed Grader comments

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):
<b><b><b><b>print i

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):
print i

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?)

Thanks,

Irv

13 Replies
Robbie_Grant
Community Coach
Community Coach

 @ikalb ,

Did you open a ticket with Support to report this and if so, do you have the ticket number?

Robbie

Stef_retired
Community Team
Community Team

 @ikalb , where exactly are you entering this code?

And, as  @Robbie_Grant ‌has suggested, please supply your ticket number.

James
Community Champion

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!

ikalb
New Member

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.) 

ikalb
New Member

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:

[code]

if a == b:

    print 'They are the same'

[/code]

I tried that in Canvas in a submission comment, and it did not work (it removed the spaces).  

Chris_Hofer
Community Coach
Community Coach

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.

ikalb
New Member

Hi Chris,

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:  02012382) to someone within the company who might take an interest in fixing it.

Irv

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.

Robbie_Grant
Community Coach
Community Coach

 @ikalb ,

Were you able to find an answer to your question? I am going to go ahead and mark this question as answered because there hasn't been any more activity in a while so I assume that you have the information that you need. If you still have a question about this or if you have information that you would like to share with the community, by all means, please do come back and leave a comment.  Also, if this question has been answered by one of the previous replies, please feel free to mark that answer as correct.

 

Robbie

ikalb
New Member

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.

Irv

0 Kudos
poppet
Community Member

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

0 5

1 3

2 1

 

i have tried looking for keyboard characters that would replace the space but a full stop is probably the best:

 

Number of pets   Frequency

0..............................5

1...............................3

2..............................1

 

This all comes back to being able to put enhanced content in the conversation area of speed grader.

d.

 

0 Kudos
poppet
Community Member

this is how it is done:

Screenshot 2022-07-12 124437.jpg

add blank emojis at the beginning.

get them here:

https://emojipedia.org/

or copy this: →ㅤ← (copy in-between the arrows)

d.

(just call me a canvas god)

0 Kudos