Beispiel #1
0
 // *WeightTypeAnswerStructArray:
 public WeightTypeAnswerStruct[] getWeightTypeAnswerStructArray() {
   JSONArray weightTypeAnswerStructJSONArray =
       super.optJSONArray(TeacherAnswersJSONKeys.WEIGHT_TYPE_ANSWER_STRUCT_ARRAY.getKey());
   WeightTypeAnswerStruct[] weightTypeAnswerStructArray =
       new WeightTypeAnswerStruct[weightTypeAnswerStructJSONArray.length()];
   for (int i = 0; i < weightTypeAnswerStructJSONArray.length(); i++) {
     try {
       weightTypeAnswerStructArray[i] =
           new WeightTypeAnswerStruct(weightTypeAnswerStructJSONArray.getJSONObject(i).toString());
     } catch (JSONException e) {
       e.printStackTrace();
     }
   }
   return weightTypeAnswerStructArray;
 }
Beispiel #2
0
 public void setWeightTypeAnswerStructArray(WeightTypeAnswerStruct[] weightTypeAnswerStructArray)
     throws JSONException {
   super.putOpt(
       TeacherAnswersJSONKeys.WEIGHT_TYPE_ANSWER_STRUCT_ARRAY.getKey(),
       new JSONArray(weightTypeAnswerStructArray));
 }