Test Harness for XLPrep for iphone

authenticate.jsp:


params:
username
password

return:
status: check login[0 => invalid uname; status:1 => valid uname, invalid password; status:2 logged in]
example: proper login is u: tstr1, p: tstr1



startNow.jsp:


params:
subject
amid

return:
status: check new account[0 => new amid; status:1 => exists but was but not logged in; status:2 exists and logged in]
subject_selected_id: current selected subject id
uid: current user id
session_id: session id
amid: current amid



logout.jsp:


params:
none

return:
status: check whether logged out[0 => logged out]



list_subjects.jsp:


params:
none

return:
aSubjects:array of subject names; aSubjectsOn: 0 for not active (don't display), 1 for active



demo.jsp:


params:
subject_id (from list_subjects)


return:
session_id: valid session_id for current user

note:
Demo.jsp will automatically create a new active session (unless a valid session was already created and active)




list_topics.jsp:


params:
session_id

return:
status: validity of session id [0: invalid; 1: valid]
subject_selected_id: current selected subject id
other_subjects: name(s) of other available subjects
other_subject_ids: id(s) of other available subjects
subject_selected: name of currently selected subject
topic_selected_id: current selected topic id
topic_list: list of current topics to choose from

note:
topic_list, subject_selected, other_subjects are encoded. They will need to be decoded in order to render properly



set_subject.jsp:


params:
session_id
subject_id (note: make sure subject id is available)

return:
status: validity of session [0; invalid; 1: valid]
subject_valid: validity of subject [0:invalid subject => no change made, 1: valid => subject updated]

note:
remember to get new list_topics after changing subject




set_topic.jsp:


params:
session_id
topic_id (note: make sure topic id is available)

return:
status: validity of session [0; invalid; 1: valid]
topic_valid: validity of topic [0:invalid topic => no change made, 1: valid => topic updated]

note:
remember to get new list_topics after changing topic




question.jsp:


params:
session_id

return:
status: validity of session [0; invalid; 1: valid]
question: actual question
question_choices: array of question choices (either 4 or 5 possible choices)
hints: array of possible hints (sometimes no hints, otherwise, anywhere from 1 to 4 possible hints)

note:
question, question_choices and hints are encoded and will need to be decoded to be render properly



answer.jsp:


params:
session_id
answer_choice: entered choice [(A) is 1; (B) is 2...]

return:
status: validity of session [0: invalid; 1: valid]
answer_status: validity of question-answer [0: invalid; 1: valid]
answer: full answer explanation
answer_short: shortened answer explanation
answer_id: proper answer choice [(A) is 1; (B) is 2...]
question_choices: array of question choices (either 4 or 5 possible choices)
note:
answer, answer_short and question_choices are encoded and will need to be decoded to be render properly





API Notes:

Need to open a valid session in order to perform most web service calls.
2 ways to open a session:
1) authenticate properly, or
2) demo.jsp will create a demo account

In both cases, these will provide a session_id which will need to be passed as a param to the other web services. Should the session_id not be valid, the web services will return a status of '0' which will prevent the web service from performing is intended function.

Answer will require that a question first be asked, otherwise it will return a answer_status of '0'.

Hierarchy of question navigation is:
Subjects (ie Algebra I, CAHSEE, SAT, GMAT...) is the top level. Each subject once picked will have several topics (see list_topics) which then associate with 1 or several questions.

Shown above is the XLPrep.com web services JSON API. The page provides basics related to the input params, and anticipated return values. For each, there is an example that can be run to preview functioning web service calls. Hoping it is bug free though I suspect there may be issues. Please contact (info@xlprep.com) should you encounter any problems. Should you have any questions, please don't hesitate to let us know. We will gladly create new web service calls: let us know what new web service entries should be made along with their expected functionality and we will gladly oblige. The API will probably evolve over time: the calls provided provide an initial baseline.

For starters, it would be good the API provides basic finctionality to allow for:
1) home page => should show login screen, and ability to go into demo mode by clicking on one of the subjects (list_subject.jsp).
- allow for either a demo page launch: user selects one of the subjects and demo.jsp will open a new session, or
- allow for login via home page (authenticate.jsp).

2) Upon opening session, show a page with a question, including timer and list of topics (list_topics.jsp). The topic list will show the topics which are a subset of each subject. The list_topics page will also show other subjects associated with the subject under review. For instance, if one selected CAHSEE_Math, the list_topics.jsp call will also provide CAHSEE_Verbal as an other potential subject. Should the user select an alternate subject from the nav topic drop down, the set_subject.jsp call will shift the list_topics.jsp list of topics to a list that reflects the topic list related to the newly chosen subject. This page should also show a question.jsp as the main focus. The question.jsp will provide info to render the actual question, as well as the potential choices (either 4 or 5 choices).

3) Upon selecting a question choice, this act of answering the question should call the answer.jsp, passing on the user selected choice. answer.jsp will provide information relating back whether or not the chosen answer was correct, and will also provide details on what the proper answer is.

4) A logout (logout.jsp) link or button should also be available to allow an open session to be closed, and send the user back to the home page.


List Latest API Calls
http://www.xlprep.com/iphone/lastAPICalls.jsp