Beispiel #1
0
 public Exercise getExercise(int id) throws IOException, JSONException {
   JSONObject json = restclient.getJson(String.format("getExercise?id=%d", id));
   Exercise exercise = new Exercise();
   exercise.setWording(json.getString("wording"));
   exercise.setId(json.getInt("id"));
   return exercise;
 }
Beispiel #2
0
 public Status getStatus(String dni) throws IOException, JSONException {
   JSONObject json = restclient.getJson(String.format("getStatus?dni=%s", dni));
   Status user =
       new Status(
           json.getInt("id"),
           json.getString("user"),
           json.getInt("lessonNumber"),
           json.getString("lessonTitle"),
           json.getInt("nextTest"),
           json.getInt("nextExercise"));
   return user;
 }
Beispiel #3
0
 public Data(String user, String passwd) {
   restclient = new RestClient(urlBase);
   restclient.setHttpBasicAuth(user, passwd);
 }