public class SSJsonReader
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
bestOption |
private java.lang.String |
choice |
private java.lang.String |
optionLetter |
private org.json.simple.JSONObject |
people |
private org.json.simple.JSONObject |
places |
private org.json.simple.JSONObject |
problemChoice |
private java.lang.String |
problemNumber |
private java.lang.String |
selectedOption1 |
private java.lang.String |
selectedOption2 |
private java.lang.String |
temp1SL2 |
private java.lang.String |
temp1SL3 |
private int |
temp3type |
private org.json.simple.JSONObject |
template1 |
private org.json.simple.JSONObject |
template2 |
private org.json.simple.JSONObject |
template3 |
private org.json.simple.JSONObject |
things |
private java.lang.String |
version |
Constructor and Description |
---|
SSJsonReader(int template)
Convenience constructor for initiating the StaySafe JSON reader for
Templates 1 and 3.
|
SSJsonReader(int template,
int temp3type)
Method call for initiating the JSON reader.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String[] |
getAffectedPersonsFacts()
Method for retrieving the affected person facts for the problem.
|
java.lang.String |
getAffectedPersonsTitle()
Method for retrieving the title for the affected person screen.
|
java.lang.String |
getBestOption()
Retrieves the best option as set with
setBestOption(String, String) . |
java.lang.String[][] |
getGame()
Method for retrieving the games question and answers for the current
problem choice.
|
java.lang.String[] |
getOptions()
Method for retrieving the options for the problem.
|
java.lang.String[] |
getOptionsFacts()
Method for retrieving the options factoids for the problem.
|
java.lang.String[] |
getPeopleProblemChoices()
A method for retrieving the problem themes in the people category
|
java.lang.String[] |
getPlacesProblemChoices()
A method for retrieving the problem themes in the places category
|
java.lang.String |
getProblemChoice()
Method for retrieving a String representing the current problem choice.
|
java.lang.String |
getProblemNumber()
Method for retrieving a String representing the current problem choice
number.
|
java.lang.String[] |
getSelectedOptions()
Retrieves the selected options for the session as set with
setOptions(String, String) . |
java.lang.String[] |
getSurvey()
Method for retrieving the survey question for the current problem choice.
|
java.lang.String |
getT1(int sildeNumber)
This method returns in the dynamic text description required for Template
1's introduction video screens that was read in when the class was
constructed.
|
java.lang.String[] |
getTemplate3Facts()
A method for retrieving the template 3 HIV facts.
|
java.lang.String |
getTheLetter()
Retrieves the corresponding letter to the best option as set with
setBestOption(String, String) . |
java.lang.String[] |
getThingsProblemChoices()
A method for retrieving the problem themes in the things category
|
java.lang.String |
getVersion()
Retrieves the version of curriculum in the JSON file
|
java.lang.String |
getVideoConsequences()
Method for retrieving the consequences related to the video for the
current problem selection
|
void |
setBestOption(java.lang.String bestOption,
java.lang.String optionLetter)
Saves the selected best option for the session from one of the two items
options from
getSelectedOptions() . |
void |
setOptions(java.lang.String option1,
java.lang.String option2)
Saves the selected options for the session.
|
void |
setProblemChoice(java.lang.String theme,
java.lang.String problemNumber)
After a theme selection has been made by the user, this method will
assure that future calls to this class reference the appropriate values
from the selected problem.
|
private java.lang.String bestOption
private java.lang.String choice
private java.lang.String optionLetter
private org.json.simple.JSONObject people
private org.json.simple.JSONObject places
private org.json.simple.JSONObject problemChoice
private java.lang.String problemNumber
private java.lang.String selectedOption1
private java.lang.String selectedOption2
private java.lang.String temp1SL2
private java.lang.String temp1SL3
private int temp3type
private org.json.simple.JSONObject template1
private org.json.simple.JSONObject template2
private org.json.simple.JSONObject template3
private org.json.simple.JSONObject things
private java.lang.String version
public SSJsonReader(int template)
template
- used for determining what template the application is
currently usingpublic SSJsonReader(int template, int temp3type)
template
- used for determining what template the application is
currently usingtemp3type
- indication of what session with template 3 is currently being
run through (4, 7, or 10)public java.lang.String[] getAffectedPersonsFacts()
public java.lang.String getAffectedPersonsTitle()
public java.lang.String getBestOption()
setBestOption(String, String)
. This action is performed without
file I/O.public java.lang.String[][] getGame()
public java.lang.String[] getOptions()
public java.lang.String[] getOptionsFacts()
public java.lang.String[] getPeopleProblemChoices()
public java.lang.String[] getPlacesProblemChoices()
public java.lang.String getProblemChoice()
public java.lang.String getProblemNumber()
public java.lang.String[] getSelectedOptions()
setOptions(String, String)
. This action is performed without
file I/O.public java.lang.String[] getSurvey()
public java.lang.String getT1(int sildeNumber)
sildeNumber
- indicates the screen for which the text will be returned,
either 2 or 3. The default value is 3.public java.lang.String[] getTemplate3Facts()
public java.lang.String getTheLetter()
setBestOption(String, String)
. This action is performed without
file I/O.public java.lang.String[] getThingsProblemChoices()
public java.lang.String getVersion()
public java.lang.String getVideoConsequences()
public void setBestOption(java.lang.String bestOption, java.lang.String optionLetter)
getSelectedOptions()
. This action is performed
without file I/ObestOption
- The best option the user has selected.optionLetter
- The letter corresponding to the option.public void setOptions(java.lang.String option1, java.lang.String option2)
option1
- The first option the user has selected as one of their top two
options.option2
- The second option the user has selected as one of their top
two options.public void setProblemChoice(java.lang.String theme, java.lang.String problemNumber)
theme
- Represents the category of the problem theme chosen. This
value must be "People", "Places", or "Things"problemNumber
- The problem number that was selected by the user.