Skip to content

Commit

Permalink
Merge pull request #229 from datasci4health/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
santanche authored Sep 7, 2020
2 parents f5c6929 + fcf0699 commit 70b7ff8
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 38 deletions.
17 changes: 1 addition & 16 deletions src/adonisjs/public/dccs/components/dcc-expression.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
// <TODO> provisory unfold
Expand All @@ -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) {
Expand All @@ -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
Expand All @@ -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':
Expand Down Expand Up @@ -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
}

Expand Down
6 changes: 0 additions & 6 deletions src/adonisjs/public/infra/dcc-common-server-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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) {
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
3 changes: 0 additions & 3 deletions src/adonisjs/public/player/js/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -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])
}
Expand Down
8 changes: 4 additions & 4 deletions src/adonisjs/public/templates/simple/case/quiz_sequence.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**.
Expand All @@ -32,12 +32,12 @@ Write here the **feedback**.
* [Enter References](References)
}}

* Next Question -> Flow.Next

# Note (note)

**You answered:** ^Previous.input1^.
<br>



^parameter^

___ Flow ___
Expand Down
12 changes: 7 additions & 5 deletions src/adonisjs/public/templates/simple/case/quiz_short.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Presentation (quiz)
# Presentation (quiz, end)

Write here the **stem** of your quiz.

Expand All @@ -8,18 +8,20 @@ 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^.
<br>



^parameter^

# Presentation References (note)

**You answered:** ^Previous.input1^.
<br>



^parameter^

References <-> References
Expand Down
9 changes: 9 additions & 0 deletions src/adonisjs/public/templates/simple/knot/visit_day.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# _Knot_Name_ (input)

<h2>Day X</h2>

{{feedback
Write here the yesterday's Feedback.
}}

{{references
* [Enter References](References)
}}

{{stem
Write here the **stem**.
}}
Expand Down
7 changes: 4 additions & 3 deletions src/adonisjs/public/translator/translator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++
Expand Down Expand Up @@ -2170,7 +2170,7 @@ class Translator {
mark: /^[ \t]*(?:\(([\w\.]+)[ \t]*(==|>|<|>=|<=|&gt;|&lt;|&gt;=|&lt;=)[ \t]*((?:"[^"\n\r\f]+")|(?:\-?\d+(?:\.\d+)?)|(?:[\w\.]+))\)[ \t]*)?-(?:(?:&gt;)|>)[ \t]*([^"\n\r\f]+)(?:"([^"\n\r\f]+)")?[ \t]*$/im
},
divert: {
mark: /(?:(\w+)|"([^"]+)")(?:[ \t])*((?:(?:(?:&lt;)|<)?-(?:(?:&gt;)|>))|(?:\(-\)))[ \t]*(?:(\w[\w.]*)|"([^"]*)")/im,
mark: /(?:([^&<> \t\n\r\f][^&<> \t\n\r\f]*)|"([^"]+)")(?:[ \t])*((?:(?:(?:&lt;)|<)?-(?:(?:&gt;)|>))|(?:\(-\)))[ \t]*(?:(\w[\w.]*)|"([^"]*)")/im,
inline: true
},
entity: {
Expand Down Expand Up @@ -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']
Expand Down
2 changes: 1 addition & 1 deletion src/adonisjs/resources/views/player/welcome.edge
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</div>

<div class="container-fluid">
<div class="row row-cols-sm-2 row-cols-md-3 row-cols-lg-6 justify-content-center">
<div class="row row-cols-sm-2 row-cols-md-3 row-cols-lg-5 justify-content-center">
@each(q in quests)


Expand Down

0 comments on commit 70b7ff8

Please sign in to comment.