Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DTT (Staging > Test) [robo-dtt] #22937

Merged
merged 7 commits into from
Jun 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion dashboard/app/helpers/pd/workshop_survey_results_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ def generate_workshops_survey_summary(workshop, questions)
questions.each do |session, response_sections|
surveys_for_session = surveys[session]

next unless surveys_for_session

session_summary = {
response_count: surveys[session][:response_count]
}
Expand Down Expand Up @@ -305,6 +307,10 @@ def get_questions_for_forms(workshop)
'Day 4' => {
general: get_summary_for_form(CDO.jotform_forms['local']['day_4'], workshop),
facilitator: get_summary_for_form(CDO.jotform_forms['local']['facilitator'], workshop)
},
'Day 5' => {
general: get_summary_for_form(CDO.jotform_forms['local']['day_5'], workshop),
facilitator: get_summary_for_form(CDO.jotform_forms['local']['facilitator'], workshop)
}
}
end
Expand All @@ -313,7 +319,7 @@ def get_questions_for_forms(workshop)

def get_summary_for_form(form_id, workshop)
survey = Pd::SurveyQuestion.find_by(form_id: form_id)
summary = survey.summarize
summary = survey&.summarize || {}

summary.each do |_, question|
if question[:text].match? '{.*}'
Expand Down
3 changes: 3 additions & 0 deletions dashboard/config/scripts/coursea-2018.script
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
hidden false
hideable_stages true
stage_extras_available true
has_lesson_plan true
project_widget_visible true
project_widget_types ["playlab_k1", "artist_k1"]
script_announcements [{"notice"=>"New: Choose Which Lessons to Show or Hide for Your Section", "details"=>"Click \"Learn More\" to read the help article on showing and hiding lessons.", "link"=>"https://support.code.org/hc/en-us/articles/115001479372-Hiding-units-and-lessons-in-Code-org-s-CS-Principles-and-CS-Discoveries-courses", "type"=>"bullhorn"}]
family_name 'coursea'
version_year '2018'

stage 'Debugging: Unspotted Bugs'
level 'courseB_video_Unspotted_2018'
Expand Down
2 changes: 2 additions & 0 deletions dashboard/config/scripts/coursea.script
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ project_widget_types ["playlab_k1", "artist_k1"]
script_announcements [{"notice"=>"Relevant Common Core and NGSS standards are now listed in Courses A-F!", "details"=>"Check out the full standards alignment document ", "link"=>"https://curriculum.code.org/csf-1718/coursea/standards/", "type"=>"bullhorn"}]
new_name 'coursea-2017'
family_name 'coursea'
version_year '2017'
is_stable true

stage 'Debugging: Unspotted Bugs'
level 'courseB_video_Unspotted'
Expand Down
3 changes: 3 additions & 0 deletions dashboard/config/scripts/courseb-2018.script
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
hidden false
hideable_stages true
stage_extras_available true
has_lesson_plan true
project_widget_visible true
project_widget_types ["playlab_k1", "artist_k1"]
script_announcements [{"notice"=>"New: Choose Which Lessons to Show or Hide for Your Section", "details"=>"Click \"Learn More\" to read the help article on showing and hiding lessons.", "link"=>"https://support.code.org/hc/en-us/articles/115001479372-Hiding-units-and-lessons-in-Code-org-s-CS-Principles-and-CS-Discoveries-courses", "type"=>"bullhorn"}]
family_name 'courseb'
version_year '2018'

stage 'Move It, Move It'
level 'MoveItMoveIt_2018'
Expand Down
2 changes: 2 additions & 0 deletions dashboard/config/scripts/courseb.script
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ project_widget_types ["playlab_k1", "artist_k1"]
script_announcements [{"notice"=>"Relevant Common Core and NGSS standards are now listed in Courses A-F!", "details"=>"Check out the full standards alignment document ", "link"=>"https://curriculum.code.org/csf-1718/courseb/standards/", "type"=>"bullhorn"}]
new_name 'courseb-2017'
family_name 'courseb'
version_year '2017'
is_stable true

stage 'Debugging: Unspotted Bugs'
level 'courseB_video_Unspotted'
Expand Down
3 changes: 3 additions & 0 deletions dashboard/config/scripts/coursec-2018.script
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
hidden false
hideable_stages true
stage_extras_available true
has_lesson_plan true
project_widget_visible true
project_widget_types ["playlab", "artist"]
script_announcements [{"notice"=>"New: Choose Which Lessons to Show or Hide for Your Section", "details"=>"Click \"Learn More\" to read the help article on showing and hiding lessons.", "link"=>"https://support.code.org/hc/en-us/articles/115001479372-Hiding-units-and-lessons-in-Code-org-s-CS-Principles-and-CS-Discoveries-courses", "type"=>"bullhorn"}]
family_name 'coursec'
version_year '2018'

stage 'Building a Foundation'
level 'BuildingAFoundation_2018'
Expand Down
2 changes: 2 additions & 0 deletions dashboard/config/scripts/coursec.script
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ project_widget_types ["playlab", "artist"]
script_announcements [{"notice"=>"Relevant Common Core and NGSS standards are now listed in Courses A-F!", "details"=>"Check out the full standards alignment document ", "link"=>"https://curriculum.code.org/csf-1718/coursec/standards/", "type"=>"bullhorn"}]
new_name 'coursec-2017'
family_name 'coursec'
version_year '2017'
is_stable true

stage 'Building a Foundation'
level 'BuildingAFoundation'
Expand Down
4 changes: 4 additions & 0 deletions dashboard/config/scripts/coursed-2018.script
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
hidden false
family_name 'coursed'
version_year '2018'

stage 'Algorithms: Graph Paper Programming'
level 'GraphPaperProgramming_2018'

Expand Down
2 changes: 2 additions & 0 deletions dashboard/config/scripts/coursed.script
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ project_widget_types ["playlab", "artist"]
script_announcements [{"notice"=>"Relevant Common Core and NGSS standards are now listed in Courses A-F!", "details"=>"Check out the full standards alignment document ", "link"=>"https://curriculum.code.org/csf-1718/coursed/standards/", "type"=>"bullhorn"}]
new_name 'coursed-2017'
family_name 'coursed'
version_year '2017'
is_stable true

stage 'Algorithms: Graph Paper Programming'
level 'GraphPaperProgramming'
Expand Down
3 changes: 3 additions & 0 deletions dashboard/config/scripts/coursee-2018.script
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
hidden false
hideable_stages true
stage_extras_available true
has_lesson_plan true
project_widget_visible true
project_widget_types ["playlab", "artist"]
script_announcements [{"notice"=>"New: Choose Which Lessons to Show or Hide for Your Section", "details"=>"Click \"Learn More\" to read the help article on showing and hiding lessons.", "link"=>"https://support.code.org/hc/en-us/articles/115001479372-Hiding-units-and-lessons-in-Code-org-s-CS-Principles-and-CS-Discoveries-courses", "type"=>"bullhorn"}]
family_name 'coursee'
version_year '2018'

stage 'Programming: My Robotic Friends', flex_category: 'csf_e_1'
level 'courseB_unplugged_MRF_2018'
Expand Down
2 changes: 2 additions & 0 deletions dashboard/config/scripts/coursee.script
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ project_widget_types ["playlab", "artist"]
script_announcements [{"notice"=>"Relevant Common Core and NGSS standards are now listed in Courses A-F!", "details"=>"Check out the full standards alignment document ", "link"=>"https://curriculum.code.org/csf-1718/coursee/standards/", "type"=>"bullhorn"}, {"notice"=>"Sign up to pilot new Course E content!", "details"=>"We are looking for active Course E teachers to pilot new tools that we will be releasing next year. Click \"Learn more\" to find out more about how you can help.", "link"=>"https://bit.ly/csfpilot", "type"=>"information"}]
new_name 'coursee-2017'
family_name 'coursee'
version_year '2017'
is_stable true

stage 'Programming: My Robotic Friends', flex_category: 'csf_e_1'
level 'courseB_unplugged_MRF'
Expand Down
3 changes: 3 additions & 0 deletions dashboard/config/scripts/coursef-2018.script
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
hidden false
hideable_stages true
stage_extras_available true
has_lesson_plan true
project_widget_visible true
project_widget_types ["playlab", "artist"]
script_announcements [{"notice"=>"New: Choose Which Lessons to Show or Hide for Your Section", "details"=>"Click \"Learn More\" to read the help article on showing and hiding lessons.", "link"=>"https://support.code.org/hc/en-us/articles/115001479372-Hiding-units-and-lessons-in-Code-org-s-CS-Principles-and-CS-Discoveries-courses", "type"=>"bullhorn"}]
family_name 'coursef'
version_year '2018'

stage 'Programming: My Robotic Friends', flex_category: 'csf_f_1'
level 'courseB_unplugged_MRF_2018'
Expand Down
2 changes: 2 additions & 0 deletions dashboard/config/scripts/coursef.script
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ project_widget_types ["playlab", "artist"]
script_announcements [{"notice"=>"Relevant Common Core and NGSS standards are now listed in Courses A-F!", "details"=>"Check out the full standards alignment document ", "link"=>"https://curriculum.code.org/csf-1718/coursef/standards/", "type"=>"bullhorn"}, {"notice"=>"Sign up to pilot new Course F content!", "details"=>"We are looking for active Course F teachers to pilot new tools that we will be releasing next year. Click \"Learn more\" to find out more about how you can help.", "link"=>"https://bit.ly/csfpilot", "type"=>"information"}]
new_name 'coursef-2017'
family_name 'coursef'
version_year '2017'
is_stable true

stage 'Programming: My Robotic Friends', flex_category: 'csf_f_1'
level 'courseB_unplugged_MRF'
Expand Down
3 changes: 3 additions & 0 deletions dashboard/config/scripts/express-2018.script
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
hidden false
hideable_stages true
stage_extras_available true
has_lesson_plan true
project_widget_visible true
project_widget_types ["playlab", "artist"]
script_announcements [{"notice"=>"New: Choose Which Lessons to Show or Hide for Your Section", "details"=>"Click \"Learn More\" to read the help article on showing and hiding lessons.", "link"=>"https://support.code.org/hc/en-us/articles/115001479372-Hiding-units-and-lessons-in-Code-org-s-CS-Principles-and-CS-Discoveries-courses bullhorn", "type"=>"bullhorn"}]
family_name 'express'
version_year '2018'

stage 'Algorithms: Graph Paper Programming'
level 'GraphPaperProgramming_2018'
Expand Down
2 changes: 2 additions & 0 deletions dashboard/config/scripts/express.script
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ project_widget_types ["playlab", "artist"]
script_announcements [{"notice"=>"New: Choose Which Lessons to Show or Hide for Your Section", "details"=>"Click \"Learn More\" to read the help article on showing and hiding lessons.", "link"=>"https://support.code.org/hc/en-us/articles/115001479372-Hiding-units-and-lessons-in-Code-org-s-CS-Principles-and-CS-Discoveries-courses bullhorn", "type"=>"bullhorn"}]
new_name 'express-2017'
family_name 'express'
version_year '2017'
is_stable true

stage 'Algorithms: Graph Paper Programming'
level 'GraphPaperProgramming'
Expand Down
3 changes: 3 additions & 0 deletions dashboard/config/scripts/pre-express-2018.script
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
hidden false
hideable_stages true
stage_extras_available true
has_lesson_plan true
project_widget_visible true
project_widget_types ["playlab_k1", "artist_k1"]
script_announcements [{"notice"=>"New: Choose Which Lessons to Show or Hide for Your Section", "details"=>"Click \"Learn More\" to read the help article on showing and hiding lessons.", "link"=>"https://support.code.org/hc/en-us/articles/115001479372-Hiding-units-and-lessons-in-Code-org-s-CS-Principles-and-CS-Discoveries-courses", "type"=>"bullhorn"}]
family_name 'pre-express'
version_year '2018'

stage 'Debugging: Unspotted Bugs'
level 'courseB_video_Unspotted_2018'
Expand Down
2 changes: 2 additions & 0 deletions dashboard/config/scripts/pre-express.script
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ project_widget_types ["playlab_k1", "artist_k1"]
script_announcements [{"notice"=>"New: Choose Which Lessons to Show or Hide for Your Section", "details"=>"Click \"Learn More\" to read the help article on showing and hiding lessons.", "link"=>"https://support.code.org/hc/en-us/articles/115001479372-Hiding-units-and-lessons-in-Code-org-s-CS-Principles-and-CS-Discoveries-courses", "type"=>"bullhorn"}]
new_name 'pre-express-2017'
family_name 'pre-express'
version_year '2017'
is_stable true

stage 'Debugging: Unspotted Bugs'
level 'courseB_video_Unspotted'
Expand Down
14 changes: 11 additions & 3 deletions dashboard/test/helpers/workshop_survey_results_helper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ class Pd::WorkshopSurveyResultsHelperTest < ActionView::TestCase
day_2: 2,
day_3: 3,
day_4: 4,
facilitator: 5
day_5: 5,
facilitator: 6
}

self.use_transactional_test_case = true
Expand Down Expand Up @@ -87,6 +88,11 @@ class Pd::WorkshopSurveyResultsHelperTest < ActionView::TestCase
questions: Pd::JotForm::FormQuestions.new(FORM_IDS[:day_4], @daily_questions).serialize.to_json
)

Pd::SurveyQuestion.create(
form_id: FORM_IDS[:day_5],
questions: Pd::JotForm::FormQuestions.new(FORM_IDS[:day_5], @daily_questions).serialize.to_json
)

Pd::SurveyQuestion.create(
form_id: FORM_IDS[:facilitator],
questions: Pd::JotForm::FormQuestions.new(FORM_IDS[:facilitator], @daily_facilitator_questions).serialize.to_json
Expand Down Expand Up @@ -141,7 +147,8 @@ class Pd::WorkshopSurveyResultsHelperTest < ActionView::TestCase
'Day 1' => expected_daily_questions,
'Day 2' => expected_daily_questions,
'Day 3' => expected_daily_questions,
'Day 4' => expected_daily_questions
'Day 4' => expected_daily_questions,
'Day 5' => expected_daily_questions
}
end

Expand Down Expand Up @@ -287,14 +294,15 @@ class Pd::WorkshopSurveyResultsHelperTest < ActionView::TestCase
end

test 'daily survey get_question_for_forms gets workshop questions and substitutes question texts' do
CDO.expects(:jotform_forms).times(9).returns( # 5 for general, 4 for facilitator
CDO.expects(:jotform_forms).times(11).returns( # 6 for general, 5 for facilitator
{
'local' => {
'day_0' => FORM_IDS[:pre_workshop],
'day_1' => FORM_IDS[:day_1],
'day_2' => FORM_IDS[:day_2],
'day_3' => FORM_IDS[:day_3],
'day_4' => FORM_IDS[:day_4],
'day_5' => FORM_IDS[:day_5],
'facilitator' => FORM_IDS[:facilitator]
}
}
Expand Down