diff --git a/src/creator.html b/src/creator.html index 401b09f4..68143ace 100644 --- a/src/creator.html +++ b/src/creator.html @@ -1360,7 +1360,7 @@

Conditional End Text

Choose to display different narratives based on the number of times the player has visited this destination.

Choose to display different narratives based on the player's number of visits to this destination and/or what items they have in their inventory.

- How the widget chooses which one to display: If a player meets the requirements for more than one question, then it will choose the one that has not been shown yet. And if there is more than one question that hasn't been shown yet, it will choose the one with the most required items and visits. + How the widget chooses which option to display: If a player meets the requirements for more than one option, the option that has not yet been displayed will be chosen. If more than one option meeting the criteria hasn't been displayed yet, the option with the most required items and visits will be selected.

{{invalidRequiredVisits}}

diff --git a/src/src-assets/score-assets/score.coffee b/src/src-assets/score-assets/score.coffee index dea3e218..b580584a 100644 --- a/src/src-assets/score-assets/score.coffee +++ b/src/src-assets/score-assets/score.coffee @@ -111,14 +111,16 @@ angular.module('Adventure', ['ngSanitize']) if response.type == 'SCORE_FINAL_FROM_CLIENT' question = _getQuestionByNodeId qset, response.node_id rowQuestion = response.data[0] - if question.options.additionalQuestions + + if question.options.additionalQuestions and question.options.additionalQuestions.length > 0 rowQuestion = inventoryService.selectQuestion question, _currentInventory, inventoryService.visitedNodes rowQuestion = rowQuestion.text + row = text: rowQuestion - # text: _manageConditionalQuestion question, response.data[0] # needs to work with conditional questions score: response.data[1] type: if response.blank_node then 'blank' else 'end' + table.push row $scope.showOlderQsetWarning = response.older_qset @@ -126,12 +128,13 @@ angular.module('Adventure', ['ngSanitize']) question = _getQuestion qset, response.id items = if question.options.items then question.options.items else [] rowQuestion = response.data[0] + if question.options.additionalQuestions and question.options.additionalQuestions.length > 0 rowQuestion = inventoryService.selectQuestion question, _currentInventory, inventoryService.visitedNodes rowQuestion = rowQuestion.text + row = question: rowQuestion - # question: _manageConditionalQuestion question, response.data[0] answer: response.data[1] type: question.options.type feedback: response.feedback