This script converts the handcrafted questionnaires which contains an excel and many images of several questionnaires into the format which can be uploaded to the MDM. The handcrafted questionnaire must have the following format:

|--questions
  |--questions*.xlsx (two sheets, questions and images)
  |--Bilder
    |--png
      |--ins1
        |--5_1.png (must match the filename in the images excel sheet)
        |--5_2.png (must match the filename in the images excel sheet)
      |--ins2
        |--5_1.png (must match the filename in the images excel sheet)
        |--5_2.png (must match the filename in the images excel sheet)

The format of the excel sheets is defined here.

convert_handcrafted_questionnaires_to_mdm_format(
  input_directory = file.path(".", "pages"),
  output_directory = file.path(".", "mdm", "questions"),
  images_subdirectory = file.path("Bilder", "png")
)

Arguments

input_directory

Input path, e.g. "./questions"

output_directory

Output directory, e.g. "./mdm/questions", will be created if it does not exist or will be overwritten otherwise

images_subdirectory

Path relative to input_directory containing the images, e.g. "Bilder/png"

Examples

if (FALSE) { # All examples do exactly the same. They convert everything under "./pages" # into the MDM format and write the output in "./mdm/questions". Images will be # searched in "./pages/Bilder/png". convert_handcrafted_questionnaires_to_mdm_format(input_directory = "./pages") convert_handcrafted_questionnaires_to_mdm_format(input_directory = "./pages", output_directory = "./output/questions") convert_handcrafted_questionnaires_to_mdm_format(input_directory = "./pages", output_directory = "./output/questions", images_subdirectory = "Bilder/png") }