use clearer error message when rows and columns both null

This commit is contained in:
Josh de Leeuw 2023-10-18 15:05:15 -04:00
parent 11e0103678
commit 808e835306
5 changed files with 5 additions and 5 deletions

View File

@ -159,7 +159,7 @@ class AudioButtonResponsePlugin implements JsPsychPlugin<Info> {
buttonGroupElement.classList.add("jspsych-btn-group-grid");
if (trial.grid_rows === null && trial.grid_columns === null) {
throw new Error(
"You must specify the number of rows or columns when using the grid layout."
"You cannot set `grid_rows` to `null` without providing a value for `grid_columns`."
);
}
const n_cols =

View File

@ -119,7 +119,7 @@ class CanvasButtonResponsePlugin implements JsPsychPlugin<Info> {
buttonGroupElement.classList.add("jspsych-btn-group-grid");
if (trial.grid_rows === null && trial.grid_columns === null) {
throw new Error(
"You must specify the number of rows or columns when using the grid layout."
"You cannot set `grid_rows` to `null` without providing a value for `grid_columns`."
);
}
const n_cols =

View File

@ -105,7 +105,7 @@ class HtmlButtonResponsePlugin implements JsPsychPlugin<Info> {
buttonGroupElement.classList.add("jspsych-btn-group-grid");
if (trial.grid_rows === null && trial.grid_columns === null) {
throw new Error(
"You must specify the number of rows or columns when using the grid layout."
"You cannot set `grid_rows` to `null` without providing a value for `grid_columns`."
);
}
const n_cols =

View File

@ -200,7 +200,7 @@ class ImageButtonResponsePlugin implements JsPsychPlugin<Info> {
buttonGroupElement.classList.add("jspsych-btn-group-grid");
if (trial.grid_rows === null && trial.grid_columns === null) {
throw new Error(
"You must specify the number of rows or columns when using the grid layout."
"You cannot set `grid_rows` to `null` without providing a value for `grid_columns`."
);
}
const n_cols =

View File

@ -198,7 +198,7 @@ class VideoButtonResponsePlugin implements JsPsychPlugin<Info> {
buttonGroupElement.classList.add("jspsych-btn-group-grid");
if (trial.grid_rows === null && trial.grid_columns === null) {
throw new Error(
"You must specify the number of rows or columns when using the grid layout."
"You cannot set `grid_rows` to `null` without providing a value for `grid_columns`."
);
}
const n_cols =