From d606a263f119444ca827f3ed444b5f0ee9733e66 Mon Sep 17 00:00:00 2001 From: Heitor Mattosinho Date: Mon, 7 Sep 2020 15:51:53 -0300 Subject: [PATCH 1/5] refactor (bus): change bus ext to false --- src/adonisjs/public/infra/bus.js | 2 +- src/adonisjs/resources/views/player/welcome.edge | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/adonisjs/public/infra/bus.js b/src/adonisjs/public/infra/bus.js index 25431ee6c..9820bbc5a 100644 --- a/src/adonisjs/public/infra/bus.js +++ b/src/adonisjs/public/infra/bus.js @@ -206,5 +206,5 @@ class MessageBus { MessageBus._connection = 1 MessageBus.int = new MessageBus(false) - MessageBus.ext = new MessageBus(true) + MessageBus.ext = new MessageBus(false) })() diff --git a/src/adonisjs/resources/views/player/welcome.edge b/src/adonisjs/resources/views/player/welcome.edge index 4330cdd78..2db6eb47e 100755 --- a/src/adonisjs/resources/views/player/welcome.edge +++ b/src/adonisjs/resources/views/player/welcome.edge @@ -21,7 +21,7 @@
-
+
@each(q in quests) From 99089943fdd6ec8e5def0c57b39a7fc75ec6273d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Santanch=C3=A8?= Date: Mon, 7 Sep 2020 16:23:04 -0300 Subject: [PATCH 2/5] feat (template): feedback and references in the last day --- src/adonisjs/public/templates/simple/knot/visit_day.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/adonisjs/public/templates/simple/knot/visit_day.md b/src/adonisjs/public/templates/simple/knot/visit_day.md index fde6f3b52..792e9e152 100644 --- a/src/adonisjs/public/templates/simple/knot/visit_day.md +++ b/src/adonisjs/public/templates/simple/knot/visit_day.md @@ -1,6 +1,15 @@ # _Knot_Name_ (input)

Day X

+ +{{feedback +Write here the yesterday's Feedback. +}} + +{{references +* [Enter References](References) +}} + {{stem Write here the **stem**. }} From cc233d1029d7ee300f72c109f52131c4f582ee97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Santanch=C3=A8?= Date: Mon, 7 Sep 2020 18:31:29 -0300 Subject: [PATCH 3/5] fix (translator): linefeed presentation for output --- .../public/dccs/components/dcc-expression.js | 17 +---------------- .../public/infra/dcc-common-server-proxy.js | 6 ------ src/adonisjs/public/player/js/state.js | 3 --- .../public/templates/simple/case/quiz_short.md | 8 ++++++-- src/adonisjs/public/translator/translator.js | 5 +++-- 5 files changed, 10 insertions(+), 29 deletions(-) diff --git a/src/adonisjs/public/dccs/components/dcc-expression.js b/src/adonisjs/public/dccs/components/dcc-expression.js index 1a74e4a34..a1b4e92ee 100644 --- a/src/adonisjs/public/dccs/components/dcc-expression.js +++ b/src/adonisjs/public/dccs/components/dcc-expression.js @@ -31,13 +31,9 @@ class DCCExpression extends DCCVisual { } const compiled = DCCExpression.compileStatementSet(this.expression) - console.log('=== compiled:') - console.log(compiled) - for (const c of compiled) { console.log('=== result: ' + DCCExpression.computeExpression(c[1])) } + // for (const c of compiled) { console.log('=== result: ' + DCCExpression.computeExpression(c[1])) } let result = await MessageBus.ext.request('var/' + this._variable + '/get') - console.log('=== result field') - console.log(result.message) if (result.message == null) { result = '' } else { if (this._index == null) { // provisory unfold @@ -60,19 +56,13 @@ class DCCExpression extends DCCVisual { } static compileStatementSet (statementSet) { - console.log('=== statement set') - console.log(statementSet) const statementLines = statementSet.split(/;\r?\n?|\r?\n/) - console.log('=== statement lines') - console.log(statementLines) const compiledSet = [] for (const l of statementLines) { compiledSet.push(DCCExpression.compileStatement(l)) } return compiledSet } static compileStatement (statement) { - console.log('=== compile') - console.log(statement) const compiled = [] const assign = statement.match(DCCExpression.assignment) if (assign != null) { @@ -92,8 +82,6 @@ class DCCExpression extends DCCVisual { * (avoid transformations during its execution) */ static compileExpression (expression) { - console.log('=== expression') - console.log(expression) const compiled = [] const stack = [] let mdfocus = expression @@ -110,7 +98,6 @@ class DCCExpression extends DCCVisual { } if (matchStart > -1) { const matchContent = mdfocus.match(DCCExpression.element[selected])[0] - console.log('=== ' + selected + ': ' + matchContent) switch (selected) { case 'number': @@ -158,8 +145,6 @@ class DCCExpression extends DCCVisual { compiled.push([(op[1] == DCCExpression.precedence.function) ? DCCExpression.role.function : DCCExpression.role.arithmetic, op[0]]) } - console.log('=== compiled') - console.log(compiled) return compiled } diff --git a/src/adonisjs/public/infra/dcc-common-server-proxy.js b/src/adonisjs/public/infra/dcc-common-server-proxy.js index 00f7eb0f9..cd50168e3 100644 --- a/src/adonisjs/public/infra/dcc-common-server-proxy.js +++ b/src/adonisjs/public/infra/dcc-common-server-proxy.js @@ -112,8 +112,6 @@ class DCCCommonServer { const response = await fetch( DCCCommonServer.managerAddressAPI + "case/list", header); */ - console.log('=== cases list request') - console.log(header) // console.log(DCCCommonServer.managerAddressAPI); /* const response = await fetch( @@ -122,8 +120,6 @@ class DCCCommonServer { */ const response = await fetch( DCCCommonServer.managerAddressAPI + 'user/cases', header) - console.log('=== cases list response') - console.log(response) const jsonResponse = await response.json() const busResponse = [] for (const c in jsonResponse) { @@ -154,7 +150,6 @@ class DCCCommonServer { } else { const caseId = MessageBus.extractLevel(topic, 3) if (document.querySelector("#settings-modal") == null) { - console.log('=== collecting from REST') let header = { "async": true, "crossDomain": true, @@ -179,7 +174,6 @@ class DCCCommonServer { keywords: jsonResponse.keywords, source: jsonResponse.source}; } else { - console.log('=== collecting from modal') caseObj = { title: document.getElementById('case_title').value, description: document.getElementById('description').value, diff --git a/src/adonisjs/public/player/js/state.js b/src/adonisjs/public/player/js/state.js index 6772e7ecb..c7e01f009 100644 --- a/src/adonisjs/public/player/js/state.js +++ b/src/adonisjs/public/player/js/state.js @@ -146,9 +146,6 @@ class PlayState { } if (id != null) { - console.log('=== variable get') - console.log(id) - console.log(this._state.variables[id]) MessageBus.ext.publish(MessageBus.buildResponseTopic(topic, message), this._state.variables[id]) } diff --git a/src/adonisjs/public/templates/simple/case/quiz_short.md b/src/adonisjs/public/templates/simple/case/quiz_short.md index 726b793cc..253fde94d 100644 --- a/src/adonisjs/public/templates/simple/case/quiz_short.md +++ b/src/adonisjs/public/templates/simple/case/quiz_short.md @@ -13,13 +13,17 @@ Write here the **stem** of your quiz. # Note (note) **You answered:** ^Previous.input1^. -
+ + + ^parameter^ # Presentation References (note) **You answered:** ^Previous.input1^. -
+ + + ^parameter^ References <-> References diff --git a/src/adonisjs/public/translator/translator.js b/src/adonisjs/public/translator/translator.js index 7e1aeeb6f..cbd838b66 100644 --- a/src/adonisjs/public/translator/translator.js +++ b/src/adonisjs/public/translator/translator.js @@ -521,7 +521,7 @@ class Translator { compiled[c] = tblock } } else if (c > 0 && - this._equivalentSubQuote(compiled[c], compiled[pr])) { + this._equivalentSubQuote(compiled[c], compiled[pr])) { // adds element and previous linefeed (if exists) for (let e = pr + 1; e <= c; e++) { tblockSeq++ @@ -2231,7 +2231,8 @@ class Translator { Translator.subordinatorElement = ['entity'] Translator.isLine = ['knot', 'field', 'item', 'option', 'divert-script', 'entity', 'input', 'compute', 'context-open'] - Translator.textBlockCandidate = ['select', 'annotation', 'text', 'mention', 'image'] + Translator.textBlockCandidate = ['select', 'annotation', 'text', 'mention', 'image', + 'output'] Translator.scriptable = ['compute', 'divert-script'] Translator.fieldSet = ['vocabularies', 'answers', 'states', 'labels'] From c6f7592228b641f05393b9a3266d83492bf43e28 Mon Sep 17 00:00:00 2001 From: Heitor Mattosinho Date: Mon, 7 Sep 2020 18:38:34 -0300 Subject: [PATCH 4/5] refactor (bus): change bus ext to true --- src/adonisjs/public/infra/bus.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adonisjs/public/infra/bus.js b/src/adonisjs/public/infra/bus.js index 9820bbc5a..25431ee6c 100644 --- a/src/adonisjs/public/infra/bus.js +++ b/src/adonisjs/public/infra/bus.js @@ -206,5 +206,5 @@ class MessageBus { MessageBus._connection = 1 MessageBus.int = new MessageBus(false) - MessageBus.ext = new MessageBus(false) + MessageBus.ext = new MessageBus(true) })() From fcf0699952a254f17e5cfb1be6d69390f55b2a3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Santanch=C3=A8?= Date: Mon, 7 Sep 2020 19:02:14 -0300 Subject: [PATCH 5/5] feat (translator): divert accepting accent --- .../public/templates/simple/case/quiz_sequence.md | 8 ++++---- src/adonisjs/public/templates/simple/case/quiz_short.md | 4 +--- src/adonisjs/public/translator/translator.js | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/adonisjs/public/templates/simple/case/quiz_sequence.md b/src/adonisjs/public/templates/simple/case/quiz_sequence.md index 26ef80e40..abb0b4185 100644 --- a/src/adonisjs/public/templates/simple/case/quiz_sequence.md +++ b/src/adonisjs/public/templates/simple/case/quiz_sequence.md @@ -22,7 +22,7 @@ Write here the **stem** of your question. * Next Question -> Flow.Next -# Feedback (quiz) +# Feedback (quiz, end) {{feedback Write here the **feedback**. @@ -32,12 +32,12 @@ Write here the **feedback**. * [Enter References](References) }} -* Next Question -> Flow.Next - # Note (note) **You answered:** ^Previous.input1^. -
+ + + ^parameter^ ___ Flow ___ diff --git a/src/adonisjs/public/templates/simple/case/quiz_short.md b/src/adonisjs/public/templates/simple/case/quiz_short.md index 253fde94d..4cd1d41f9 100644 --- a/src/adonisjs/public/templates/simple/case/quiz_short.md +++ b/src/adonisjs/public/templates/simple/case/quiz_short.md @@ -1,4 +1,4 @@ -# Presentation (quiz) +# Presentation (quiz, end) Write here the **stem** of your quiz. @@ -8,8 +8,6 @@ Write here the **stem** of your quiz. + Distractor 2 <-> "Feedback for Distractor 2" + Distractor 3 <-> "Feedback for Distractor 3" -* Next Case -> Case.Next - # Note (note) **You answered:** ^Previous.input1^. diff --git a/src/adonisjs/public/translator/translator.js b/src/adonisjs/public/translator/translator.js index cbd838b66..f6360391d 100644 --- a/src/adonisjs/public/translator/translator.js +++ b/src/adonisjs/public/translator/translator.js @@ -2170,7 +2170,7 @@ class Translator { mark: /^[ \t]*(?:\(([\w\.]+)[ \t]*(==|>|<|>=|<=|>|<|>=|<=)[ \t]*((?:"[^"\n\r\f]+")|(?:\-?\d+(?:\.\d+)?)|(?:[\w\.]+))\)[ \t]*)?-(?:(?:>)|>)[ \t]*([^"\n\r\f]+)(?:"([^"\n\r\f]+)")?[ \t]*$/im }, divert: { - mark: /(?:(\w+)|"([^"]+)")(?:[ \t])*((?:(?:(?:<)|<)?-(?:(?:>)|>))|(?:\(-\)))[ \t]*(?:(\w[\w.]*)|"([^"]*)")/im, + mark: /(?:([^&<> \t\n\r\f][^&<> \t\n\r\f]*)|"([^"]+)")(?:[ \t])*((?:(?:(?:<)|<)?-(?:(?:>)|>))|(?:\(-\)))[ \t]*(?:(\w[\w.]*)|"([^"]*)")/im, inline: true }, entity: {