如何将照片和视频添加到JSON测试格式
How to add photo and video to JSON quiz format?
我正在用JSON、jQuery和JavaScript做一个测试。
以下是我在JSON中的问题:
"questions": [
{ "q": "At a birthday party you counted 120 eyes. How many people were at the party?",
"a": [
{"option": "240", "correct": false},
{"option": "60", "correct": true},
{"option": "120", "correct": false},
{"option": "30", "correct": false} // no comma here
],
如何在问题中添加图像。这是正确的语法吗?
I have a folder called img
“q”: "At a birthday party you counted 120 eyes. How many people were at the party? <br> <br>" +
"<i** src="/i**/eyes.filename'">, ** denotes mg read: image source
此外,我如何在YouTube上有链接的问题中嵌入视频文件?
想明白了。这就是嵌入视频的方式:
{
"q": "How would you weigh on the moon compared to earth?",
"a": [
{"option": "More", "correct": false},
{"option": "The same", "correct": false},
{"option": "Less", "correct": true},
{"option": "Need more info", "correct": false} // no comma here
],
"correct": "<p><span>Good Job!</span> Eat your cheesy pizza, fries, nachos, and fly to the moon to be a size zero or watch this video <br> <center> <iframe width=560 height=315 src=https://www.youtube.com/embed/OIzOCvxJcSE frameborder=0 allowfullscreen></iframe> </center> </p>",
"incorrect": "<p><span>ERRRR!</span> Weight is determined by gravity, or how strongly gravity pulls on matter. Since the gravity on moon is weak compared to earth, you will weigh less.<br>Ready for a physics class? <center><iframe width=560 height=315 src=https://www.youtube.com/embed/OIzOCvxJcSE frameborder=0 allowfullscreen></iframe> </center> </p>" // no comma here
}
这就是在json:中添加图像的方式
{
"q": "What is the amount of matter in an object called? <br> <img src=https://cdn.vectorstock.com/i/composite/08,88/question-weighing-scale-vector-840888.jpg/>",
"a": [
{"option": "Weight", "correct": false},
{"option": "Density", "correct": false},
{"option": "Volume", "correct": false},
{"option": "Mass", "correct": true} // no comma here
],
//Make it select any rather than all.
"correct": "<p><span>Correct!</span> You like fancy words don't you?</p>",
"incorrect": "<p><span>Fail.</span> Sorry. You need to brush up on your physics vocabulary. Weight is a measure of how strongly gravity pulls on that matter. Density describes how compact or concentrated something is, expressed as mass per unit volume. Volume is Volume is the amount of space that comprises a length, a width and a height, occupied by an object or a material.</p>"
}
相关文章:
- 如何模拟json数据进行单元测试
- 测试两个版本的 json 架构是否向后兼容
- 使用json模式的mocha全覆盖测试
- 如何将照片和视频添加到JSON测试格式
- 在使用Protractor进行测试时,我可以用json文件替换结果,而不是调用实际的REST端点
- Javascript 客户端框架与 Rails JSON API - 如何进行集成测试
- package.json“最新”版本是否包含测试版
- 单元测试:AngularJS + Karma + Jasmine,加载本地JSON
- 如何在 JSON 字符串中选择两个测试对象并将它们映射到我的接口
- 测试以查看具有 json 值的图像是否损坏/不存在,并替换为“无照片”图像
- 如何测试我的 json 的任何属性是否具有特定的子属性,没有循环
- 如何在Rails4中测试json格式的操作
- 我想知道Jquery加载json文件时如何在本地测试页面
- 从jasmine测试中获取JSON数据/报告
- 为什么在ember中添加didInsertElement以获取json后,我的测试失败了
- 如何在流星服务器端测试中加载json文件
- 如何将外部JSON文件读取到我的html/javascript测试中
- 使用JavaScript获取JSON响应并在网页上显示,测试JavaScript
- 测试JSON项目中的属性是否为空
- 如何在NodeJS中测试上传的文件是否为json文件