diff --git a/README.md b/README.md index d2023f3d5..0b5c68d5e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Eyra Mono -Primary collection of Eyra projects +Primary collection of Eyra projects ## Projects @@ -19,7 +19,7 @@ Project implementing a SaaS platform based on interlinked modules called Systems * Campaign * Assignment * Lab -* Survey +* Questionnaire * Pool * Data Donation * .. @@ -28,12 +28,12 @@ Project implementing a SaaS platform based on interlinked modules called Systems * Next -Primary bundle with all features available except Link specific features. +Primary bundle with all features available except Link specific features. Next is hosted on: https://eyra.co * Link -Secundary bundle with only Panl specific features. +Secundary bundle with only Panl specific features. Link is hosted on: https://researchpanl.eu ## Banking Proxy diff --git a/core/bundles/link/seeds.exs b/core/bundles/link/seeds.exs index 14e2ce202..fd5e82c21 100644 --- a/core/bundles/link/seeds.exs +++ b/core/bundles/link/seeds.exs @@ -15,11 +15,11 @@ student_count = 1500 researcher_count = 100 researchers_per_campaign = 5 lab_count = 200 -survey_count = 600 +questionnaire_count = 600 time_slots_per_lab = 20 seats_per_time_slot = 20 -survey_url = "https://vuamsterdam.eu.qualtrics.com/jfe/form/SV_4Po8iTxbvcxtuaW" +questionnaire_url = "https://vuamsterdam.eu.qualtrics.com/jfe/form/SV_4Po8iTxbvcxtuaW" images = [ "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1600614908054-57142d1eec2b%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=seonghojang95&name=Seongho+Jang&blur_hash=LKLy%5B%2AMd0L%3FG%3B0XSE2xDyC%25f%24zI%3B", @@ -184,9 +184,9 @@ researcher = {:ok, surveys} = Core.Repo.transaction(fn -> - for _ <- 1..survey_count do + for _ <- 1..questionnaire_count do %{ - type: :survey_tool, + type: :questionnaire_tool, promotion: %{ title: Faker.Lorem.sentence() <> " (survey)", subtitle: Faker.Lorem.sentence(), @@ -195,8 +195,8 @@ researcher = marks: ["vu"], plugin: "survey" }, - survey_tool: %{ - survey_url: Faker.Internet.url(), + questionnaire_tool: %{ + questionnaire_url: Faker.Internet.url(), # desktop_enabled: true, # phone_enabled: true, # tablet_enabled: true, @@ -250,7 +250,7 @@ Core.Repo.transaction( ) ) - if tool_type == :survey_tool do + if tool_type == :questionnaire_tool do participant_count = :random.uniform(tool.subject_count) for student <- Enum.take_random(students, participant_count) do diff --git a/core/lib/core/authorization.ex b/core/lib/core/authorization.ex index 6083e2979..dfb52e859 100644 --- a/core/lib/core/authorization.ex +++ b/core/lib/core/authorization.ex @@ -24,7 +24,7 @@ defmodule Core.Authorization do # Models grant_access(Systems.Campaign.Model, [:visitor, :member]) - grant_access(Systems.Survey.ToolModel, [:owner, :coordinator, :participant]) + grant_access(Systems.Questionnaire.ToolModel, [:owner, :coordinator, :participant]) grant_access(Systems.Lab.ToolModel, [:owner, :coordinator, :participant]) grant_access(Systems.DataDonation.ToolModel, [:owner, :coordinator, :participant]) grant_access(Systems.Benchmark.SpotModel, [:owner]) @@ -71,9 +71,9 @@ defmodule Core.Authorization do grant_access(CoreWeb.User.Profile, [:member]) grant_access(CoreWeb.User.Settings, [:member]) grant_access(CoreWeb.User.SecuritySettings, [:member]) - grant_access(CoreWeb.FakeSurvey, [:member]) + grant_access(CoreWeb.FakeQuestionnaire, [:member]) - grant_actions(CoreWeb.FakeSurveyController, %{ + grant_actions(CoreWeb.FakeQuestionnaireController, %{ index: [:visitor, :member] }) diff --git a/core/lib/core/factories.ex b/core/lib/core/factories.ex index a187d2d38..6259204de 100644 --- a/core/lib/core/factories.ex +++ b/core/lib/core/factories.ex @@ -22,7 +22,7 @@ defmodule Core.Factories do Assignment, Crew, Support, - Survey, + Questionnaire, Lab, DataDonation, Benchmark, @@ -142,8 +142,8 @@ defmodule Core.Factories do } end - def build(:survey_tool) do - build(:survey_tool, %{}) + def build(:questionnaire_tool) do + build(:questionnaire_tool, %{}) end def build(:lab_tool) do @@ -412,14 +412,14 @@ defmodule Core.Factories do def build(:tool_ref, %{} = attributes) do {item, attributes} = Map.pop(attributes, :item, build(:project_item)) - {survey_tool, attributes} = Map.pop(attributes, :survey_tool, nil) + {questionnaire_tool, attributes} = Map.pop(attributes, :questionnaire_tool, nil) {lab_tool, attributes} = Map.pop(attributes, :lab_tool, nil) {data_donation_tool, attributes} = Map.pop(attributes, :data_donation_tool, nil) {benchmark_tool, attributes} = Map.pop(attributes, :benchmark_tool, nil) %Project.ToolRefModel{ item: item, - survey_tool: survey_tool, + questionnaire_tool: questionnaire_tool, lab_tool: lab_tool, data_donation_tool: data_donation_tool, benchmark_tool: benchmark_tool @@ -462,13 +462,16 @@ defmodule Core.Factories do {nil, attributes} end - {survey_tool, attributes} = + {questionnaire_tool, attributes} = if lab_tool == nil do tool_auth_node = build(:auth_node, %{parent: auth_node}) - case Map.pop(attributes, :survey_tool, nil) do - {nil, attributes} -> {build(:survey_tool, %{auth_node: tool_auth_node}), attributes} - {survey_tool, attributes} -> {survey_tool, attributes} + case Map.pop(attributes, :questionnaire_tool, nil) do + {nil, attributes} -> + {build(:questionnaire_tool, %{auth_node: tool_auth_node}), attributes} + + {questionnaire_tool, attributes} -> + {questionnaire_tool, attributes} end else {nil, attributes} @@ -476,7 +479,7 @@ defmodule Core.Factories do %Assignment.ExperimentModel{ auth_node: auth_node, - survey_tool: survey_tool, + questionnaire_tool: questionnaire_tool, lab_tool: lab_tool } |> struct!(attributes) @@ -609,10 +612,10 @@ defmodule Core.Factories do |> struct!(attributes) end - def build(:survey_tool, %{} = attributes) do + def build(:questionnaire_tool, %{} = attributes) do {auth_node, attributes} = Map.pop(attributes, :auth_node, build(:auth_node)) - %Survey.ToolModel{ + %Questionnaire.ToolModel{ auth_node: auth_node } |> struct!(attributes) diff --git a/core/lib/core_web/controllers/fake_survey_controller.ex b/core/lib/core_web/controllers/fake_questionnaire_controller.ex similarity index 79% rename from core/lib/core_web/controllers/fake_survey_controller.ex rename to core/lib/core_web/controllers/fake_questionnaire_controller.ex index 18648ce8b..ba0ae797b 100644 --- a/core/lib/core_web/controllers/fake_survey_controller.ex +++ b/core/lib/core_web/controllers/fake_questionnaire_controller.ex @@ -1,4 +1,4 @@ -defmodule CoreWeb.FakeSurveyController do +defmodule CoreWeb.FakeQuestionnaireController do use CoreWeb, :controller def index(conn, _params) do diff --git a/core/lib/core_web/controllers/fake_questionnaire_html.ex b/core/lib/core_web/controllers/fake_questionnaire_html.ex new file mode 100644 index 000000000..16b75320c --- /dev/null +++ b/core/lib/core_web/controllers/fake_questionnaire_html.ex @@ -0,0 +1,5 @@ +defmodule CoreWeb.FakeQuestionnaireHTML do + use CoreWeb, :html + + embed_templates("fake_questionnaire_html/*") +end diff --git a/core/lib/core_web/controllers/fake_survey_html/index.html.eex b/core/lib/core_web/controllers/fake_questionnaire_html/index.html.eex similarity index 100% rename from core/lib/core_web/controllers/fake_survey_html/index.html.eex rename to core/lib/core_web/controllers/fake_questionnaire_html/index.html.eex diff --git a/core/lib/core_web/controllers/fake_survey_html.ex b/core/lib/core_web/controllers/fake_survey_html.ex deleted file mode 100644 index a0739651c..000000000 --- a/core/lib/core_web/controllers/fake_survey_html.ex +++ /dev/null @@ -1,5 +0,0 @@ -defmodule CoreWeb.FakeSurveyHTML do - use CoreWeb, :html - - embed_templates("fake_survey_html/*") -end diff --git a/core/lib/core_web/live/fake_survey.ex b/core/lib/core_web/live/fake_questionnaire.ex similarity index 61% rename from core/lib/core_web/live/fake_survey.ex rename to core/lib/core_web/live/fake_questionnaire.ex index 2520728f0..1d7861883 100644 --- a/core/lib/core_web/live/fake_survey.ex +++ b/core/lib/core_web/live/fake_questionnaire.ex @@ -1,4 +1,4 @@ -defmodule CoreWeb.FakeSurvey do +defmodule CoreWeb.FakeQuestionnaire do @moduledoc """ The home screen. """ @@ -25,14 +25,14 @@ defmodule CoreWeb.FakeSurvey do def render(assigns) do ~H"""