Skip to content

Commit

Permalink
Merge pull request #257 from hpi-swa-teaching/feature/prio_vote
Browse files Browse the repository at this point in the history
prio feature fertig nach 3 wochen
  • Loading branch information
L17L authored Jun 23, 2024
2 parents 8a99adf + 2ded1e2 commit 6b60fd0
Show file tree
Hide file tree
Showing 208 changed files with 593 additions and 239 deletions.
16 changes: 8 additions & 8 deletions docs/class-diagram.wsd
Original file line number Diff line number Diff line change
Expand Up @@ -69,26 +69,26 @@ package Core {
LQPoll "1" <- "*" LQAnswerSet
LQAnswerSet "1" <- "*" LQAnswer
interface LQAnswer
class LQChoicesAnswer {
class LQAnswer {
votedChoice
}
LQAnswer <|-- LQChoicesAnswer
LQAnswer <|-- LQAnswer

interface LQQuestion {
choiceList
}
' I chose * instead of 1 bcLdatastructure is there'
LQPollDraft "1" <- "*" LQQuestion
class LQChoicesQuestion {
class LQMultiChoiceQuestion {
maxNumberOfChoices
}
LQQuestion <|-- LQChoicesQuestion
LQQuestion <|-- LQMultiChoiceQuestion
LQAnswer "*" -- "1" LQQuestion
class LQChoice {
description
excludedGroups
}
LQChoicesQuestion "1" -> "*" LQChoice
LQMultiChoiceQuestion "1" -> "*" LQChoice
class LQUser {
id
name
Expand Down Expand Up @@ -137,12 +137,12 @@ package UI {
class LQPollDraftBuilder {
runPoll()
}
class LQQuestionBuilder{
class LQMultiChoiceQuestionBuilder{

}
LQPollDraftBuilder "1" <- "*" LQQuestionBuilder
LQPollDraftBuilder "1" <- "*" LQMultiChoiceQuestionBuilder
LQPollDraftBuilder --|> LQModel
LQQuestionBuilder --|> LQModel
LQMultiChoiceQuestionBuilder --|> LQModel

LQStartMenu -- LQHostMenu
LQStartMenu -- LQParticipantMenu
Expand Down
3 changes: 3 additions & 0 deletions packages/Liquid-Core.package/LQAnswer.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:
- choicesRanking: An OrderedCollection of all the choices the participant voted.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class initialization
newWithQuestion: aQuestion andVotes: anOrderedCollection

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

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

^ choicesRanking
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
evaluation
containsVoteForChoice: aChoice

^ self choicesRanking includes: aChoice description
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ initialize

super initialize.
self id: UUID new asString.
self votedChoiceList: OrderedCollection new
self choicesRanking: OrderedCollection new
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
13 changes: 13 additions & 0 deletions packages/Liquid-Core.package/LQAnswer.class/methodProperties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"class" : {
"newWithQuestion:andVotes:" : "Anton Eichstädt 6/5/2024 17:28" },
"instance" : {
"choicesRanking" : "Anton Eichstädt 5/24/2024 15:23",
"choicesRanking:" : "Anton Eichstädt 5/24/2024 15:24",
"containsVoteForChoice:" : "Anton Eichstädt 5/24/2024 15:23",
"id" : "JT 8/2/2022 16:59",
"id:" : "JT 8/2/2022 16:59",
"initialize" : "Anton Eichstädt 5/24/2024 15:24",
"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
Expand Up @@ -4,12 +4,12 @@
],
"classvars" : [
],
"commentStamp" : "bwe 8/5/2022 15:11",
"commentStamp" : "Anton Eichstädt 6/5/2024 17:29",
"instvars" : [
"id",
"questionId",
"votedChoiceList" ],
"name" : "LQChoicesAnswer",
"choicesRanking" ],
"name" : "LQAnswer",
"pools" : [
],
"super" : "Object",
Expand Down
4 changes: 0 additions & 4 deletions packages/Liquid-Core.package/LQChoicesAnswer.class/README.md

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
A specific type of LQQuestion for Single- and Multiple-Choice-Questions. A LQChoicesQuestion contains a number of choices as well as the maximum number of choices one participant can choose when answering the question.
A specific type of LQQuestion for Single- and Multiple-Choice-Questions. A LQMultiChoiceQuestion contains a number of choices as well as the maximum number of choices one participant can choose when answering the question.

Notable Instance Variables:
- choiceList: An OrderedCollection of Strings containing the Choices participants are presented.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
initialize-release
buildEmptyAnswer

^ LQChoicesAnswer new
^ LQAnswer new
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
type

^ 'multiChoice'
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"instance" : {
"addChoice:" : "bwe 6/5/2022 22:20",
"asString" : "JT 8/2/2022 17:01",
"buildEmptyAnswer" : "CG 7/30/2021 19:06",
"buildEmptyAnswer" : "Anton Eichstädt 6/5/2024 17:28",
"choiceDescriptions" : "kge 8/1/2022 18:51",
"choiceList" : "JT 8/2/2022 17:01",
"choiceList:" : "CG 7/30/2021 19:06",
Expand All @@ -17,4 +17,4 @@
"title" : "JT 8/2/2022 17:02",
"title:" : "JT 8/2/2022 17:02",
"toolTip" : "bn 5/12/2022 22:11",
"type" : "CG 7/30/2021 19:06" } }
"type" : "Anton Eichstädt 6/5/2024 17:37" } }
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"title",
"maxNumberOfChoices",
"choiceList" ],
"name" : "LQChoicesQuestion",
"name" : "LQMultiChoiceQuestion",
"pools" : [
],
"super" : "Object",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
A specific type of LQQuestion for Prioritisation-Questions. A LQPrioQuestion contains the choices the participant has to rank

Notable Instance Variables:
- choiceList: An OrderedCollection of Strings containing the Choices participants are presented.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
modifying
addChoice: aChoice

self choiceList add: aChoice.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
converting
asString

self title ifNil: [^ 'Untitled Question'].
^ self title
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
initialize-release
buildEmptyAnswer

^ LQAnswer new
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
choiceDescriptions

^ self choiceList collect: [:choice | choice description]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
choiceList: aListOfChoices

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

^ choiceList
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,7 @@
initialize-release
initialize

super initialize.
self id: UUID new asString.
self choiceList: OrderedCollection new.
self numberOfChoices: (self choiceList size).
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
isVotedChoice: votedChoice ValidFrom: aUser

^ self choiceList noneSatisfy: [:choice | (choice description = votedChoice) and: [choice excludesGroup: aUser group]]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
maxNumberOfChoices
^ self choiceList size
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
numberOfChoices: anObject
numberOfChoices := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
numberOfChoices
^ numberOfChoices
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
title: aString

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

^ title
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
toolTip

^ 'Give these options a ranking by clicking them in your favorite order! 1 should be the one you like most.'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
type

^ 'choices'
^ 'priority'
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"class" : {
},
"instance" : {
"addChoice:" : "Anton Eichstädt 6/5/2024 11:46",
"asString" : "JT 8/2/2022 17:01",
"buildEmptyAnswer" : "Anton Eichstädt 6/5/2024 17:40",
"choiceDescriptions" : "kge 8/1/2022 18:51",
"choiceList" : "JT 8/2/2022 17:01",
"choiceList:" : "Anton Eichstädt 6/5/2024 11:46",
"id" : "JT 8/2/2022 17:01",
"id:" : "JT 8/2/2022 17:01",
"initialize" : "Anton Eichstädt 6/4/2024 11:28",
"isVotedChoice:ValidFrom:" : "ms 8/4/2022 21:31",
"maxNumberOfChoices" : "Anton Eichstädt 6/5/2024 11:33",
"numberOfChoices" : "Anton Eichstädt 6/4/2024 11:21",
"numberOfChoices:" : "Anton Eichstädt 6/4/2024 11:21",
"title" : "JT 8/2/2022 17:02",
"title:" : "JT 8/2/2022 17:02",
"toolTip" : "Anton Eichstädt 5/24/2024 15:15",
"type" : "Anton Eichstädt 5/24/2024 15:11" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"category" : "Liquid-Core",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "Anton Eichstädt 5/24/2024 15:19",
"instvars" : [
"id",
"title",
"choiceList",
"numberOfChoices" ],
"name" : "LQPriorityQuestion",
"pools" : [
],
"super" : "Object",
"type" : "normal" }
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ isAnswer: answer From: aUser ValidFor: questionID In: aPoll
| question |

question := (aPoll questionList select: [:q | q id = questionID]) first.
^ answer votedChoiceList allSatisfy: [:votedChoice |
^ answer choicesRanking allSatisfy: [:votedChoice |
question isVotedChoice: votedChoice ValidFrom: aUser]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
testing
testToolTip

self testToolTipWith: LQChoicesQuestion new
self testToolTipWith: LQMultiChoiceQuestion new
Loading

0 comments on commit 6b60fd0

Please sign in to comment.