Skip to content

Commit

Permalink
Merge pull request #317 from openstax/welcome-message
Browse files Browse the repository at this point in the history
Welcome message
  • Loading branch information
chrisbendel authored Dec 7, 2023
2 parents 1e33b9c + 96fe510 commit 8a1ad0d
Show file tree
Hide file tree
Showing 44 changed files with 358 additions and 382 deletions.
12 changes: 1 addition & 11 deletions backend/app/bindings/api/v1/bindings/base_study.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ class BaseStudy
# The study's researchers.
attr_accessor :researchers

# Mandatory studies must be completed by all users
attr_accessor :is_mandatory

# How many times the study has been viewed
attr_accessor :view_count

Expand Down Expand Up @@ -130,7 +127,6 @@ def self.attribute_map
:'target_sample_size' => :'target_sample_size',
:'status' => :'status',
:'researchers' => :'researchers',
:'is_mandatory' => :'is_mandatory',
:'view_count' => :'view_count',
:'public_on' => :'public_on',
:'completed_count' => :'completed_count',
Expand Down Expand Up @@ -166,7 +162,6 @@ def self.openapi_types
:'target_sample_size' => :'Float',
:'status' => :'String',
:'researchers' => :'Array<Researcher>',
:'is_mandatory' => :'Boolean',
:'view_count' => :'Float',
:'public_on' => :'Time',
:'completed_count' => :'Float',
Expand Down Expand Up @@ -266,10 +261,6 @@ def initialize(attributes = {})
end
end

if attributes.key?(:'is_mandatory')
self.is_mandatory = attributes[:'is_mandatory']
end

if attributes.key?(:'view_count')
self.view_count = attributes[:'view_count']
end
Expand Down Expand Up @@ -384,7 +375,6 @@ def ==(o)
target_sample_size == o.target_sample_size &&
status == o.status &&
researchers == o.researchers &&
is_mandatory == o.is_mandatory &&
view_count == o.view_count &&
public_on == o.public_on &&
completed_count == o.completed_count &&
Expand All @@ -405,7 +395,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[title_for_participants, title_for_researchers, short_description, long_description, internal_description, image_id, benefits, is_hidden, consented, first_launched_at, opens_at, closes_at, target_sample_size, status, researchers, is_mandatory, view_count, public_on, completed_count, category, topic, subject, stages, launched_count, return_url].hash
[title_for_participants, title_for_researchers, short_description, long_description, internal_description, image_id, benefits, is_hidden, consented, first_launched_at, opens_at, closes_at, target_sample_size, status, researchers, view_count, public_on, completed_count, category, topic, subject, stages, launched_count, return_url].hash
end

# Builds the object from hash
Expand Down
12 changes: 1 addition & 11 deletions backend/app/bindings/api/v1/bindings/new_study.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ class NewStudy
# The study's researchers.
attr_accessor :researchers

# Mandatory studies must be completed by all users
attr_accessor :is_mandatory

# How many times the study has been viewed
attr_accessor :view_count

Expand Down Expand Up @@ -130,7 +127,6 @@ def self.attribute_map
:'target_sample_size' => :'target_sample_size',
:'status' => :'status',
:'researchers' => :'researchers',
:'is_mandatory' => :'is_mandatory',
:'view_count' => :'view_count',
:'public_on' => :'public_on',
:'completed_count' => :'completed_count',
Expand Down Expand Up @@ -166,7 +162,6 @@ def self.openapi_types
:'target_sample_size' => :'Float',
:'status' => :'String',
:'researchers' => :'Array<Researcher>',
:'is_mandatory' => :'Boolean',
:'view_count' => :'Float',
:'public_on' => :'Time',
:'completed_count' => :'Float',
Expand Down Expand Up @@ -273,10 +268,6 @@ def initialize(attributes = {})
end
end

if attributes.key?(:'is_mandatory')
self.is_mandatory = attributes[:'is_mandatory']
end

if attributes.key?(:'view_count')
self.view_count = attributes[:'view_count']
end
Expand Down Expand Up @@ -409,7 +400,6 @@ def ==(o)
target_sample_size == o.target_sample_size &&
status == o.status &&
researchers == o.researchers &&
is_mandatory == o.is_mandatory &&
view_count == o.view_count &&
public_on == o.public_on &&
completed_count == o.completed_count &&
Expand All @@ -430,7 +420,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[title_for_participants, title_for_researchers, short_description, long_description, internal_description, image_id, benefits, is_hidden, consented, first_launched_at, opens_at, closes_at, target_sample_size, status, researchers, is_mandatory, view_count, public_on, completed_count, category, topic, subject, stages, launched_count, return_url].hash
[title_for_participants, title_for_researchers, short_description, long_description, internal_description, image_id, benefits, is_hidden, consented, first_launched_at, opens_at, closes_at, target_sample_size, status, researchers, view_count, public_on, completed_count, category, topic, subject, stages, launched_count, return_url].hash
end

# Builds the object from hash
Expand Down
22 changes: 11 additions & 11 deletions backend/app/bindings/api/v1/bindings/participant_study.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ class ParticipantStudy
# How popular the study is on a fractional scale of 0.0 to 1.0
attr_accessor :popularity_rating

# Is this study the demographic survey?
attr_accessor :is_demographic_survey

# Should this study be featured more prominently?
attr_accessor :is_featured

Expand Down Expand Up @@ -84,9 +87,6 @@ class ParticipantStudy
# The study's researchers.
attr_accessor :researchers

# Mandatory studies must be completed by all users
attr_accessor :is_mandatory

# How many times the study has been viewed
attr_accessor :view_count

Expand Down Expand Up @@ -141,6 +141,7 @@ def self.attribute_map
{
:'id' => :'id',
:'popularity_rating' => :'popularity_rating',
:'is_demographic_survey' => :'is_demographic_survey',
:'is_featured' => :'is_featured',
:'is_syllabus_contest_study' => :'is_syllabus_contest_study',
:'completed_at' => :'completed_at',
Expand All @@ -162,7 +163,6 @@ def self.attribute_map
:'target_sample_size' => :'target_sample_size',
:'status' => :'status',
:'researchers' => :'researchers',
:'is_mandatory' => :'is_mandatory',
:'view_count' => :'view_count',
:'public_on' => :'public_on',
:'completed_count' => :'completed_count',
Expand All @@ -185,6 +185,7 @@ def self.openapi_types
{
:'id' => :'Integer',
:'popularity_rating' => :'Float',
:'is_demographic_survey' => :'Boolean',
:'is_featured' => :'Boolean',
:'is_syllabus_contest_study' => :'Boolean',
:'completed_at' => :'Time',
Expand All @@ -206,7 +207,6 @@ def self.openapi_types
:'target_sample_size' => :'Float',
:'status' => :'String',
:'researchers' => :'Array<Researcher>',
:'is_mandatory' => :'Boolean',
:'view_count' => :'Float',
:'public_on' => :'Time',
:'completed_count' => :'Float',
Expand Down Expand Up @@ -259,6 +259,10 @@ def initialize(attributes = {})
self.popularity_rating = attributes[:'popularity_rating']
end

if attributes.key?(:'is_demographic_survey')
self.is_demographic_survey = attributes[:'is_demographic_survey']
end

if attributes.key?(:'is_featured')
self.is_featured = attributes[:'is_featured']
end
Expand Down Expand Up @@ -345,10 +349,6 @@ def initialize(attributes = {})
end
end

if attributes.key?(:'is_mandatory')
self.is_mandatory = attributes[:'is_mandatory']
end

if attributes.key?(:'view_count')
self.view_count = attributes[:'view_count']
end
Expand Down Expand Up @@ -470,6 +470,7 @@ def ==(o)
self.class == o.class &&
id == o.id &&
popularity_rating == o.popularity_rating &&
is_demographic_survey == o.is_demographic_survey &&
is_featured == o.is_featured &&
is_syllabus_contest_study == o.is_syllabus_contest_study &&
completed_at == o.completed_at &&
Expand All @@ -491,7 +492,6 @@ def ==(o)
target_sample_size == o.target_sample_size &&
status == o.status &&
researchers == o.researchers &&
is_mandatory == o.is_mandatory &&
view_count == o.view_count &&
public_on == o.public_on &&
completed_count == o.completed_count &&
Expand All @@ -512,7 +512,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[id, popularity_rating, is_featured, is_syllabus_contest_study, completed_at, opted_out_at, total_points, total_duration, title_for_participants, title_for_researchers, short_description, long_description, internal_description, image_id, benefits, is_hidden, consented, first_launched_at, opens_at, closes_at, target_sample_size, status, researchers, is_mandatory, view_count, public_on, completed_count, category, topic, subject, stages, launched_count, return_url].hash
[id, popularity_rating, is_demographic_survey, is_featured, is_syllabus_contest_study, completed_at, opted_out_at, total_points, total_duration, title_for_participants, title_for_researchers, short_description, long_description, internal_description, image_id, benefits, is_hidden, consented, first_launched_at, opens_at, closes_at, target_sample_size, status, researchers, view_count, public_on, completed_count, category, topic, subject, stages, launched_count, return_url].hash
end

# Builds the object from hash
Expand Down
12 changes: 1 addition & 11 deletions backend/app/bindings/api/v1/bindings/study.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ class Study
# The study's researchers.
attr_accessor :researchers

# Mandatory studies must be completed by all users
attr_accessor :is_mandatory

# How many times the study has been viewed
attr_accessor :view_count

Expand Down Expand Up @@ -134,7 +131,6 @@ def self.attribute_map
:'target_sample_size' => :'target_sample_size',
:'status' => :'status',
:'researchers' => :'researchers',
:'is_mandatory' => :'is_mandatory',
:'view_count' => :'view_count',
:'public_on' => :'public_on',
:'completed_count' => :'completed_count',
Expand Down Expand Up @@ -171,7 +167,6 @@ def self.openapi_types
:'target_sample_size' => :'Float',
:'status' => :'String',
:'researchers' => :'Array<Researcher>',
:'is_mandatory' => :'Boolean',
:'view_count' => :'Float',
:'public_on' => :'Time',
:'completed_count' => :'Float',
Expand Down Expand Up @@ -282,10 +277,6 @@ def initialize(attributes = {})
end
end

if attributes.key?(:'is_mandatory')
self.is_mandatory = attributes[:'is_mandatory']
end

if attributes.key?(:'view_count')
self.view_count = attributes[:'view_count']
end
Expand Down Expand Up @@ -424,7 +415,6 @@ def ==(o)
target_sample_size == o.target_sample_size &&
status == o.status &&
researchers == o.researchers &&
is_mandatory == o.is_mandatory &&
view_count == o.view_count &&
public_on == o.public_on &&
completed_count == o.completed_count &&
Expand All @@ -445,7 +435,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[id, title_for_participants, title_for_researchers, short_description, long_description, internal_description, image_id, benefits, is_hidden, consented, first_launched_at, opens_at, closes_at, target_sample_size, status, researchers, is_mandatory, view_count, public_on, completed_count, category, topic, subject, stages, launched_count, return_url].hash
[id, title_for_participants, title_for_researchers, short_description, long_description, internal_description, image_id, benefits, is_hidden, consented, first_launched_at, opens_at, closes_at, target_sample_size, status, researchers, view_count, public_on, completed_count, category, topic, subject, stages, launched_count, return_url].hash
end

# Builds the object from hash
Expand Down
12 changes: 1 addition & 11 deletions backend/app/bindings/api/v1/bindings/study_update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ class StudyUpdate
# The study's researchers.
attr_accessor :researchers

# Mandatory studies must be completed by all users
attr_accessor :is_mandatory

# How many times the study has been viewed
attr_accessor :view_count

Expand Down Expand Up @@ -134,7 +131,6 @@ def self.attribute_map
:'target_sample_size' => :'target_sample_size',
:'status' => :'status',
:'researchers' => :'researchers',
:'is_mandatory' => :'is_mandatory',
:'view_count' => :'view_count',
:'public_on' => :'public_on',
:'completed_count' => :'completed_count',
Expand Down Expand Up @@ -171,7 +167,6 @@ def self.openapi_types
:'target_sample_size' => :'Float',
:'status' => :'String',
:'researchers' => :'Array<Researcher>',
:'is_mandatory' => :'Boolean',
:'view_count' => :'Float',
:'public_on' => :'Time',
:'completed_count' => :'Float',
Expand Down Expand Up @@ -282,10 +277,6 @@ def initialize(attributes = {})
end
end

if attributes.key?(:'is_mandatory')
self.is_mandatory = attributes[:'is_mandatory']
end

if attributes.key?(:'view_count')
self.view_count = attributes[:'view_count']
end
Expand Down Expand Up @@ -401,7 +392,6 @@ def ==(o)
target_sample_size == o.target_sample_size &&
status == o.status &&
researchers == o.researchers &&
is_mandatory == o.is_mandatory &&
view_count == o.view_count &&
public_on == o.public_on &&
completed_count == o.completed_count &&
Expand All @@ -422,7 +412,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[id, title_for_participants, title_for_researchers, short_description, long_description, internal_description, image_id, benefits, is_hidden, consented, first_launched_at, opens_at, closes_at, target_sample_size, status, researchers, is_mandatory, view_count, public_on, completed_count, category, topic, subject, stages, launched_count, return_url].hash
[id, title_for_participants, title_for_researchers, short_description, long_description, internal_description, image_id, benefits, is_hidden, consented, first_launched_at, opens_at, closes_at, target_sample_size, status, researchers, view_count, public_on, completed_count, category, topic, subject, stages, launched_count, return_url].hash
end

# Builds the object from hash
Expand Down
20 changes: 15 additions & 5 deletions backend/app/bindings/api/v1/bindings/user_preferences.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,21 @@ class UserPreferences
# User wishes to receive email about new sessions becoming available
attr_accessor :session_available_email

# User has viewed the analysis tutorial overview on the frontend
# Researcher has viewed the analysis tutorial overview on the researcher analysis page
attr_accessor :has_viewed_analysis_tutorial

# Learner has viewed the initial welcome message on the learner dashboard
attr_accessor :has_viewed_welcome_message

# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
:'cycle_deadlines_email' => :'cycle_deadlines_email',
:'prize_cycle_email' => :'prize_cycle_email',
:'study_available_email' => :'study_available_email',
:'session_available_email' => :'session_available_email',
:'has_viewed_analysis_tutorial' => :'has_viewed_analysis_tutorial'
:'has_viewed_analysis_tutorial' => :'has_viewed_analysis_tutorial',
:'has_viewed_welcome_message' => :'has_viewed_welcome_message'
}
end

Expand All @@ -53,7 +57,8 @@ def self.openapi_types
:'prize_cycle_email' => :'Boolean',
:'study_available_email' => :'Boolean',
:'session_available_email' => :'Boolean',
:'has_viewed_analysis_tutorial' => :'Boolean'
:'has_viewed_analysis_tutorial' => :'Boolean',
:'has_viewed_welcome_message' => :'Boolean'
}
end

Expand Down Expand Up @@ -97,6 +102,10 @@ def initialize(attributes = {})
if attributes.key?(:'has_viewed_analysis_tutorial')
self.has_viewed_analysis_tutorial = attributes[:'has_viewed_analysis_tutorial']
end

if attributes.key?(:'has_viewed_welcome_message')
self.has_viewed_welcome_message = attributes[:'has_viewed_welcome_message']
end
end

# Show invalid properties with the reasons. Usually used together with valid?
Expand All @@ -121,7 +130,8 @@ def ==(o)
prize_cycle_email == o.prize_cycle_email &&
study_available_email == o.study_available_email &&
session_available_email == o.session_available_email &&
has_viewed_analysis_tutorial == o.has_viewed_analysis_tutorial
has_viewed_analysis_tutorial == o.has_viewed_analysis_tutorial &&
has_viewed_welcome_message == o.has_viewed_welcome_message
end

# @see the `==` method
Expand All @@ -133,7 +143,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[cycle_deadlines_email, prize_cycle_email, study_available_email, session_available_email, has_viewed_analysis_tutorial].hash
[cycle_deadlines_email, prize_cycle_email, study_available_email, session_available_email, has_viewed_analysis_tutorial, has_viewed_welcome_message].hash
end

# Builds the object from hash
Expand Down
4 changes: 0 additions & 4 deletions backend/app/controllers/api/v1/base_studies_open_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ class Api::V1::BaseStudiesOpenApi
key :$ref, :Researcher
end
end
property :is_mandatory do
key :type, :boolean
key :description, 'Mandatory studies must be completed by all users'
end
property :view_count do
key :type, :number
key :description, 'How many times the study has been viewed'
Expand Down
Loading

0 comments on commit 8a1ad0d

Please sign in to comment.