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

Link from workshop view to survey results view #34417

Merged
merged 1 commit into from Apr 24, 2020

Conversation

hacodeorg
Copy link
Contributor

@hacodeorg hacodeorg commented Apr 24, 2020

PLC-758: Adds a button to open workshop survey results view (in a new tab) from workshop detail view.

The button is in the Enrollment panel of the workshop view where we also show pre-workshop survey results. It only appears for in-progress/ended CSF/CSD/CSP workshops.

Screen Shot 2020-04-24 at 10 56 33 AM

Links

Examples
Workshop dashboard: https://studio.code.org/pd/workshop_dashboard/workshops/
Workshop detail view: https://studio.code.org/pd/workshop_dashboard/workshops/8326

Testing story

Manual test: Created workshops with different types and different states in dev environment. Verified that the view-survey-results button appear and open correct links.

Reviewer Checklist:

  • Tests provide adequate coverage
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@hacodeorg hacodeorg requested a review from a team April 24, 2020 17:59
return null;
}

return course === 'CS Fundamentals' && subject === 'Intro'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@molly-moen For CSF Intro, when are we going to switch over to the new survey?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

our current target is mid-May

@hacodeorg hacodeorg marked this pull request as ready for review April 24, 2020 18:17
return course === 'CS Fundamentals' && subject === 'Intro'
? `/pd/workshop_dashboard/survey_results/${workshopId}`
: `/pd/workshop_dashboard/daily_survey_results/${workshopId}`;
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this logic already exist someplace in our Rails application? If not, I think it's okay to add it here for now, but it'd be nice to consolidate knowledge of routes to the server and pass them down as needed. Or even better - have only one "workshop survey results" route that worked for all workshop types. 🤷

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generic route is where we're heading toward. Once CSF Intro workshops also use the new survey form, all survey requests will be consolidated to 1 endpoint. Other survey view routes are legacy and can be removed.

For now the generic server endpoint is

def generic_survey_report
# 2 separate routes for CSF deep dive (201) workshop and summer/academic year workshop.
# We don't compute survey result roll-up for CSF deep dive.
return create_csf_survey_report if @workshop.csf? && @workshop.subject == SUBJECT_CSF_201
return create_generic_survey_report if [COURSE_CSP, COURSE_CSD].include?(@workshop.course)
raise 'Action generic_survey_report should not be used for this workshop'
rescue => e
notify_error e
end

but later it will be in the Foorm system
def generic_survey_report
report = Pd::Foorm::SurveyReporter.get_workshop_report(params[:workshop_id])
render json: report
end

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we will be in a different case for a while where some surveys will be using foorm and others using jotform, which will have different view urls most likely. So we may need to keep this if/else around (with different conditions) for a while.

@hacodeorg hacodeorg merged commit 52fa469 into staging Apr 24, 2020
@hacodeorg hacodeorg deleted the ha/ws-view-survey-link branch April 24, 2020 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants