|
@@ -496,14 +496,15 @@ export default {
|
|
/* 获取完整的试卷数据 */
|
|
/* 获取完整的试卷数据 */
|
|
getStuPaper(paper, examScope) {
|
|
getStuPaper(paper, examScope) {
|
|
let curScope = examScope || paper.scope
|
|
let curScope = examScope || paper.scope
|
|
|
|
+ console.log(...arguments);
|
|
return new Promise(async (r, j) => {
|
|
return new Promise(async (r, j) => {
|
|
- let profile = localStorage.student_profile || localStorage.user_profile
|
|
|
|
- let blobHost = JSON.parse(decodeURIComponent(profile, "utf-8")).blob_uri
|
|
|
|
- let splitHost = blobHost.split('/')
|
|
|
|
|
|
+ let blobHost = this.getBlobHost()
|
|
// 根据试卷的Blob地址 去读取JSON文件
|
|
// 根据试卷的Blob地址 去读取JSON文件
|
|
- let sasString = curScope === 'school' ? await $tools.getSchoolSas(paper.code) : await $tools.getPrivateSas(paper.code)
|
|
|
|
|
|
+ let paperBlobPath = blobHost + '/' + paper.code + paper.blob
|
|
|
|
+ let fullPath = await $tools.getFileSas( paperBlobPath + '/index.json')
|
|
|
|
+ console.log(fullPath);
|
|
try {
|
|
try {
|
|
- let jsonInfo = await $tools.getFile(sasString.url + '/' + paper.code + paper.blob + '/index.json' + sasString.sas)
|
|
|
|
|
|
+ let jsonInfo = await $tools.getFile(fullPath.url)
|
|
let jsonData = JSON.parse(jsonInfo)
|
|
let jsonData = JSON.parse(jsonInfo)
|
|
jsonData.scope = curScope
|
|
jsonData.scope = curScope
|
|
jsonData.code = paper.code
|
|
jsonData.code = paper.code
|
|
@@ -511,12 +512,12 @@ export default {
|
|
// 获取试卷包含的试题数据并包装好
|
|
// 获取试卷包含的试题数据并包装好
|
|
if (jsonData.slides && jsonData.slides.length) {
|
|
if (jsonData.slides && jsonData.slides.length) {
|
|
jsonData.item = []
|
|
jsonData.item = []
|
|
- const path = sasString.url + '/' + paper.code + paper.blob
|
|
|
|
let promiseArr = []
|
|
let promiseArr = []
|
|
jsonData.slides.forEach((item, index) => {
|
|
jsonData.slides.forEach((item, index) => {
|
|
promiseArr.push(new Promise(async (resolve, reject) => {
|
|
promiseArr.push(new Promise(async (resolve, reject) => {
|
|
// 获取题目JSON并且包装成完整试题对象
|
|
// 获取题目JSON并且包装成完整试题对象
|
|
- let itemJson = JSON.parse(await $tools.getFile(path + '/' + item.url + sasString.sas))
|
|
|
|
|
|
+ let itemFullPath = await $tools.getFileSas( paperBlobPath + '/' + item.url)
|
|
|
|
+ let itemJson = JSON.parse(await $tools.getFile(itemFullPath.url))
|
|
itemJson.exercise.question = itemJson.item[0].question
|
|
itemJson.exercise.question = itemJson.item[0].question
|
|
itemJson.exercise.option = itemJson.item[0].option
|
|
itemJson.exercise.option = itemJson.item[0].option
|
|
itemJson.exercise.id = itemJson.id
|
|
itemJson.exercise.id = itemJson.id
|
|
@@ -555,10 +556,12 @@ export default {
|
|
/* 获取完整的试卷数据 */
|
|
/* 获取完整的试卷数据 */
|
|
getComposeItem(paper) {
|
|
getComposeItem(paper) {
|
|
return new Promise(async (r, j) => {
|
|
return new Promise(async (r, j) => {
|
|
|
|
+ console.log(paper);
|
|
// 根据试卷的Blob地址 去读取JSON文件
|
|
// 根据试卷的Blob地址 去读取JSON文件
|
|
let sasString = paper.scope === 'school' ? await $tools.getSchoolSas(paper.code) : await $tools.getPrivateSas(paper.code)
|
|
let sasString = paper.scope === 'school' ? await $tools.getSchoolSas(paper.code) : await $tools.getPrivateSas(paper.code)
|
|
|
|
+ let fullPath = await $tools.getFileSas(paper.blob)
|
|
try {
|
|
try {
|
|
- let jsonInfo = await $tools.getFile(paper.blob + sasString.sas)
|
|
|
|
|
|
+ let jsonInfo = await $tools.getFile(fullPath.url)
|
|
let jsonData = JSON.parse(jsonInfo)
|
|
let jsonData = JSON.parse(jsonInfo)
|
|
// 获取试卷包含的试题数据并包装好
|
|
// 获取试卷包含的试题数据并包装好
|
|
if (jsonData.length) {
|
|
if (jsonData.length) {
|