numbas / Numbas

A completely browser-based e-assessment/e-learning system, with an emphasis on mathematics
http://www.numbas.org.uk
Apache License 2.0
198 stars 118 forks source link

Increase the feedback message width or set figure size #949

Closed chrismgraham closed 1 year ago

chrismgraham commented 1 year ago

At the moment, the default figure size from matplotlib gives rise to horizontal scrollbars in the feedback message. I guess we could set the figure size, but is it possible for the feedback message div be made wider (even if just for the programming extension and/or if there is an image in the output)?

Extending feedbackMessages to max-width: 60em and max-height: 40em is much more accommodating for figures.

christianp commented 1 year ago

I think the max-width was only to ensure that the feedback icons on the left line up. If we move them to the right, then that's not a problem.

I'm not sure how I feel about the max-height. My inclination is to get rid of it, but it must be there for a reason.

How do you feel about this?

image

aarchiba commented 1 year ago

This looks like an improvement, and would help with tracebacks as well, or print statement output where appropriate (although line breaks aren't respected there).

christianp commented 1 year ago

@aarchiba can you explain what you mean about line breaks not being respected?

chrismgraham commented 1 year ago

Looks good to me (and got to practice some German). With regards to the height, I do find that with output and multiple marking tests in the programming extension, it's often necessary to scroll. I can't think of a downside to removing it, though a max-height on stdout/err in case a student prints something inordinately large might be an idea

christianp commented 1 year ago

We definitely need to set some max dimensions. At the moment I think it should apply to individual feedback items, rather than the whole feedback area.

aarchiba commented 1 year ago

@aarchiba can you explain what you mean about line breaks not being respected?

print("message 1")
print("message 2")

results in the output area containing "message 1 message 2"; presumably this has to do with stdout being interpreted as HTML. (I haven't tried sending any really interesting HTML yet.)

christianp commented 1 year ago

When I enter that code, it puts the messages on separate lines, as I expected: image

The stdout isn't interpreted as HTML. Could this be a browser bug? Which browser are you using? I used Firefox.

aarchiba commented 1 year ago

Aha, I was including print statements in the postamble to help troubleshooting, and they don't get formatted that way.

This is clearly a separate issue, though.

aarchiba commented 1 year ago

As far as the original issue goes, we did indeed have a class full of students who either squinted and scrolled to figure out what their plots looked like, or didn't even realize we were showing their output plot.

aarchiba commented 1 year ago

Is there any chance of this fix making it in to the code base before I finish teaching?

christianp commented 1 year ago

Probably not, sorry - I've got a million things on at the moment and the change to the layout is in the development branch, which needs a lot of testing before we merge it in and start using it with students.