[TOC]
# key:template 具體分類
主要是課件中交互題型相關的,因為是固定的不同題型,所以發送的是模板性質的,在下面每個類型里主要介紹發出的消息模板格式是如何的?
## connection 連線
## wheel 轉盤
只發送一個模板消息
```
template:{
type:'3', //Number 3 轉盤的數字
wheel:{
payload:JSON.stringfy(
{
type:'', //play |
angle:'' //Number
})
}
}
```
## 拖動圖片
開始拖動圖片
```
template:{
free:{
type:"lockedDrag",
payload:JSON.stringfy({"id":"image0"})
},
type:4
}
```
拖動圖片
```
template:{
type:'4', //String drag
free:{
type:'drag',// String free
payload:JSON.stringfy({
x:'', //play |
y:'', //play |
id:'', //play |
userId:'' //Number,
})
}
}
```
結束拖動圖片
```
template:{
free:{
type:"unLockedDrag",
payload:JSON.stringfy({"id":"image0"})
},
type:4
}
```
## ab -choice 選擇器,ad-choice選擇器
答對題目
```
template:{
choice:{
payload:JSON.stringfy({
"key":"a",
userId:'',
isRight:true // boolean
})
},
type:1
}
```
答錯題目
```
template:{
choice:{
payload:JSON.stringfy({
"key":"b",
userId:'',
isRight:false
})
},
type:1
}
```
## connect 連線題
原理:每次連線正確的信息都會匯總到sync里的m對象信息里,連接正確,那么對應的一題比如a:true設置為true.
點擊選項,發送兩個模板消息
```
template:{
connection:{
type:'answer',
payload:'a'
},
type:0, //
userId:''//
}
```
```
template:{
connection:{
type:'sync',
payload:JSON.stringfy({
"c":{to:'a'},
m:{}
})
},
type:0, //
userId:''//
}
```
再點擊匹配項目,如果匹配正確,發送3個模板消息
```
template:{
connection:{
type:'sync',
payload:JSON.stringfy({
"c":{to:'a',from:'a'},
m:{a:true}
})
},
type:0, //
userId:''//
}
```
```
template:{
connection:{
type:'choice',
payload:'a'
},
type:0, //
userId:''//
}
```
```
template:{
connection:{
type:'sync',
payload:JSON.stringfy({
"c":{},
m:{a:true}
})
},
type:0, //
userId:''//
}
```
answer部分選擇之后,answer消息發布,同步增加c:to的內容;(共2個模板消息)。
**選錯**choice之后,choice消息發布,另外choice消息仍然一致,將c的內容清空,選擇的anwser清空。(共2個模板消息)
連線重置,發送兩個模板消息,行為本身,sync清空
```
template:{
connection:{
type:'reset',
payload:null
},
type:0, //
userId:''//
}
```
```
template:{
connection:{
type:'sync',
payload:JSON.stringfy({
"c":{},
m:{}
})
},
type:0, //
userId:''//
}
```
## 篩子 dice
備注:篩子傳送的數組比實際數字-1
開始篩子
```
template:{
dice:{
payload:JSON.stringfy({
type:'play' //string :play
})
},
type:2, //
}
```
結束篩子
```
template:{
dice:{
payload:JSON.stringfy({
type:'sync', //string :play
number:1
})
},
type:2, //
}
```
## card卡片
正常下一張
```
template:{
card:{
type:'swap',
payload:JSON.stringfy({id:0})
},
type:5, //
userId:''
}
```
反面
```
template:{
card:{
type:'swapAll'
},
type:5, //
userId:''
}
```
重置
```
template:{
card:{
type:'reset'
},
type:5, //
userId:''
}
```
## 判斷題
```
template:{
choice:{
payload:JSON.stringfy({
"key":"b",
userId:'',
isRight:false
})
},
type:1
}
```
- 相關資源鏈接
- 米樂星球小程序內調研
- 項目結構說明
- 交互課件說明
- server項目說明
- 項目說明
- 項目啟動
- app.js做的事情
- 獲取互動課件的地址
- 分析互動課件地址的參數
- policy目錄--lesson.js
- 解析ppt--api/lesson.js
- 信令中的key:template
- 信令中的key:media
- kk-talkee-engine.js
- Message
- 課件模板頁的識別過程
- 解析課件模板的源文件
- 場景與模板的對應關系
- 所有場景的基類
- choiceScence為例
- 注意事項
- ws
- online項目的說明
- online消息
- 課件編輯項目
- 資源鏈接
- 基本項目信息
- electron項目結構分析
- ipc
- 模板題組
- 普通題組
- 游戲題組
- 課件導出內容分析
- 課件模板分類明細
- 圖片題
- 視頻題
- 音頻題
- 選擇題
- 判斷題
- 轉盤
- 篩子
- 圖層拖拽
- 動畫題
- 翻拍題
- 語音題
- 201908變更
- 課件制作流程分析
- 菜單配置
- 入口操作
- 定義模板布局與初始化
- 選擇素材
- 導出過程
- egret
- interface
- ad選擇器模板
- ab選擇器模板
- 圖層拖拽模板
- 判斷題模板
- xml
- 轉盤
- events
- components
- 父類組件
- 基本組件
- 判斷題組件
- 龍骨動畫調研
- 基本了解
- 產品原型
- 白板Client項目
- 消息類型
- 白板項目分析
- 入口