Skip to content
This repository has been archived by the owner on Jun 12, 2019. It is now read-only.

Commit

Permalink
Merge pull request #57 from 6167656e74323431/larry
Browse files Browse the repository at this point in the history
Prettify quizzer
  • Loading branch information
6167656e74323431 authored Jun 10, 2019
2 parents 2fbe73c + 0492385 commit b0f5b9e
Showing 1 changed file with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
import com.badlogic.gdx.utils.Align;
import com.kotcrab.vis.ui.widget.VisLabel;
import com.kotcrab.vis.ui.widget.VisTextButton;
import com.kotcrab.vis.ui.widget.VisTextField;
import com.kotcrab.vis.ui.widget.*;
import ml.educationallydesigned.thyme.core.levels.GameLevel;
import ml.educationallydesigned.thyme.util.task.Task;
import ml.educationallydesigned.thyme.util.*;
Expand Down Expand Up @@ -59,17 +57,25 @@ public TextEditorWindow(Task currentTask, GameLevel level) {
this.currentTask = currentTask;
this.level = level;

setWidth(500);
setHeight(500);
setWidth(600);
setHeight(250 + currentTask.getQuestions().length * 70);
align(Align.top);

VisTable table = new VisTable();
table.setWidth(getWidth());
table.setHeight(getHeight());

answerBoxes = new ArrayList<VisTextField>();

for (String question : currentTask.getQuestions()) {
VisTextField field = new VisTextField();
field.setAlignment(Align.center);
add(new VisLabel(question)).padBottom(20).row();
add(field).padBottom(20).width(200).row();
field.setWidth(300);
VisLabel questionLabel = new VisLabel(question);
questionLabel.setWrap(true);
questionLabel.setAlignment(Align.center);
table.add(questionLabel).width(500).padBottom(20).row();
table.add(field).padBottom(20).width(300).row();
answerBoxes.add(field);
}

Expand All @@ -84,7 +90,9 @@ public void clicked(InputEvent event, float x, float y) {
});

centerOnDesktop();
add(submitButton).row();
table.add(submitButton).row();
VisScrollPane scrollPane = new VisScrollPane(table);
add(scrollPane);
}

/**
Expand Down

0 comments on commit b0f5b9e

Please sign in to comment.