Skip to content

Commit

Permalink
matrix question ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
pingfan-hu committed Nov 29, 2024
1 parent b7488c9 commit 75d28ed
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions R/config.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ run_config <- function(
files_need_updating <- check_files_need_updating(paths)

if (files_need_updating) {
message("Output files not up-to-date - rendering qmd file and extracting content.")
message("Changes detected. Rendering contents.")

# Prepare translations (check for inputs)
set_translations(paths, language)
Expand All @@ -42,9 +42,12 @@ run_config <- function(
question_structure <- get_question_structure(paths, html_content)

message(
'Survey rendered and saved to "', paths$target_html,
'. Extracted content saved to "', paths$target_pages, '", "',
paths$target_head, '", and "', paths$target_questions, '" files.'
"Survey saved to:\n",
" ", paths$target_html, "\n",
"Contents saved to:\n",
" ", paths$target_pages, "\n",
" ", paths$target_head, "\n",
" ", paths$target_questions
)

} else {
Expand Down Expand Up @@ -442,11 +445,6 @@ write_question_structure_yaml <- function(question_structure, file_yaml) {
# Remove indicator if is matrix (type is correctly set)
question$is_matrix <- NULL

# Mark matrix subquestion to remove from list (and end further processing)
if (question$type == "mc" & length(question$label) == 0) {
return(NULL)
}

# Remove first option from select type question
if (question$type == "select") {
question$options <- question$options[-1]
Expand Down

0 comments on commit 75d28ed

Please sign in to comment.