-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
213 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...com/generalbytes/batm/server/extensions/customfields/value/LocalDateCustomFieldValue.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.generalbytes.batm.server.extensions.customfields.value; | ||
|
||
import com.generalbytes.batm.server.extensions.customfields.CustomFieldDefinitionType; | ||
|
||
import java.time.LocalDate; | ||
|
||
/** | ||
* used with {@link CustomFieldDefinitionType#DATE} | ||
*/ | ||
public class LocalDateCustomFieldValue implements CustomFieldValue { | ||
private final LocalDate localDateValue; | ||
|
||
public LocalDateCustomFieldValue(LocalDate localDateValue) { | ||
this.localDateValue = localDateValue; | ||
} | ||
|
||
public LocalDate getLocalDateValue() { | ||
return localDateValue; | ||
} | ||
} |
86 changes: 86 additions & 0 deletions
86
...nsions_api/src/main/java/com/generalbytes/batm/server/extensions/quiz/QuestionAnswer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/************************************************************************************* | ||
* Copyright (C) 2014-2023 GENERAL BYTES s.r.o. All rights reserved. | ||
* | ||
* This software may be distributed and modified under the terms of the GNU | ||
* General Public License version 2 (GPL2) as published by the Free Software | ||
* Foundation and appearing in the file GPL2.TXT included in the packaging of | ||
* this file. Please note that GPL2 Section 2[b] requires that all works based | ||
* on this software must also be made publicly available under the terms of | ||
* the GPL2 ("Copyleft"). | ||
* | ||
* Contact information | ||
* ------------------- | ||
* | ||
* GENERAL BYTES s.r.o. | ||
* Web : http://www.generalbytes.com | ||
* | ||
************************************************************************************/ | ||
package com.generalbytes.batm.server.extensions.quiz; | ||
|
||
import com.generalbytes.batm.server.extensions.customfields.CustomFieldDefinition; | ||
import com.generalbytes.batm.server.extensions.customfields.CustomFieldDefinitionType; | ||
|
||
/** | ||
* An object representing the question and answer data in the {@link QuizResult}. | ||
*/ | ||
public class QuestionAnswer { | ||
|
||
/** | ||
* ID of {@link CustomFieldDefinition} representing a question. | ||
* May be null if the Custom Field has been deleted on the server. | ||
*/ | ||
private Long customFieldDefinitionId; | ||
|
||
private String question; | ||
|
||
/** | ||
* ID of {@link CustomFieldDefinition.Element} representing an answer for a type {@link CustomFieldDefinitionType#DROPDOWN} and {@link CustomFieldDefinitionType#RADIO_BTN}. | ||
* May be null if it is not one of the above types or if the Custom Field Element has been deleted on the server. | ||
*/ | ||
private Long customFieldElementId; | ||
|
||
private String answer; | ||
|
||
public QuestionAnswer() { | ||
|
||
} | ||
|
||
public QuestionAnswer(Long customFieldDefinitionId, String question, Long customFieldElementId, String answer) { | ||
this.customFieldDefinitionId = customFieldDefinitionId; | ||
this.question = question; | ||
this.customFieldElementId = customFieldElementId; | ||
this.answer = answer; | ||
} | ||
|
||
public Long getCustomFieldDefinitionId() { | ||
return customFieldDefinitionId; | ||
} | ||
|
||
public void setCustomFieldDefinitionId(Long customFieldDefinitionId) { | ||
this.customFieldDefinitionId = customFieldDefinitionId; | ||
} | ||
|
||
public String getQuestion() { | ||
return question; | ||
} | ||
|
||
public void setQuestion(String question) { | ||
this.question = question; | ||
} | ||
|
||
public Long getCustomFieldElementId() { | ||
return customFieldElementId; | ||
} | ||
|
||
public void setCustomFieldElementId(Long customFieldElementId) { | ||
this.customFieldElementId = customFieldElementId; | ||
} | ||
|
||
public String getAnswer() { | ||
return answer; | ||
} | ||
|
||
public void setAnswer(String answer) { | ||
this.answer = answer; | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
...extensions_api/src/main/java/com/generalbytes/batm/server/extensions/quiz/QuizResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/************************************************************************************* | ||
* Copyright (C) 2014-2023 GENERAL BYTES s.r.o. All rights reserved. | ||
* | ||
* This software may be distributed and modified under the terms of the GNU | ||
* General Public License version 2 (GPL2) as published by the Free Software | ||
* Foundation and appearing in the file GPL2.TXT included in the packaging of | ||
* this file. Please note that GPL2 Section 2[b] requires that all works based | ||
* on this software must also be made publicly available under the terms of | ||
* the GPL2 ("Copyleft"). | ||
* | ||
* Contact information | ||
* ------------------- | ||
* | ||
* GENERAL BYTES s.r.o. | ||
* Web : http://www.generalbytes.com | ||
* | ||
************************************************************************************/ | ||
package com.generalbytes.batm.server.extensions.quiz; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* An object representing data about quiz result. | ||
*/ | ||
public class QuizResult { | ||
|
||
private String quizName; | ||
|
||
private List<QuestionAnswer> answers; | ||
|
||
public QuizResult() { | ||
|
||
} | ||
|
||
public QuizResult(String quizName, List<QuestionAnswer> answers) { | ||
this.quizName = quizName; | ||
this.answers = answers; | ||
} | ||
|
||
public String getQuizName() { | ||
return quizName; | ||
} | ||
|
||
public void setQuizName(String quizName) { | ||
this.quizName = quizName; | ||
} | ||
|
||
public List<QuestionAnswer> getAnswers() { | ||
return answers; | ||
} | ||
|
||
public void setAnswers(List<QuestionAnswer> answers) { | ||
this.answers = answers; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters