public class Survey
extends Fragment
Menu screen. When the user makes a selection/response, the
question the response was made from becomes grayed out and the response made
turns green indicating selection and the remaining responses are grayed out.
The user has the options to select different responses for the same question
by replacing the previous selection with a newer one by pressing a different
response than currently selected. Data collected here includes which
responses were selected, the timing to select it, and the time the user spent
on the screen.| Modifier and Type | Field and Description |
|---|---|
(package private) Activity |
activity
The instance of the current Activity
|
(package private) boolean |
blueBack
Values indicating to the Fragment what background image should be used.
|
(package private) SSCallback |
callback
The instance of the
SSCallback that allows this fragment to
communicate with the parent activity. |
private TextView[][] |
choices
All of the 35 possible responses the user can select for all 7 questions.
|
(package private) boolean |
purpleBack
Values indicating to the Fragment what background image should be used.
|
(package private) SSJsonReader |
reader
The instance of the
SSJsonReader class that reads in the dynamic
content for the application. |
private byte[] |
selection
Values that indicate what selection the user made for the question.
|
(package private) boolean |
temp1
boolean value indicating what template this fragment is currently apart
of.
|
(package private) boolean |
temp2
boolean value indicating what template this fragment is currently apart
of.
|
private int[] |
time
The values of the time it took the user to answer the survey question.
|
(package private) SSTimer |
timer
The instance of the
SSTimer used for retrieving timing values for
this Fragment. |
(package private) MediaPlayer |
voMediaPlayer
The instance of voice over MediaPlayer
|
| Constructor and Description |
|---|
Survey(SSJsonReader reader,
int run)
The constructor saves what template type this Fragment is a part of and
copies the instance of the
SSJsonReader into memory. |
| Modifier and Type | Method and Description |
|---|---|
void |
onAttach(Activity activity)
This class uses the onAttach method of the android life cycle to save an
instance of the activity and to implement the interface between the main
activity and this fragment activity
|
void |
onClick(View v)
This method is called when the user selects a response.
|
View |
onCreateView(LayoutInflater inflater,
ViewGroup container,
Bundle savedInstanceState)
This method is called by the system to inflate the layout for the Survey
screen.
|
void |
onDestroy()
All data is saved within this method and memory with the
voMediaPlayer is released. |
boolean |
onLongClick(View v)
Provides a similar
ExitUtility to the user but redirects the
administrative user to save the data as if the user had finished the
session entirely |
private void |
updateGUI(int question,
View v)
Method called by
onClick(View). |
Activity activity
boolean blueBack
SSCallback callback
SSCallback that allows this fragment to
communicate with the parent activity.private TextView[][] choices
boolean purpleBack
SSJsonReader reader
SSJsonReader class that reads in the dynamic
content for the application.private byte[] selection
boolean temp1
boolean temp2
private int[] time
SSTimer timer
SSTimer used for retrieving timing values for
this Fragment.MediaPlayer voMediaPlayer
public Survey(SSJsonReader reader, int run)
SSJsonReader into memory.reader - The instance of the SSJsonReaderrun - The integer representation of the corresponding session the
Fragment is a part of.public void onAttach(Activity activity)
public void onClick(View v)
choices (corresponding to the parent View) to the
updateGUI(int, View) method as well as the initiating view.public View onCreateView(LayoutInflater inflater,
ViewGroup container,
Bundle savedInstanceState)
public void onDestroy()
voMediaPlayer is released.public boolean onLongClick(View v)
ExitUtility to the user but redirects the
administrative user to save the data as if the user had finished the
session entirelyprivate void updateGUI(int question,
View v)
onClick(View). This method determines what view
was pressed and records the selection and time values
accordingly. Furthermore, this method provides appropriate visual cues to
the user indicating that a response has been selected.question - The question number the response was made tov - The View object that was passed to the onClick(View)
method