@@ -25,7 +25,7 @@
@each(c in cases)
{{c.title}}
-
+
EDIT
PREVIEW
DELETE
diff --git a/src/adonisjs/public/author/js/draft.js b/src/adonisjs/public/author/js/draft.js index d40108379..7b143e09b 100644 --- a/src/adonisjs/public/author/js/draft.js +++ b/src/adonisjs/public/author/js/draft.js @@ -20,7 +20,8 @@ class DraftManager { this._boxesPanel = document.querySelector('#case-boxes') // this._draftSelect(authorState.userid, advanced); - this._draftSelect(advanced) + //this._draftSelect(advanced) + this._draftQuestCasesSelect(advanced) } async _draftSelect (advanced) { @@ -74,6 +75,65 @@ class DraftManager { } } + async _draftQuestCasesSelect (advanced) { + // const cases = await MessageBus.ext.request('data/case/*/list') + // {user: userid}); + + const cl = document.getElementsByClassName('buttons-container') + for (const c in cl) { + //console.log(cl[c]); + const editButton = cl[c].children[0] + //console.log(editButton.id.substring(2)) + const previewButton = cl[c].children[1] + const deleteButton = cl[c].children[2] + + editButton.addEventListener('click', + function () { + Basic.service.authorPropertyStore('caseId', editButton.id.substring(1)) + // window.location.href = "http://0.0.0.0:10010/author/author.html"; + window.location.href = + '/author?id=' + editButton.id.substring(1) + } + ) + previewButton.addEventListener('click', + function () { + Basic.service.authorPropertyStore('caseId', editButton.id.substring(1)) + window.location.href = '/player/case?id=' + + previewButton.id.substring(1) + + '&preview' + } + ) + deleteButton.addEventListener('click', + function () { + MessageBus.int.publish('control/case/delete', editButton.id.substring(1)) + } + ) + if (advanced) { + downloadButton.addEventListener('click', + function () { + MessageBus.int.publish('control/case/download', this.id.substring(1)) + } + ) + } + } + // const template = document.createElement('template') + // const html = DraftManager.caseBox + // .replace('[download]', (advanced) ? DraftManager.caseDownload : '') + // template.innerHTML = html + // .replace(/\[id\]/ig, cl[c].id) + // // .replace("[icon]", cl[c].icon) + // .replace('[title]', cl[c].title) + // // .replace("[description]", cl[c].description); + // this._boxesPanel.appendChild(template.content.cloneNode(true)) + // const editButton = this._boxesPanel.querySelector('#e' + cl[c].id) + // const previewButton = this._boxesPanel.querySelector('#p' + cl[c].id) + // const deleteButton = this._boxesPanel.querySelector('#d' + cl[c].id) + // const downloadButton = (advanced) + // ? this._boxesPanel.querySelector('#w' + cl[c].id) : null + + } + + async deleteCase (topic, message) { const decision = await DCCNoticeInput.displayNotice( diff --git a/src/adonisjs/public/templates/simple/case/quiz_sequence.md b/src/adonisjs/public/templates/simple/case/quiz_sequence.md index de4f5ba04..42d2fd05c 100644 --- a/src/adonisjs/public/templates/simple/case/quiz_sequence.md +++ b/src/adonisjs/public/templates/simple/case/quiz_sequence.md @@ -15,7 +15,7 @@ Write here the **stem** of your question. Write here the **stem** of your question. > Write here the **lead-in** of your question. -+ Answer-key <-> "Feedback for Answer-key" ++ Answer-key <-> "Feedback for Answer-key" >((right)) + Distractor 1 <-> "Feedback for Distractor 1" + Distractor 2 <-> "Feedback for Distractor 2" + Distractor 3 <-> "Feedback for Distractor 3" @@ -32,7 +32,7 @@ Write here the **feedback**. * [Enter References](References) }} -* Next Case -> Flow.Next +* Next Case -> Case.Next # Note (note) diff --git a/src/adonisjs/resources/views/author/drafts-cases.edge b/src/adonisjs/resources/views/author/drafts-cases.edge index e1bfe70e5..e0d58e347 100644 --- a/src/adonisjs/resources/views/author/drafts-cases.edge +++ b/src/adonisjs/resources/views/author/drafts-cases.edge @@ -1,7 +1,7 @@ @layout('author.author-layout') @section('content') -
+