Advertisement
kaihah

for loop

Oct 15th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.16 KB | None | 0 0
  1. {
  2. "SLOBS": {
  3. "setupItems": [
  4. ],
  5. "contentItems": [
  6. {"type":"text","variable":"questionText","label":"Question"},
  7. {"type":"text","variable":"selectedFont","label":"Font"},
  8. {"type":"range","variable":"fontSize","label":"Font Size","min":10,"max":100,"description":"Font Size"},
  9. {"type":"text","variable":"backgroundColor","label":"Background Color"},
  10. {"type":"text","variable":"tickerSpeed","label":"Ticker speed"},
  11. {"type":"range","variable":"bucketCount","label":"Buckets","min":1,"max":10,"description":""},
  12. {"type":"repeater","count":"$bucketCount","variablePrefix":"bucket","variable":"index","items":[
  13. {"type":"text","variable":"options","label":"Accaptable options(s)"},
  14. {"type":"text","variable":"name","label":"Name"},
  15. {"type":"text","variable":"color","label":"Color"},
  16. {"type":"boolean","variable":"correct","label":"Is this correct?"}
  17. ]}
  18. ],
  19. "playbackItems": [
  20. {"type":"commandButton","command":"question","name":"QUESTION","description":"Demo: QUESTION."},
  21. {"type":"commandButton","command":"raffle","name":"RAFFLE","description":"Demo: RAFFLE."}
  22. ]
  23. },
  24. "variables": {
  25. "bucketCount": 2,
  26. "tickerSpeed": "40",
  27. "backgroundColor": "red",
  28. "fontSize": 15,
  29. "questionText": "Write a question",
  30. "selectedFont": "Roboto",
  31. "bucket-0-options": "a",
  32. "bucket-0-name": "First bucket",
  33. "bucket-0-color": "green",
  34. "bucket-0-correct": "true",
  35. "bucket-1-options": "b",
  36. "bucket-1-name": "Second bucket",
  37. "bucket-1-color": "red",
  38. "bucket-1-correct": "true"
  39. },
  40. "width":800,
  41. "height":450,
  42. "slots":{
  43. "background":{"z":0,"x":0,"y":0,"width":800,"height":450},
  44. "overlay":{"z":1,"x":200,"y":150,"width":400,"height":150}
  45. },
  46. "assets":[],
  47. "fonts":[
  48. {"family":"${variable('selectedFont')}","url":""}
  49. ],
  50.  
  51. "scripts": {
  52. "testi": "var str = ''; for (var i=0 ; i<variable('bucketCount') ; i++) { str = str + variable('bucket-' + i + '-name'); } return str;"
  53. },
  54.  
  55.  
  56. "contents": {
  57. "c1_updater": "${ widget('questionChart',{'question':'q','layout':'horizontal','bucketWidth': 100, 'bucketHeight': 100, 'content':content('bucket')})}",
  58. "testi": "${ state('questionBucket', {'question':'q','index':0}).percentage }",
  59. "bucket":"${ variable('bucket-' + args.bucket + '-name') }",
  60.  
  61. "bucket2":"<span style='font-family:${variable('selectFont')};'>${variable('questionText')}</span> ${ script('testi') }"
  62.  
  63. },
  64. "commands":{"": {
  65. "script":"action('next',{'command':'question'})",
  66. "slots": {}
  67. },
  68. "question": {
  69. "script":"action('transition',{'out':{'effect':'fade','time':1},'in':{'effect':'fade','time':1}});action('startQuestion',{'id':'q','bucketCount':variable('bucketCount'),'buckets':[{'score':0,'options':variable('bucket-0-options')},{'score':0,'options':variable('bucket-1-options')},{'score':0,'options':variable('bucket-2-options')},{'score':0,'options':variable('bucket-3-options')},{'score':0,'options':variable('bucket-4-options')},{'score':0,'options':variable('bucket-5-options')},{'score':0,'options':variable('bucket-6-options')},{'score':0,'options':variable('bucket-7-options')},{'score':0,'options':variable('bucket-8-options')},{'score':0,'options':variable('bucket-9-options')}]})",
  70. "slots": {
  71. "background": "${ widget('questionChart',{'question':'q','layout':'vertical','content':content('bucket')})}",
  72.  
  73. "overlay": "<div style= 'font-size:${variable('fontSize')}px; position: fixed; left: 0; bottom: 0%; width: 100%; background-color:${variable('backgroundColor')}; padding: 20px;'>${ widget('ticker',{'content':content('bucket2'), 'speed': 40}) }</div>"
  74. }
  75. },
  76. "raffle": {
  77. "script":"action('transition',{'out':{'effect':'fade','time':1},'in':{'effect':'fade','time':1}});action('shuffle',{'id':'answerers','selection':[{'question':'q','type':'answered'}]});",
  78. "slots": {
  79. "background": "${ widget('raffle',{'shuffle':'answerers'}) }",
  80. "overlay": "${ state('shufflePlayer',{'shuffle':'answerers','index':0}).name }"
  81. }
  82. }
  83. }
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement