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

Question about surveys #2712

Open
bennettscience opened this issue Feb 8, 2021 · 3 comments
Open

Question about surveys #2712

bennettscience opened this issue Feb 8, 2021 · 3 comments

Comments

@bennettscience
Copy link
Contributor

Can someone help me understand how surveys work? Specifically, if I create a survey in the Surveys section and select after_event, where are those displayed? Are they sent via email after each session? Or are they available on the event page?

Second, if I have a general survey I want attached to every event, is that possible? Or do I need to recreate the survey for each event individually?

@cycomachead
Copy link
Contributor

I would love to understand this workflow as well. :)

@bennettscience
Copy link
Contributor Author

I did some digging today and I think I have some answers after looking through the code and playing in a local instance. Instead of the event looking up a particular survey by ID, each survey looks for an event.

Models

The surveys table has two fields which control the display: surveyable_id and target. Setting these fields to the event ID displays the survey. So, a SQL call could attach a generic survey to each session, but that leads to another problem.

Survey results are sent based on ID. So, if you wanted to disassociate results for each event individually, the above method wouldn't work. You'd need to run a command which creates a new, templated table entry using existing IDs as keys.

Survey questions are stored in their own table. As long as you want the same questions on each event, you could quickly use SQL to add those records as well, with the survey_id being the critical value for display.

UX

I updated the templating in app/views/proposals/show.html.haml to show the survey with the event metadata rather than later (so people don't have to go back after the fact).

-# line 110
- if @surveys_after_event.any?
  .col-md-12 
    %dt Survey: 
    %dd
      = render partial: 'surveys/list', locals: { surveys: @surveys_after_event, conference: @conference }

When participants click on the link, it takes them to a new page with the survey.

The final problem has to do with submitting surveys. When the user submits, the survey page reloads instead of redirecting them somewhere logical. In our case, I'm redirecting back to the event page, but it could also make sense to take them to the Schedule or Registrations.

To get the redirect to work easily, I added a method on the Survey model to return the surveyable_id to pass to the redirect in the controller.

app/models/survey.rb

# end of file
def event
  return surveyable_id
end

app/controllers/surveys_controller.rb

# line 43
redirect_to conference_program_proposal_path(@conference, @survey.event)

bennettscience added a commit to bennettscience/ecs-events that referenced this issue Feb 23, 2021
See openSUSE/osem#2712 for more.

Small bugfix with the chat embed.
@differentreality
Copy link
Contributor

differentreality commented Mar 7, 2021

Yeah that's a bit confusing when you are directly on the admin/surveys page.

From admin/events#index page (admin/conferences/myconf/program/events), click on 'Add Survey' button.
That adds a survey for a specific event/talk

And the survey will appear after the event/talk has ended.
Screenshot from 2021-03-07 07-40-14

Next step would be to make a survey available for all events of a conference. That will require a few changes in saving the reply and showing the results

The event surveys show up at the end of proposals#show page (conferences/myconf/program/proposals/2)
Screenshot from 2021-03-07 07-53-51

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

No branches or pull requests

3 participants