diff --git a/stack/cas/castext2/blocks/parsons.block.php b/stack/cas/castext2/blocks/parsons.block.php
index 7b198b0abe3ff6e6c1d29608247dd9d15bb841ae..0d6080a23a7750b8cb0096292d0eac817fed4d92 100644
--- a/stack/cas/castext2/blocks/parsons.block.php
+++ b/stack/cas/castext2/blocks/parsons.block.php
@@ -219,7 +219,7 @@ class stack_cas_castext2_parsons extends stack_cas_castext2_block {
if ($proofmode) {
$code = 'var headers = ["' . stack_string('stackBlock_parsons_used_header') . '"];' . "\n";
} else {
- $code = 'var headers = [' . implode(', ', range(1, intval($columns))) . '];' . "\n";
+ $code = 'var headers = [' . implode(', ', range(1, intval($ogcolumns))) . '];' . "\n";
}
$code .= 'var available_header = "' . stack_string('stackBlock_parsons_available_header') . '";' . "\n";
@@ -237,7 +237,7 @@ class stack_cas_castext2_parsons extends stack_cas_castext2_block {
// More specific pieces of validation
// Check typing of headers, it should be an array containing strings.
- $code .= 'if (!(Array.isArray(headers) && headers.every((header) => typeof(header) === "string")))
+ $code .= 'if (!(Array.isArray(headers)))
{stack_js.display_error("' . stack_string('stackBlock_incorrect_header_type') . '");}' . "\n";
// If the length of headers does not match the number of columns expected throw an error.