Skip to content

Commit

Permalink
free text not finished
Browse files Browse the repository at this point in the history
  • Loading branch information
leaantonia committed Jun 10, 2024
1 parent 2e27969 commit c80ed39
Show file tree
Hide file tree
Showing 57 changed files with 315 additions and 64 deletions.
3 changes: 3 additions & 0 deletions packages/Liquid-Core.package/LQFreeTextAnswer.class/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Answers belonging currently all Questions have this type. However, this might be later split up into different question modes.
Notable Instance Variables:
- votedChoiceList: An OrderedCollection of all the choices the participant voted.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class initialization
newWithQuestion: aQuestion andVotes: anOrderedCollection

^ LQAnswer new
questionId: aQuestion id;
choicesRanking: (anOrderedCollection collect: [:each | each description]) ;
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
answer: anObject
answer := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
answer
^ answer
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
id: aString

id := aString
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
id

^ id
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
initialize-release
initialize
super initialize.
self id: UUID new asString.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
printing
printDataOn: aStream

self choicesRanking ifEmpty: [^ self].
self choicesRanking
collect: [:votedChoice |
aStream nextPutAll: votedChoice.
aStream nextPutAll: ':']
from: 1
to: self choicesRanking size - 1.

aStream nextPutAll: self choicesRanking last
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
questionId: aString

questionId := aString
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
questionId

^ questionId
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"class" : {
"newWithQuestion:andVotes:" : "Anton Eichstädt 6/5/2024 17:28" },
"instance" : {
"answer" : "leli 6/10/2024 15:46",
"answer:" : "leli 6/10/2024 15:46",
"id" : "JT 8/2/2022 16:59",
"id:" : "JT 8/2/2022 16:59",
"initialize" : "leli 6/10/2024 15:45",
"printDataOn:" : "Anton Eichstädt 5/24/2024 15:23",
"questionId" : "JT 8/2/2022 17:01",
"questionId:" : "JT 8/2/2022 17:01" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"category" : "Liquid-Core",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "<historical>",
"instvars" : [
"id",
"questionId",
"answer" ],
"name" : "LQFreeTextAnswer",
"pools" : [
],
"super" : "Object",
"type" : "normal" }
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
initialize-release
buildEmptyAnswer

^ LQAnswer new
^ LQFreeTextAnswer new.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
},
"instance" : {
"asString" : "JT 8/2/2022 17:01",
"buildEmptyAnswer" : "Anton Eichstädt 6/5/2024 17:28",
"buildEmptyAnswer" : "leli 6/10/2024 15:47",
"id" : "JT 8/2/2022 17:01",
"id:" : "JT 8/2/2022 17:01",
"initialize" : "leli 6/7/2024 11:57",
"isVotedChoice:ValidFrom:" : "ms 8/4/2022 21:31",
"maxNumberOfCharacters" : "leli 6/7/2024 11:54",
"maxNumberOfCharacters:" : "leli 6/7/2024 11:54",
"title" : "JT 8/2/2022 17:02",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,5 @@ buildRankingIndicesWith: aBuilder
^ aBuilder pluggableListSpec new
model: self;
list: #fillSideboard;
"getIndex: #choiceSelected;
setIndex: #choiceSelected:;
getSelectionList: #choiceAt:;
setSelectionList: #choiceAt:put:;"
frame: (0.025 @ 0.2 corner: 0.05 @ 0.8);
yourself
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"buildMultiSelectionListWith:" : "Anton Eichstädt 5/28/2024 15:55",
"buildQuestionTitleTextWith:" : "Anton Eichstädt 5/28/2024 15:59",
"buildQuestionTooltipWith:" : "Anton Eichstädt 5/28/2024 15:59",
"buildRankingIndicesWith:" : "Anton Eichstädt 6/4/2024 11:38",
"buildRankingIndicesWith:" : "leli 6/10/2024 14:01",
"buildRemainingVotedChoicesCounterTextWith:" : "JT 8/5/2022 18:25",
"builder" : "bn 8/2/2022 21:07",
"builder:" : "bn 8/2/2022 21:08",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
The LQAnswerPanel contains all logic needed to display and interact with LQQuestion in the LQParticipantMenu. As this is a lot, also depending on (future) different kinds of questions, this logic has been moved out of the LQParticipantMenu into this class, even though the UI is displayed concurrently with the LQParticipantMenu.

The Sideboard shows Xs when the question is a MultiChoice Question (via getMarkers), and the ranking for when the question is a priority question.

Notable Instance Variables:
answer: The LQAnswer currently being edited by the participant. One LQAnswer exists for each LQQuestion and Participant.
choiceSelected: The choice that was last selected in the MultiSelectionList.
selectedChoices: An Set (OrderedCollection for the Priority Case) of all choices that have already been selected by the participant.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
instance creation
newWith: aBuilder

^ self new builder: aBuilder
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
accessing
answer: aText
answer := aText.
answer questionId: self question id.
self changed: #getRemainingCharacters

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
answer

^ answer
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
toolbuilder
buildQuestionTitleTextWith: aBuilder

^ aBuilder pluggableTextSpec new
model: self;
getText: #getTitle;
indicateUnacceptedChanges: false;
readOnly: true;
frame: (LayoutFrame fractions: (0.15 @ 0.05 extent: 0.8 @ 0) offsets: (0 @ 0 extent: 0 @ 30));
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
toolbuilder
buildQuestionTooltipWith: aBuilder

^ aBuilder pluggableButtonSpec new
label: #tooltipSymbol;
model: self;
enabled: false;
help: self question toolTip;
frame: (LayoutFrame fractions: (0.15 @ 0.1 extent: 0 @ 0) offsets: (0 @ 0 extent: 30 @ 30));
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
toolbuilder
buildRemainingCharactersCounterTextWith: aBuilder

^ aBuilder pluggableTextSpec new
model: self;
getText: #getRemainingCharacters;
indicateUnacceptedChanges: false;
readOnly: true;
frame: (self layoutFrame);
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
toolbuilder
buildTextInputWith: aBuilder
^ aBuilder pluggableTextSpec new model: self;
getText: #answer;
editText: #answer:;
indicateUnacceptedChanges: false;

frame: (0.15 @ 0.2 corner: 0.9 @ 0.8);
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
builder: aBuilder

builder := aBuilder
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
builder

^ builder
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
accessing
getChildren
^ {self builder
build: (self buildQuestionTitleTextWith: self builder). self builder
build: (self buildQuestionTooltipWith: self builder). self builder
build: (self buildRemainingCharactersCounterTextWith: self builder). self builder
build: (self buildTextInputWith: self builder)}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
getRemainingCharacters
^ 'Remaining Characters: ' , (self question maxNumberOfCharacters - self answer size)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
getTitle

^ self question title
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
initialize-release
initialize

self
model: self;
frame: (0 @ 0 corner: 1 @ 1);
children: #getChildren
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
validation
isValidSizedInput: aText
^ aText size <= self question maxNumberOfCharacters
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
accessing
layoutFrame

^ LayoutFrame new
topFraction: 0.81;
leftFraction: 0.10;
rightFraction: 0.31;
bottomFraction: 0.91;
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
question: aQuestion
question := aQuestion.
self answer: aQuestion buildEmptyAnswer.
self resetUI
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
question

^ question
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
resetUI
self changed: #answer.
self changed: #getTitle.
self changed: #getRemainingVotedChoices
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
tooltipSymbol

^ '?'
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"class" : {
"newWith:" : "CG 7/30/2021 19:06" },
"instance" : {
"answer" : "NM 6/5/2021 14:41",
"answer:" : "leli 6/10/2024 14:19",
"buildQuestionTitleTextWith:" : "Anton Eichstädt 5/28/2024 15:59",
"buildQuestionTooltipWith:" : "Anton Eichstädt 5/28/2024 15:59",
"buildRemainingCharactersCounterTextWith:" : "leli 6/10/2024 14:02",
"buildTextInputWith:" : "leli 6/10/2024 14:19",
"builder" : "bn 8/2/2022 21:07",
"builder:" : "bn 8/2/2022 21:08",
"getChildren" : "leli 6/10/2024 15:12",
"getRemainingCharacters" : "leli 6/10/2024 14:20",
"getTitle" : "CG 7/30/2021 19:06",
"initialize" : "bn 7/14/2022 20:17",
"isValidSizedInput:" : "leli 6/10/2024 14:12",
"layoutFrame" : "JT 8/5/2022 18:24",
"question" : "NM 6/5/2021 14:40",
"question:" : "leli 6/10/2024 15:07",
"resetUI" : "leli 6/10/2024 15:10",
"tooltipSymbol" : "bn 5/12/2022 20:27" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"category" : "Liquid-UI",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "<historical>",
"instvars" : [
"builder",
"question",
"answer" ],
"name" : "LQFreeTextAnswerPanel",
"pools" : [
],
"super" : "PluggablePanelSpec",
"type" : "normal" }

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
toolbuilder
buildAnswerPanelWith: aBuilder
| temporaryAnswerPanel |

temporaryAnswerPanel := LQAnswerPanel newWith: aBuilder.
self answerPanel: temporaryAnswerPanel.
self currentQuestionIndex: 1.
temporaryAnswerPanel question: self currentQuestion.
temporaryAnswerPanel exclusionMarker:
(LQGroupExclusionMarker newFrom: self currentQuestion choiceList
and: (LQPollRepo default groupAt: self poll id)).
self answerSet addAnswer: temporaryAnswerPanel answer.
^ temporaryAnswerPanel
| temporaryPanel |
temporaryPanel := LQAnswerPanel newWith: aBuilder.
self selectionPanel: temporaryPanel.
self answerSet addAnswer: temporaryPanel answer.
^ temporaryPanel
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
toolbuilder
buildFreeTextPanelWith: aBuilder
| temporaryFreeTextPanel |
temporaryFreeTextPanel := LQFreeTextAnswerPanel newWith: aBuilder.
self freeTextPanel: temporaryFreeTextPanel.
temporaryFreeTextPanel question: self currentQuestion.
self answerSet addAnswer: temporaryFreeTextPanel answer.
self setUpMenu.
^ temporaryFreeTextPanel
Loading

0 comments on commit c80ed39

Please sign in to comment.