Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- questions_template = [];
- getQuestionsTemplate() {
- let template = require('./datamodel_questions_template.json');
- for (var key in template) {
- if (!template.hasOwnProperty(key)) continue;
- if (key === "questions") {
- var obj = template[key];
- for (var prop in obj) {
- if (!obj.hasOwnProperty(prop)) continue;
- obj[prop].number = prop;
- this.questions_template.push(obj[prop]);
- }
- }
- }
- console.log(this.questions_template);
- }
- // File: "datamodel_questions_template.json"
- {
- "_id": "datamodel_questions_template",
- "questions": {
- "004": {
- "description": "Is billing calendar based?",
- "example": "(quarterly Jan 1st - March 31st), (monthly Feb 1st - Feb 28th), (weekly Sunday - Saturday).",
- "parent_question_id": "003",
- "questiontype": "radiobutton",
- "answer_options": [
- "Yes",
- "No"
- ],
- "next_question": "005",
- "actions": {
- "Yes": {
- "selecttables": [],
- "selecttags": []
- }
- }
- },
- "005": {
- "description": "Is there special holiday billing, rates or handling for this contract?",
- "parent_question_id": "004",
- "questiontype": "radiobutton",
- "answer_options": [
- "Yes",
- "No"
- ],
- "next_question": "006",
- "actions": {
- "Yes": {
- "selecttables": [
- "holiday_dim"
- ],
- "selecttags": [
- "holiday_dim.holiday_id.display_ui",
- "holiday_dim.holiday_id.selected"
- ]
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement