From 8620771aa3f46b962c3cb5a0bbdec58190caa4d3 Mon Sep 17 00:00:00 2001 From: Joris Goosen Date: Thu, 10 Oct 2024 14:45:56 +0200 Subject: [PATCH] Data entry redux (#475) * FilteredDataEntry will now create its own computed column and use that for values * let JASP handle the computed column part * also update bayesian workflow * use checking if column exists field --- R/auditCommonFunctions.R | 8 +------- inst/qml/auditBayesianWorkflow.qml | 8 ++++++-- inst/qml/auditClassicalWorkflow.qml | 8 ++++++-- inst/qml/common/evaluation/AddVariables.qml | 3 ++- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/R/auditCommonFunctions.R b/R/auditCommonFunctions.R index 627e9bda..e2d3453c 100644 --- a/R/auditCommonFunctions.R +++ b/R/auditCommonFunctions.R @@ -296,18 +296,12 @@ sampleFilter <- numeric(selectionState[["N.items"]]) rowNumber <- as.numeric(sample[["row"]]) sampleFilter[rowNumber] <- as.numeric(sample[["times"]]) - auditDataVariable <- rep(NA, selectionState[["N.items"]]) - auditDataVariable[options[["performAudit"]][[1]]$rowIndices] <- options[["performAudit"]][[1]]$values - + if (is.null(jaspResults[["indicator_col"]])) { jaspResults[["indicator_col"]] <- createJaspColumn(columnName = options[["indicator_col"]], dependencies = "indicator_col") } - if (is.null(jaspResults[["variable_col"]])) { - jaspResults[["variable_col"]] <- createJaspColumn(columnName = options[["variable_col"]], dependencies = "variable_col") - } jaspResults[["indicator_col"]]$setOrdinal(sampleFilter) - jaspResults[["variable_col"]]$setScale(auditDataVariable) } } diff --git a/inst/qml/auditBayesianWorkflow.qml b/inst/qml/auditBayesianWorkflow.qml index 677e7487..a918e059 100644 --- a/inst/qml/auditBayesianWorkflow.qml +++ b/inst/qml/auditBayesianWorkflow.qml @@ -286,7 +286,12 @@ Form pasteVariables.checked = true performAuditTable.colName = names.variable_name performAuditTable.extraCol = names.indicator_name - values.count > 0 && critical.use_negative && critical.use_inspect ? performAuditTable.filter = names.indicator_name + " > 0" + " | " + critical.use_name + " > 0" : performAuditTable.filter = names.indicator_name + " > 0" + + if(values.count > 0 && critical.use_negative && critical.use_inspect) + performAuditTable.filter = names.indicator_name + " > 0" + " | " + critical.use_name + " > 0" + else + performAuditTable.filter = names.indicator_name + " > 0" + performAuditTable.initialValuesSource = annotation.use_values ? "values" : "" } } @@ -315,7 +320,6 @@ Form Layout.fillWidth: true modelType: JASP.FilteredDataEntryModel source: ["id", "values", "variables"] - colName: "Filter" defaultValue: 0 decimals: 10 Layout.preferredHeight: 500 * preferencesModel.uiScale diff --git a/inst/qml/auditClassicalWorkflow.qml b/inst/qml/auditClassicalWorkflow.qml index 72f81424..df9dc5f2 100644 --- a/inst/qml/auditClassicalWorkflow.qml +++ b/inst/qml/auditClassicalWorkflow.qml @@ -277,7 +277,12 @@ Form pasteVariables.checked = true performAuditTable.colName = names.variable_name performAuditTable.extraCol = names.indicator_name - values.count > 0 && critical.use_negative && critical.use_inspect ? performAuditTable.filter = names.indicator_name + " > 0" + " | " + critical.use_name + " > 0" : performAuditTable.filter = names.indicator_name + " > 0" + + if(values.count > 0 && critical.use_negative && critical.use_inspect) + performAuditTable.filter = names.indicator_name + " > 0" + " | " + critical.use_name + " > 0" + else + performAuditTable.filter = names.indicator_name + " > 0" + performAuditTable.initialValuesSource = annotation.use_values ? "values" : "" } } @@ -306,7 +311,6 @@ Form Layout.fillWidth: true modelType: JASP.FilteredDataEntryModel source: ["id", "values", "variables"] - colName: "Filter" defaultValue: 0 decimals: 10 Layout.preferredHeight: 500 * preferencesModel.uiScale diff --git a/inst/qml/common/evaluation/AddVariables.qml b/inst/qml/common/evaluation/AddVariables.qml index a5d0b5fc..bc8b20c6 100644 --- a/inst/qml/common/evaluation/AddVariables.qml +++ b/inst/qml/common/evaluation/AddVariables.qml @@ -39,12 +39,13 @@ Group value: qsTr("selected") } - ComputedColumnField + CheckColumnIsFreeOrMineField { id: variable_col name: "variable_col" text: qsTr("Column name audit result") fieldWidth: 120 * preferencesModel.uiScale value: qsTr("auditResult") + } }