Commit 90224e26a4c82b0c2aa8cbb3ef5081a1ab34ffe5
1 parent
f60bd9dc2b
Exists in
master
参数补充
Showing
3 changed files
with
31 additions
and
0 deletions
Show diff stats
app/src/main/java/com/hjx/parent/HomeworkFeedbackActivity.java
... | ... | @@ -21,6 +21,7 @@ import com.hjx.parent.rx.BaseRxActivity; |
21 | 21 | import com.prws.common.bean.Student; |
22 | 22 | import com.prws.common.bean.homework.Correction; |
23 | 23 | import com.prws.common.bean.homework.CorrectionPoint; |
24 | +import com.prws.common.bean.homework.CorrectionSer; | |
24 | 25 | import com.prws.common.bean.homework.HomeWork; |
25 | 26 | import com.prws.common.bean.homework.HomeworkList; |
26 | 27 | import com.prws.common.bean.homework.KeyValue; |
... | ... | @@ -97,6 +98,7 @@ public class HomeworkFeedbackActivity extends BaseRxActivity<ActivityHomeworkFee |
97 | 98 | body.put("stuId", student.stuId); |
98 | 99 | body.put("points", countPoint()); |
99 | 100 | body.put("correctionList", corrections); |
101 | + body.put("extra", buildExtra()); | |
100 | 102 | NetWorks.service_url.uploadHomeworkFeedback(NetWorks.getHeader(), body) |
101 | 103 | .compose(transformSingle()) |
102 | 104 | .subscribe((response, th) -> { |
... | ... | @@ -121,6 +123,16 @@ public class HomeworkFeedbackActivity extends BaseRxActivity<ActivityHomeworkFee |
121 | 123 | }); |
122 | 124 | } |
123 | 125 | |
126 | + private String buildExtra() { | |
127 | + if (mList == null || mList.isEmpty()) return null; | |
128 | + List<CorrectionSer> maps = new ArrayList<>(); | |
129 | + for (HomeWork item: mList) { | |
130 | + maps.add(item.toSer()); | |
131 | + } | |
132 | + Gson gson = new Gson(); | |
133 | + return gson.toJson(maps); | |
134 | + } | |
135 | + | |
124 | 136 | @SuppressLint("CheckResult") |
125 | 137 | private List<CorrectionPoint> countPoint() { |
126 | 138 | Set<KeyValue> set = new HashSet<>(); | ... | ... |
libs/common/src/main/java/com/prws/common/bean/homework/CorrectionSer.java
... | ... | @@ -0,0 +1,16 @@ |
1 | +package com.prws.common.bean.homework; | |
2 | + | |
3 | +public class CorrectionSer { | |
4 | + public String brief; | |
5 | + public int correction; // 0 对, 1 错 | |
6 | + public int state; // 1: 已听懂; 2: 基本听懂; 3: 一般听懂 | |
7 | + | |
8 | + public CorrectionSer() { | |
9 | + } | |
10 | + | |
11 | + public CorrectionSer(String brief, int correction, int state) { | |
12 | + this.brief = brief; | |
13 | + this.correction = correction; | |
14 | + this.state = state; | |
15 | + } | |
16 | +} | ... | ... |
libs/common/src/main/java/com/prws/common/bean/homework/HomeWork.java