Skip to content

Commit

Permalink
Adjusts condi question help text wording. Fixes blank node rendering …
Browse files Browse the repository at this point in the history
…in score screen.
  • Loading branch information
clpetersonucf committed Jun 12, 2024
1 parent 1305287 commit 8672367
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/creator.html
Original file line number Diff line number Diff line change
Expand Up @@ -1360,7 +1360,7 @@ <h2 ng-if="displayNodeCreation == END">Conditional End Text</h2>
<p ng-class="{'hidden': inventoryItems.length > 0}">Choose to display different narratives based on the number of times the player has visited this destination.</p>
<p ng-class="{'hidden': inventoryItems.length == 0}">Choose to display different narratives based on the player's number of <strong>visits</strong> to this destination and/or what <strong>items</strong> they have in their inventory.</p>
<p id="question-instructions-subtext">
<span><strong>How the widget chooses which one to display:</strong></span> 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.
<span><strong>How the widget chooses which option to display:</strong></span> 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.
</p>
<p class="invalid-quantity-message">{{invalidRequiredVisits}}</p>
</div>
Expand Down
9 changes: 6 additions & 3 deletions src/src-assets/score-assets/score.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -111,27 +111,30 @@ 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
else
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
Expand Down

0 comments on commit 8672367

Please sign in to comment.