-
Notifications
You must be signed in to change notification settings - Fork 1
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
7 changed files
with
117 additions
and
7 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
32 changes: 29 additions & 3 deletions
32
src/main/java/org/kryptojagd/level/tasks/MultipleChoiceTask.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 |
---|---|---|
@@ -1,14 +1,40 @@ | ||
package org.kryptojagd.level.tasks; | ||
|
||
import java.util.HashMap; | ||
import org.kryptojagd.level.Level; | ||
|
||
/** | ||
* The class describes a task, where you have to answer multiple choice questions | ||
* | ||
* @author Sonja | ||
*/ | ||
public class MultipleChoiceTask implements Task { | ||
|
||
public MultipleChoiceTask(HashMap<String,Object> input) { | ||
private String question; | ||
private String answer; | ||
private String[] possibilities; | ||
|
||
/** | ||
* Creates a {@link MultipleChoiceTask} | ||
* | ||
* @param question the question, which you have to answer | ||
* @param answer the right answer of the question | ||
* @param possibilities the possibilities to answer | ||
*/ | ||
public MultipleChoiceTask(String question, String answer, String[] possibilities) { | ||
this.question = question; | ||
this.answer = answer; | ||
this.possibilities = possibilities; | ||
} | ||
|
||
@Override | ||
public boolean proofAnswer(String answer) { | ||
return false; | ||
return this.answer.equals(answer); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
String multipleChoice = ""; | ||
return multipleChoice; | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.kryptojagd.level; | ||
|
||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
import org.kryptojagd.level.tasks.DecryptionTask; | ||
import org.kryptojagd.level.tasks.EncryptionTask; | ||
import org.kryptojagd.level.tasks.MultipleChoiceTask; | ||
import org.kryptojagd.verschluesselungsverfahren.Caesar; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
public class LevelTest { | ||
|
||
private DecryptionTask decryptionTask; | ||
private EncryptionTask encryptionTask; | ||
private MultipleChoiceTask multipleChoiceTask; | ||
|
||
@BeforeEach | ||
void setUp() { | ||
decryptionTask = new DecryptionTask(new Caesar()); | ||
encryptionTask = new EncryptionTask(new Caesar()); | ||
multipleChoiceTask = new MultipleChoiceTask(null, null, null); | ||
} | ||
|
||
} |