function createNewActivityScore(activity_val, score_val)
{
	var userid_val ="ssalazar";
	// $("#user_id_div").html();
	var course_val = "curso1";
	//$("#course_id_div").html();
	var request = $.ajax({
		type: "GET",
		url: "http://puntuacionredes.formacionauladirecta.com/index.php",
		data:{
			r: "api",
			a: "create",
			userid: userid_val,
			course: course_val,
			category: "Activity",
			activity: activity_val,
			result: score_val
		},
	});
	request.done(function( msg ) {
	});
	request.fail(function( jqXHR, textStatus ) {
	});
}

function getActivityScore(callback_fun, activity_val){
	var userid_val = "ssalazar";
	//$("#user_id_div").html();
	var course_val = "curso1";
	//$("#course_id_div").html();
	var request = $.ajax({
		crossOrigin: true,
		type: "GET",
		dataType: "jsonp",
		url: "http://puntuacionredes.formacionauladirecta.com/index.php",
		data:{
			r: "api",
			a: "search",
			userid: userid_val,
			course: course_val,
			activity: activity_val,
			callback: callback_fun
		},
	});
	request.done(function( json ) {
	});
	request.fail(function( jqxhr, textStatus, error ) {
		callback("error");
	});
}

function getCourseScore(callback_fun){
	var userid_val = $("#user_id_div").html();
	var course_val = $("#course_id_div").html();
	var request = $.ajax({
		crossOrigin: true,
		type: "GET",
		dataType: "jsonp",
		url: "http://puntuacionredes.formacionauladirecta.com/index.php",
		data:{
			r: "api",
			a: "search",
			userid: userid_val,
			course: course_val,
			callback: callback_fun
		},
	});
	request.done(function( json ) {
	});
	request.fail(function( jqxhr, textStatus, error ) {
		callback("error");
	});
}

function getCourseScoreByCategory(callback_fun, category_val){
	var userid_val = $("#user_id_div").html();
	var course_val = $("#course_id_div").html();
	var request = $.ajax({
		crossOrigin: true,
		type: "GET",
		dataType: "jsonp",
		url: "http://puntuacionredes.formacionauladirecta.com/index.php",
		data:{
			r: "api",
			a: "search",
			userid: userid_val,
			course: course_val,
			category: category_val,
			callback: callback_fun
		},
	});
	request.done(function( json ) {
	});
	request.fail(function( jqxhr, textStatus, error ) {
		callback("error");
	});
}

function getCourseRanking(callback_fun, number_val){
	var course_val = $("#course_id_div").html();
	var request = $.ajax({
		crossOrigin: true,
		type: "GET",
		dataType: "jsonp",
		url: "http://puntuacionredes.formacionauladirecta.com/index.php",
		data:{
			r: "api",
			a: "ranking",
			course: course_val,
			number: number_val,
			callback: callback_fun
		},
	});
	request.done(function( json ) {
	});
	request.fail(function( jqxhr, textStatus, error ) {
		callback("error");
	});
}
