Sha256: d8c0c1f7061c1295e0360a4073df087b0d157a27786aaa2aaaa058e85b19019c

Contents?: true

Size: 964 Bytes

Versions: 26

Compression:

Stored size: 964 Bytes

Contents

-# frozen_string_literal: true
- questions = []
- panel.items.select{ |item| item.is_a? ::Quby::Questionnaires::Entities::Question}.each do |question|
  - question_hash = question.as_json
  - question_hash[:options]&.map do |option|
    - if question.type == :check_box
      - option[:startChosen] = (answer.send(question.key)[option[:key].to_s] == 1)
    - else
      - option[:startChosen] = (answer.send(question.key).to_s == option[:key].to_s)
  - questions << question_hash

:javascript
  $(function() {
    Quby.currentPanelQuestions = new Quby.Collections.Questions;
    var questions = #{raw questions.as_json.to_json};
    var initializer = new Quby.Logic.InitQuestions(questions);
    Quby.currentPanelQuestions = initializer.initializeQuestions();
    Quby.questions.addQuestions(Quby.currentPanelQuestions);
    panelProps = {panelId: '#{panel_id}', questions: Quby.currentPanelQuestions}
    Quby.panels.add(new Quby.Models.Panel(panelProps));
  });

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
quby-5.3.1 app/views/quby/v1/shared/_backbone_panel.html.haml
quby-5.3.0 app/views/quby/v1/shared/_backbone_panel.html.haml
quby-5.2.0 app/views/quby/v1/shared/_backbone_panel.html.haml
quby-5.1.3 app/views/quby/v1/shared/_backbone_panel.html.haml
quby-5.1.2 app/views/quby/v1/shared/_backbone_panel.html.haml
quby-5.1.1 app/views/quby/v1/shared/_backbone_panel.html.haml
quby-5.1.0 app/views/quby/v1/shared/_backbone_panel.html.haml
quby-5.0.5 app/views/quby/v1/shared/_backbone_panel.html.haml
quby-5.0.4 app/views/quby/v1/shared/_backbone_panel.html.haml
quby-5.0.3 app/views/quby/v1/shared/_backbone_panel.html.haml
quby-5.0.2 app/views/quby/v1/shared/_backbone_panel.html.haml
quby-5.0.1 app/views/quby/v1/shared/_backbone_panel.html.haml
quby-5.0.0 app/views/quby/v1/shared/_backbone_panel.html.haml
quby-4.0.4 app/views/quby/v1/shared/_backbone_panel.html.haml
quby-5.0.0.pre4 app/views/quby/v1/shared/_backbone_panel.html.haml
quby-5.0.0.pre3 app/views/quby/v1/shared/_backbone_panel.html.haml
quby-5.0.0.pre2 app/views/quby/v1/shared/_backbone_panel.html.haml
quby-5.0.0.pre1 app/views/quby/v1/shared/_backbone_panel.html.haml
quby-4.0.3 app/views/quby/v1/shared/_backbone_panel.html.haml
quby-4.0.2 app/views/quby/v1/shared/_backbone_panel.html.haml