public void AddDebriefRecord(Content.Exercise <T> exercise, TimeSpan duration) { HttpGet <bool>(string.Format("lms/exercise/{0}/debrief/record", exercise.Guid), null, ErrorHandlerPrint, new Dictionary <string, string> { { "duration", ((uint)duration.TotalSeconds).ToString() }, }); }
public void AddDebriefRecord(Content.Exercise <T> exercise, TimeSpan duration, Action <long> result_callback = null) { HttpGet(string.Format("lms/exercise/{0}/debrief/record", exercise.Guid), result_callback, ErrorHandlerPrint, new Dictionary <string, string> { { "duration", ((uint)duration.TotalSeconds).ToString() }, }); }
public void RegisterExercise(Content.Exercise <T> exercise) { HttpGet <Exercise>(string.Format("lms/exercise/{0}/register", exercise.Guid), null, ErrorHandlerPrint, new Dictionary <string, string> { { "module", exercise.module.Guid.ToString() }, { "name", exercise.title }, { "level", ((int)(object)exercise.level).ToString() }, }); }
public void AddExerciseRecord(Content.Exercise <T> exercise, TimeSpan duration, bool success, float grade, uint nb_challenges_validated, byte[] debrief_data = null) { Dictionary <string, string> uri_parameters = new Dictionary <string, string> { { "duration", ((uint)duration.TotalSeconds).ToString() }, { "success", success.ToString() }, { "grade", string.Format(CultureInfo.InvariantCulture, "{0:N}", grade) }, { "nb_challenges_validated", nb_challenges_validated.ToString() }, }; Dictionary <string, string> post_parameters = null; if (debrief_data != null) { post_parameters = new Dictionary <string, string> { { "debrief_data", Convert.ToBase64String(debrief_data) }, }; } HttpPost <bool>(string.Format("lms/exercise/{0}/record", exercise.Guid), null, ErrorHandlerPrint, uri_parameters, post_parameters); }
public void GetExerciseSummary(Content.Exercise <T> exercise, Action <ExerciseSummary> result_callback) { HttpGet(string.Format("lms/exercise/{0}/summary", exercise.Guid), result_callback, ErrorHandlerExec(result_callback), null); }
public void GetExercise(Content.Exercise <T> exercise, Action <Exercise> result_callback) { exerciseGuidCache.Get(exercise, result_callback, (ex, c) => HttpGet(string.Format("lms/exercise/{0}", ex.Guid), c, ErrorHandlerPrintExec(c), null)); }