Gabriel33
Community Participant

That seems like something that would be better fixed on the grader's end.

While with printed submissions there was no alternative to have the student make the text double-spaced, why should you depend on the student remembering to apply an extra setting for electronic submissions?

Unfortunately, browsers don't have a way to do that unless you use "reading mode". Both Google and Firefox allow you to change line spacing within reading mode, I imagine other browsers do too (click the earlier browser links for instructions).

A userscript may be a better choice, to run on your end, like the one below (change the match to apply only to your institution's Canvas). Please note that it is likely inefficient, and might slow down your browser, and you might want to double check any code from a stranger before running it on your computer.

Spoiler
// ==UserScript==
// @Name         Double Space Text in Div
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Set double line spacing in a specific div
// @author       -
// @match        https://canvas.instructure.com/courses/*/quizzes/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    function applyDoubleSpacing() {
        const elements = document.querySelectorAll('.user_content.quiz_response_text.enhanced');
        elements.forEach(el => {
            if (!el.dataset.doubleSpaced) {
                el.style.lineHeight = '2';
                el.dataset.doubleSpaced = 'true';
            }
        });
    }

    window.addEventListener('load', () => {
        applyDoubleSpacing();

        const observer = new MutationObserver(applyDoubleSpacing);
        observer.observe(document.body, { childList: true, subtree: true });
    });
})();

View solution in original post

Who Me Too'd this solution