Web Service Method List

{"action":"getLogs","key":"required","params":"none","returns":"json","return_format":"array","description":"Returns the current log array."}
{"action":"getLastLog","key":"required","params":"none","returns":"json","return_format":"string","description":"Returns the last log string."}
{"action":"getLastError","key":"required","params":"none","returns":"json","return_format":"string","description":"Returns the last error message string."}
{"action":"getErrors","key":"required","params":"none","returns":"json","return_format":"array","description":"Returns the current errors array."}
{"action":"logJsError","key":"not required","params":"none","returns":"json","return_format":"string","description":"Logs a js error message to the server error logs."}
{"action":"getDistinctActivityIdsByActivityIds","key":"required","params":"ids[]","returns":"json","return_format":"array","description":"Given an array of activty ids from LMS, return an array of unique activity ids from InqITS evaluation logs table."}
{"action":"getDistinctEvaluationLogDataByActivityIds","key":"required","params":"ids[]","returns":"json","return_format":"multi-array","description":"Given an array of activity ids from LMS, return a multi-dimensional array from InqITS evaluation logs table, contains 'assignments', 'problems', 'users'."}
{"action":"clearLogs","key":"required","params":"none","returns":"json","return_format":"string","description":"Clears the logs array."}
{"action":"clearErrors","key":"required","params":"none","returns":"json","return_format":"string","description":"Clears the errors array."}
{"action":"getEvaluationLogsByActivityId","key":"required","params":"id","returns":"json","return_format":"string","description":"Given an activity id, returns all InqITS evaluation log data for that id."}
{"action":"getEvaluationLogsByActivityIds","key":"required","params":"ids[]","returns":"json","return_format":"string","description":"Given an array of activity ids, returns all InqITS evaluation log data for those ids."}
{"action":"getProblemLogsByActivityIdsStepIds","key":"required","params":"ids[]","returns":"json","return_format":"multi-array","description":"Given an array of activity ids, returns all InqITS problem log data for those ids. Currently uses hardcoded step ids."}
{"action":"getAssigDatesByUserIdsStepIds","key":"required","params":"ids[], assig","returns":"json","return_format":"multi-array","description":"Given an array of user ids, from LMS, returns assignment dates for problems associated with those ids. The assig[] argument should be an array of assignment ids mapped to problem ids. Currently uses hardcoded step ids."}
{"action":"getProblemLogsByUserIdsStepIds","key":"required","params":"ids[], assig, pids[]","returns":"json","return_format":"multi-array","description":"Given an array of user ids, from LMS, returns all InqITS problem log data for those ids. The assig[] argument should be an array of assignment ids mapped to problem ids. Currently uses hardcoded step ids."}
{"action":"getProblemStageInfo","key":"required","params":"ids[], assig, pids[]","returns":"json","return_format":"multi-array","description":"Given an array of user ids, from LMS, return problem stage information strings stored upon a student starting an activity. The assig[] argument should be an array of assignment ids mapped to problem ids."}
{"action":"getReportDataByEvaluationKeys","key":"required","params":"ids[], assig, pids[]","returns":"json","return_format":"multi-array","description":"Given an array of user ids, from LMS, return activity data strings tied to actionkeys from evaluation data. The assig[] argument should be an array of assignment ids mapped to problem ids."}
{"action":"getDistinctEvaluationLogDataByUserIds","key":"required","params":"ids[], assig[]","returns":"json","return_format":"multi-array","description":"Given an array of user ids from LMS, return a multi-dimensional array from InqITS evaluation logs table, contains 'assignments', 'problems', 'users'. The assig[] argument should be an array of assignment ids mapped to problem ids."}
{"action":"getEvaluationLogsByUserIds","key":"required","params":"ids[], pids[]","returns":"json","return_format":"string","description":"Given an array of user ids, returns all InqITS evaluation log data for those ids."}
{"action":"getLatestActivityByAssigIds","key":"required","params":"assig","returns":"json","return_format":"multi-array","description":"Latest activity data for given assignments based on problem ids."}
{"action":"setOrphanLogs","key":"required","params":"brokenaction, userid, activityid, problemid","returns":"json","return_format":"string","description":"Orphans eval and problem logs for the given criteria. All logs greater than or equal to the broken action key will be orphaned."}
{"action":"getBlotterAccessesCounts","key":"required","params":"teacherids[], servertime string_timestamp_YYYY-MM-DD","returns":"json","return_format":"multi-array","description":"User IDs and counts for number of times blotter accessed since servertime. If no servertime given, all accesses are counted."}
{"action":"logAudioBundle","key":"required","params":"audio_log_sets_id, clienttime, bundle_id, bundle_size, bundle_data","returns":"json","return_format":"string","description":"Logs an array of audio data with the given audio log set id."}
{"action":"logAudioSet","key":"required","params":"userid_teacher, userid_student, activityid, mwid, mwname, engagement_reason, problemid, labid, clienttime","returns":"json","return_format":"string","description":"Logs an audio set entry for storage of associated audio bundles."}
{"action":"getAudioSetsByTeacherId","key":"required","params":"userid_teacher","returns":"json","return_format":"array","description":"Returns a list of audio sets associated with the given teacher id."}
{"action":"getAudioDataBySetId","key":"required","params":"audio_log_sets_id","returns":"json","return_format":"array","description":"Returns an array of mono audio data for the given audio set id."}
{"action":"getAudioBundlesBySetId","key":"required","params":"audio_log_sets_id","returns":"json","return_format":"array","description":"Returns an array of mono audio data bundles for the given audio set id."}
{"action":"getAudioBundlesDataById","key":"required","params":"audio_log_bundles_id","returns":"json","return_format":"array","description":"Returns an array of mono audio data for the given audio bundle id."}
{"action":"getAudioBundlesTranscriptionByBundleId","key":"required","params":"audio_log_bundles_id","returns":"json","return_format":"array","description":"Returns the transcription text for the given audio bundle id."}
{"action":"setAudioBundlesTranscriptionByBundleId","key":"required","params":"audio_log_bundles_id, text_trans","returns":"json","return_format":"json","description":"Sets the transcription text for the given audio log bundles id."}
{"action":"setSessionKey","key":"required","params":"skey, sval","returns":"json","return_format":"array","description":"Adds a session key into the server side session."}
{"action":"setCookieKey","key":"required","params":"skey, sval","returns":"json","return_format":"array","description":"Adds a cookie key into the server side session."}
{"action":"getReportsDemoJson","key":"required","params":"none","returns":"json","return_format":"array","description":"Returns user demo data for reports demo."}
{"action":"logBlotterAccess","key":"required","params":"user_id_teacher","returns":"json","return_format":"string","description":"Logs when a teacher has accessed blotter. Called by blottersvc."}
{"action":"logBlotterAction","key":"required","params":"log_token, action_id, blotter_action_type_id, value, user_id_teacher, clienttime","returns":"json","return_format":"string","description":"Logs a teacher blotter action and returns the rows effected or false if there was a failure."}
{"action":"logBlotterAlert","key":"required","params":"log_token, alert_id, activity_id, problem_id, skill, blotter_alert_type_id, rule_id, user_id_student, user_id_teacher, clienttime","returns":"json","return_format":"string","description":"Logs a teacher blotter alert and returns the rows effected or false if there was a failure."}
{"action":"getBlotterSessionTokenByUserId","key":"required","params":"user_id, meta_data, clienttime","returns":"json","return_format":"string","description":"Creates, stores and returns a new token if none exists, returns an existing valid token if one exists, or creates, stores and returns a new token if the existing token has expired."}
{"action":"getBlotterAlertLogTypes","key":"required","params":"none","returns":"json","return_format":"array","description":"Returns all the blotter alert log types."}
{"action":"getBlotterActionLogTypes","key":"required","params":"none","returns":"json","return_format":"array","description":"Returns all the blotter action log types."}
{"action":"getLastBlotterAlertIdByLogTokenUserId","key":"required","params":"log_token, user_id_teacher","returns":"json","return_format":"string","description":"Returns the last alert_id for a given teacher session if any or 0 if none."}
{"action":"getLastBlotterActionIdByLogTokenUserId","key":"required","params":"log_token, user_id_teacher","returns":"json","return_format":"string","description":"Returns the last action_id for a given teacher session if any or 0 if none."}
{"action":"getBlotterAlertLogsByUserIdDateRange","key":"required","params":"userid_teacher, start_date, stop_date","returns":"json","return_format":"array","description":"Returns an array of blotter event log data for the given userid_teacher and client timestamp date range."}
{"action":"getBlotterActionLogsByUserIdDateRange","key":"required","params":"userid_teacher, start_date, stop_date","returns":"json","return_format":"array","description":"Returns an array of blotter action log data for the given userid_teacher and client timestamp date range."}
{"action":"processBlotterLogArray","key":"required","params":"an array of valid blotter logs","returns":"json","return_format":"array","description":"Processes an array of blotter logs and returns a true or false indicator for each entry."}
{"action":"blotterLogBatch","key":"required","params":"an array of valid blotter logs","returns":"json","return_format":"array","description":"Processes an array of blotter logs, batching them up and shipping them and returns a true or false indicator for the query."}
{"action":"getProblemLogsAndEvaluationLogsAfterServerTime","key":"required","params":"servertime","returns":"json","return_format":"string","description":"Given server time, returns all InqITS problem and evaluation log data from that time forward."}
{"action":"getProblemLogsAndEvaluationLogsAfterId","key":"required","params":"problem_logs_id_column, evaluation_logs_id_column","returns":"json","return_format":"string","description":"Given a problem log id and evaluation log id, returns all InqITS problem and evaluation log data after those ids."}
{"action":"scoreText","key":"required","params":"text, mwid, type","returns":"json","return_format":"string","description":"Processes claim text for a given microworld and returns a score for that text."}
{"action":"processScoreTextArray","key":"required","params":"an array of valid score text requests","returns":"json","return_format":"array","description":"Processes an array of blotter logs and returns a true or false indicator for each entry."}
{"action":"runPreMwlogbatchTest","key":"required","params":"none","returns":"boolean","return_format":"string","description":"Prep for mwlogbatch load test."}
{"action":"runPostMwlogbatchTest","key":"required","params":"none","returns":"boolean","return_format":"string","description":"Cleanup for mwlogbatch load test."}
{"action":"runPreGetactivityTest","key":"required","params":"none","returns":"boolean","return_format":"string","description":"Prep for getactivity load test."}
{"action":"runPostGetactivityTest","key":"required","params":"none","returns":"boolean","return_format":"string","description":"Cleanup for getactivity load test."}
{"action":"runPreAssetAccessTest","key":"required","params":"none","returns":"boolean","return_format":"string","description":"Prep for asset access load test."}
{"action":"runPostAssetAccessTest","key":"required","params":"none","returns":"boolean","return_format":"string","description":"Cleanup for asset access load test."}

Sample jQuery AJAX GET/POST Code

function testRpcCall() {
	$.ajax({
		type: 'GET', //Or POST, use post for larger amounts of data
		url: urlRoot + 'rpcwebmethods.php', //URL root should be a relative or absolute root to the web service page.
		data: 'data=' + JSON.stringify({
			'action' : public_method_to_call,
			'key' : secure_key_to_unlock_access,
			'params' : json_object_of_param_data
		}),
		dataType: 'json',
		success:
			function (msg) {
				console.log(JSON.stringify(msg));
			},
		error:
			function (obj, status, msg) {
				console.log(JSON.stringify(msg));
			}
	});
};

Sample PHP POST Code

$json_data = json_encode(array(
        'action' => 'clearLogs',	//public method to call
        'key' => $sKey			//secret key
));

$data = http_build_query(array(
        'data' => $json_data
));

//POST
$post = file_get_contents($urlRoot.'rpcwebmethods.php', false, stream_context_create(array(
        'http' => array(
        'method'           => 'POST',
        'header'           => 'Content-type: application/x-www-form-urlencoded\r\n'.
                              'Connection: close\r\n'.
                              'Content-length: '.strlen($data).'\r\n',
        'content'          => $data
        )
)));

if($post) {
   echo $post;
}else {
   echo 'POST failed';
}

Sample PHP GET Code

$json_data = json_encode(array(
        'action' => 'clearLogs',        //public method to call
        'key' => $sKey                 //secret key
));

$post = file_get_contents($urlRoot.'rpcwebmethods.php?data='.$json_data);

if($post) {
   echo $post;
}else {
   echo 'POST failed';
}