-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* changes for questionnaire option * remove image list dependency * update readme * adds questionnaire functionality * test prepareQuestionnaireImage * update readme * reactivate observe enable disable action button * styling * function docu * use fill value from example zip * adjust error message
- Loading branch information
Showing
30 changed files
with
693 additions
and
270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
.Rproj.user | ||
.Rhistory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#' Create Inputs for Questionnaire | ||
#' | ||
#' @param id id of module | ||
#' @param questions list of questions from json | ||
createQuestionnaireInputs <- function(id, questions) { | ||
ns <- NS(id) | ||
inputList <- tagList() | ||
for (i in seq_along(questions$Questions)) { | ||
if (questions$Questions[[i]]$Type == "multiple choice") { | ||
label <- questions$Questions[[i]]$Question | ||
choices <- questions$Questions[[i]]$Answers | ||
selected <- questions$Questions[[i]]$Fill_Value | ||
inputList[[i]] <- radioButtons( | ||
inputId = ns(paste0("question_", i)), | ||
choices = choices, | ||
label = label, | ||
selected = selected | ||
) | ||
} else if (questions$Questions[[i]]$Type == "numeric") { | ||
label <- questions$Questions[[i]]$Question | ||
value <- questions$Questions[[i]]$Fill_Value | ||
inputList[[i]] <- numericInput( | ||
inputId = ns(paste0("question_", i)), | ||
label = label, | ||
value = value | ||
) | ||
} else { | ||
shinyjs::alert(text = "Found a missing question type. Question was removed. Please check your json file.") | ||
next | ||
} | ||
} | ||
insertUI( | ||
selector = "#map_panel-file_import-openPopup", | ||
where = "afterEnd", | ||
ui = tagList( | ||
div( | ||
id = ns("questionnaire_inputs"), | ||
br(), | ||
br(), | ||
inputList | ||
) | ||
), | ||
immediate = TRUE | ||
) | ||
} |
Oops, something went wrong.