Web Service Implementation Details
Method-I
Brainmeasures provides an unique Numeric ID to all its client called ProviderID and a security code for authorized access to API.
ProviderID and SecurityCode will be used to identify and authorize client request.
BmApiUrl : BmApiUrl is a Brainmeasures API URL for clients every client is provided with separate URL to access Brainmeasures API services e.g. http://client.brainmeasures.com/testsi.asmx
SOAP
http://client.brainmeasures.com/testsi.asmx?soap
WSDL
http://client.brainmeasures.com/testsi.asmx?wsdl
Once client get its BmApiUrl, it can be consumed in any environments like .net, php etc.
Common API Methods :
1. To access All the Tests allotted :
Access All Tests(ProviderID) will give list of all Tests allotted to Client with their respective Test ID.
Here Test ID is numeric ID of the test and each test at Brainmeasures has unique Test ID
2. To get details of a particular Test :
Get Test By TestID (TestID)
e.g. GetTestByTestID(63) will give u detail of Test ID =63 if allotted to client
Such as no. Of Question, time allowed, pass percentage etc.
e.g.
No Of Questions=20
Pass Percentage=50
Test Duration=20 minutes
2. access Syllabus/Topics of a particular Test :
Get Topic By Test Id(Test ID)
e.g. Get Topic By Test Id(63) gives you list of topics in Test ID=63
2. To start a new Test:
This is the main method of Integration. You need to call this whenever you want to such as start a new test or restart a Test left in between incomplete.
Two steps are involved to start test.
STEP-1 Call this method
int Start_Remote_TestBM (
Int ProviderUserTestID, -> 0 for new test THIS UNIQUE IDENTIFY its usertestID at BM
string Ticket, -> Any Ref ID which can identify this UserTest uniquely at your End
string securityCode, -> Security Code provided to you always same
Int ProviderId, -> ProviderID provided to client, always same
int TestId, -> TestId of the test (ID from Brainmeasures Test List)
string returnURL, -> Full URL where you want to receive the result on completion of Test
DateTime ticketTimeStamp,-> DateTime when test string UserFName,
string UserLName, -> Name of user taking test may be just A or B etc
string email,-> email may be simply a@b.com
ref string strData->>>> This will return you a string
)
e.g. xx=StartTestNew(0,YourIDTicket, “SecurityCode", ProviderID, 63, "http://clientsite.com/yourresultpage.php","2013/09/13 10:50:25", "R", "T", "rajeev.awg@gmail.com", 0,0, strData)
Note: to restart any existing test which was left in between, use same method StartNewTestBm the only change is that 1st parameter ProviderUserTestID should have the value that was returned by Brainmeasures while test started first time. For new test it will always be 0.
The above method will return two things xx and strData:
1. xx: -> will give Unique ID of the test at brainmeasures.com. You must store this ID for any further integration or information with Brainmeasures.
2. strData: -> store it, this will be used in Step 2 of starting Test
STEP 2
The second step always requires 1st step to be completed and the stored value strData, then
You need to redirect the page to your sub-domain followed by strData
e.g. if your sub-domain is http://exam.clientsite.com then you need to redirect the page to
response.redirect(http://exam.clientsite.com/ + strData)
this will start your test with URL in browser as something like example below:
exam.clientsite.com/PrepareTest.aspx?ProviderUserTestID==3000123
Here user will continue giving test. When user finishes test, it will automatically redirect to the page
which you want as returnURL in above method e.g.
http://clientsite.com/yourresultpage.php?resutpass=1&TotalQuestions ....etc
You can retrieve the result at this page and save it at your end and show a completion Message etc.