Hello,
Can you turn off block coding in CS Principles and force students to do text-based coding? Checked settings on CS Principles course but did not see anything. Wanting to increase the rigor for HS students!
There is no ability to do this at this time. You may want to suggest it as a feature to support@code.org
If i may interject with that statement, technically if your administrator allows custom scripts to be used on websites you could in theory just remove the ability outright I’ll link a little script I’ve been working on below
if (location.href.match(/https:\/\/studio.code.org\/projects\/.*edit/g) !== null) {
const toolbox = document.querySelector("#codeModeHeaders");
if (toolbox === null) {
window.addEventListener("DOMContentLoaded", () => {
addListener("#codeModeHeaders").then(element => {
codeOnly();
})
})
} else {
codeOnly();
}
function addListener(selector) {
return new Promise(resolve => {
const doc = document;
if (doc.querySelector(selector)) {
return resolve(doc.querySelector(selector));
}
const observer = new MutationObserver(mutations => {
if (doc.querySelector(selector)) {
resolve(doc.querySelector(selector));
observer.disconnect();
}
});
observer.observe(doc.body, {
childList: true,
subtree: true
});
});
}
}
function codeOnly() {
const showCode = document.querySelector("#show-code-header");
const showBlock = document.querySelector("#hide-toolbox-icon");
if (showBlock.style.display !== "none") {
showBlock.click();
}
if (showCode.innerText !== "Show Blocks") {
showCode.click();
}
showBlock.remove();
document.querySelector("#show-toolbox-icon").remove();
showCode.remove();
}
if you inject this payload any time the site is opened it’ll perform the necessary actions and then remove the buttons… which doesn’t necessarily mean that it’ll be removed completely though i think would also solve your problem
Hi @jhubbard1 ,
I agree that a feature request for this would increase the likelihood of this functionality as it is not currently available. However, I would invite you to read the Curriculum Values on page 4 of the Code.org CS Principles Curriculum Guide.
This course is intended to be an introduction to computer science, analogous to a computer science for non-majors course at the college level. Block-based coding allows the rigor to come from thinking through what coding constructs are appropriate without the added difficulties that come from misplaced semicolons or unclosed brackets.
Personally, I’d recommend leaving the decision up to your students. Not all of them are going to be engaged by the “challenge” of making sure their punctuation marks are in the correct place, and for a first-time coder, this strange-to-them syntax could be enough to turn them off the subject entirely. They will eventually add the rigor in AP CSA or college courses after this introductory one if they choose to pursue further CS education.
Just some food for thought.
–Michael K.