Skip to content
Snippets Groups Projects
Commit 6cc42446 authored by Simon Barrett's avatar Simon Barrett
Browse files

Start TxtFile Reader. Come back to once to - do's completed

parent 10426551
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>
\ No newline at end of file
## Title
HTML - HyperText Markup Language
## Lesson Text
HyperText Markup Language (HTML) is the building block of the web. Invented in 1993 by Tim Berners-Lee it has gone through many iterations with the current being HTML5. This introduced semantic tags in order to help developers clearly define a pages content for browsers and screen readers. HTML is written using tags which general come in a pair: the opening tag <tag> and the closing tag </tag>, however sometimes the closing tag can be left out. Each type of tag defines how the browser will format and display the content. You can find a full list of tags here: https://www.w3schools.com/TAGS/default.ASP.
## Questions
# Question
What does HTML stand for?
# Answers
Help To Make Layout
Highly Typed Machine Language
HyperText Markup Language
Hey! That’s my Llama
# End Answers
# Correct Answer
3
# Question
Which of these tags doesn’t need a closing tag?
# Answers
<h1>
<body>
<form>
<img>
# End Answers
# Correct Answer
4
# Question
Where should the <!DOCTYPE html> tag go on the page?
# Answers
It’s should be the first item
At the start of the body element
It’s should be the last item
Anywhere you want
# End Answers
# Correct Answer
4
# Question
What tag do you normally use to link to another web page?
# Answers
<a>
<link>
<nav>
<li>
# End Answers
# Correct Answer
1
# Question
What is the correct way to declare a comment in HTML?
# Answers
// This is a comment
/* This is a comment*/
<! This is a comment ->
<!- -This is a comment - ->
# End Answers
# Correct Answer
4
No preview for this file type
File added
No preview for this file type
No preview for this file type
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
public class Testing {
public static void main(String[] args) {
Scanner s = null;
String title = "";
String lessonText = "";
String question = "";
ArrayList<String> answersArrayList = new ArrayList<>();
ArrayList<String> array = new ArrayList<>();
try {
s = new Scanner(new BufferedReader(new FileReader("lesson.txt")));
while (s.hasNext()){
array.add(s.nextLine());
}
} catch (IOException e) {
System.err.println(e.getMessage());
} finally {
s.close();
}
for(int i = 0; i < array.size(); i++) {
if(array.get(i).equals("## Title")) {
title = array.get(i + 1);
}
if(array.get(i).equals("## Lesson Text")) {
lessonText = array.get(i + 1);
}
if(array.get(i).equals("## Questions")) {
for(int j = i; j < array.size(); j++) {
if(array.get(j).equals("# Question")) {
question = array.get(j + 1);
System.out.println(question);
}
if(array.get(j).equals("# Answers")) {
int keepGoing = 1;
if(array.get(j + keepGoing).equals("# End Answers")) {
System.out.println("Here");
break;
} else {
answersArrayList.add(array.get(j + keepGoing));
keepGoing += 1;
}
}
}
}
}
};
}
//for(int j = i; j <= array.size() - i; j++) {
// if (array.get(j).equals("# Question")) {
// question = array.get(j + 1);
// }
// if (array.get(j).equals("# Answers")) {
// for(int k = j; k <= array.size() - j; k++) {
// if(array.get(k).equals("# End Answers")) {
// break;
// } else {
// answerArrayList.add(array.get(k));
// }
// }
// }
// if (array.get(j).equals("# Correct Answer")) {
// correctAnswer = array.get(j + 1);
// }
// String[] answerArray = new String[answerArrayList.size()];
// answerArray = answerArrayList.toArray(answerArray);
// Question questionToAdd = new Question(question, answerArray, 2);
// System.out.println(question);
// System.out.println(answerArray.toString());
// questionArrayList.add(questionToAdd);
// System.out.println(questionToAdd.askQuestion(3));
// }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment