Commit 07abc9da6376a50bd7c2bf6479a084c7768ba2ec
1 parent
b97677fa12
Exists in
master
发布反馈修改, 添加未做题
Showing
17 changed files
with
267 additions
and
126 deletions
Show diff stats
app/src/main/java/com/hjx/parent/HomeworkFeedbackActivity.java
| ... | ... | @@ -19,7 +19,6 @@ import com.google.gson.Gson; |
| 19 | 19 | import com.hjx.parent.databinding.ActivityHomeworkFeedbackBinding; |
| 20 | 20 | import com.hjx.parent.rx.BaseRxActivity; |
| 21 | 21 | import com.prws.common.bean.Student; |
| 22 | -import com.prws.common.bean.homework.Correction; | |
| 23 | 22 | import com.prws.common.bean.homework.CorrectionPoint; |
| 24 | 23 | import com.prws.common.bean.homework.CorrectionSer; |
| 25 | 24 | import com.prws.common.bean.homework.HomeWork; |
| ... | ... | @@ -41,7 +40,7 @@ public class HomeworkFeedbackActivity extends BaseRxActivity<ActivityHomeworkFee |
| 41 | 40 | private Student student; |
| 42 | 41 | private HomeworkList mData; |
| 43 | 42 | private ArrayList<HomeWork> mList; |
| 44 | - private List<Correction> corrections = new ArrayList<>(); | |
| 43 | + private List<CorrectionSer> corrections = new ArrayList<>(); | |
| 45 | 44 | |
| 46 | 45 | @SuppressWarnings("unchecked") |
| 47 | 46 | @Override |
| ... | ... | @@ -54,20 +53,40 @@ public class HomeworkFeedbackActivity extends BaseRxActivity<ActivityHomeworkFee |
| 54 | 53 | binding.tvStuName.setText(student.stuName); |
| 55 | 54 | binding.tvGrade.setText(student.grade); |
| 56 | 55 | |
| 56 | + List<HomeWork> correctList = new ArrayList<>(); | |
| 57 | 57 | List<HomeWork> errorList = new ArrayList<>(); |
| 58 | - int correctNo = 0; | |
| 58 | + List<HomeWork> blankList = new ArrayList<>(); | |
| 59 | + int correctNo = 0, blankNo = 0; | |
| 59 | 60 | for (HomeWork homeWork: mList) { |
| 60 | 61 | homeWork.state = 1; |
| 61 | 62 | homeWork.index = mList.indexOf(homeWork); |
| 62 | - corrections.add(new Correction(homeWork.brief, homeWork.check ? 1 : 0)); | |
| 63 | - if (!homeWork.check) correctNo ++; | |
| 64 | - else errorList.add(homeWork); | |
| 63 | + corrections.add(homeWork.toSer()); | |
| 64 | + if (homeWork.correction == 0) { | |
| 65 | + correctList.add(homeWork); | |
| 66 | + correctNo ++; | |
| 67 | + } | |
| 68 | + else if (homeWork.correction == 1) { | |
| 69 | + correctList.add(homeWork); | |
| 70 | + errorList.add(homeWork); | |
| 71 | + } | |
| 72 | + else if (homeWork.correction == 2) { | |
| 73 | + blankList.add(homeWork); | |
| 74 | + blankNo ++; | |
| 75 | + } | |
| 65 | 76 | } |
| 66 | - binding.tvPercent.setText(new DecimalFormat("0%").format(1f * correctNo / mList.size())); | |
| 77 | + binding.viewBlank.setVisibility(blankList.isEmpty() ? View.GONE : View.VISIBLE); | |
| 78 | + binding.rvBlank.setVisibility(blankList.isEmpty() ? View.GONE : View.VISIBLE); | |
| 79 | + | |
| 80 | + float rate = 1f * correctNo / Math.max(mList.size() - blankNo, 1); | |
| 81 | + binding.tvPercent.setText(new DecimalFormat("0%").format(rate)); | |
| 67 | 82 | |
| 68 | 83 | binding.rvCorrect.setLayoutManager(new FlexboxLayoutManager(this)); |
| 69 | - NumberAdapter numberAdapter = new NumberAdapter(mList); | |
| 84 | + binding.rvBlank.setLayoutManager(new FlexboxLayoutManager(this)); | |
| 85 | + NumberAdapter numberAdapter = new NumberAdapter(correctList); | |
| 86 | + NumberAdapter blankAdapter = new NumberAdapter(blankList); | |
| 70 | 87 | binding.rvCorrect.setAdapter(numberAdapter); |
| 88 | + binding.rvBlank.setAdapter(blankAdapter); | |
| 89 | + | |
| 71 | 90 | binding.rvError.setVisibility(errorList.isEmpty() ? View.GONE : View.VISIBLE); |
| 72 | 91 | binding.rvError.setAdapter(new EvalAdapter(errorList)); |
| 73 | 92 | if (errorList.isEmpty()) { |
| ... | ... | @@ -77,9 +96,15 @@ public class HomeworkFeedbackActivity extends BaseRxActivity<ActivityHomeworkFee |
| 77 | 96 | binding.btnDetail.setOnClickListener(v -> { |
| 78 | 97 | viewTopicDetail(0); |
| 79 | 98 | }); |
| 99 | + binding.btnDetail2.setOnClickListener(v -> { | |
| 100 | + viewTopicDetail(0); | |
| 101 | + }); | |
| 80 | 102 | numberAdapter.setOnItemClickListener((baseQuickAdapter, view, i) -> { |
| 81 | 103 | viewTopicDetail(i); |
| 82 | 104 | }); |
| 105 | + blankAdapter.setOnItemClickListener((baseQuickAdapter, view, i) -> { | |
| 106 | + viewTopicDetail(i); | |
| 107 | + }); | |
| 83 | 108 | binding.btnPublish.setOnClickListener(v -> submit()); |
| 84 | 109 | } |
| 85 | 110 | |
| ... | ... | @@ -153,29 +178,31 @@ public class HomeworkFeedbackActivity extends BaseRxActivity<ActivityHomeworkFee |
| 153 | 178 | } else { |
| 154 | 179 | totalTimes.put(key, 1); |
| 155 | 180 | } |
| 156 | - if (!homeWork.check) { | |
| 181 | + if (homeWork.correction == 0) { | |
| 157 | 182 | if (correctTimes.containsKey(key)) { |
| 158 | 183 | correctTimes.put(key, correctTimes.get(key) + 1); |
| 159 | 184 | } else { |
| 160 | 185 | correctTimes.put(key, 1); |
| 161 | 186 | } |
| 162 | - } else if (homeWork.state == 1) { | |
| 163 | - if (underTimes.containsKey(key)) { | |
| 164 | - underTimes.put(key, underTimes.get(key) + 1); | |
| 165 | - } else { | |
| 166 | - underTimes.put(key, 1); | |
| 167 | - } | |
| 168 | - } else if (homeWork.state == 2) { | |
| 169 | - if (baseTimes.containsKey(key)) { | |
| 170 | - baseTimes.put(key, baseTimes.get(key) + 1); | |
| 171 | - } else { | |
| 172 | - baseTimes.put(key, 1); | |
| 173 | - } | |
| 174 | - } else if (homeWork.state == 3) { | |
| 175 | - if (normalTimes.containsKey(key)) { | |
| 176 | - normalTimes.put(key, normalTimes.get(key) + 1); | |
| 177 | - } else { | |
| 178 | - normalTimes.put(key, 1); | |
| 187 | + } else if (homeWork.correction == 1) { | |
| 188 | + if (homeWork.state == 1) { | |
| 189 | + if (underTimes.containsKey(key)) { | |
| 190 | + underTimes.put(key, underTimes.get(key) + 1); | |
| 191 | + } else { | |
| 192 | + underTimes.put(key, 1); | |
| 193 | + } | |
| 194 | + } else if (homeWork.state == 2) { | |
| 195 | + if (baseTimes.containsKey(key)) { | |
| 196 | + baseTimes.put(key, baseTimes.get(key) + 1); | |
| 197 | + } else { | |
| 198 | + baseTimes.put(key, 1); | |
| 199 | + } | |
| 200 | + } else if (homeWork.state == 3) { | |
| 201 | + if (normalTimes.containsKey(key)) { | |
| 202 | + normalTimes.put(key, normalTimes.get(key) + 1); | |
| 203 | + } else { | |
| 204 | + normalTimes.put(key, 1); | |
| 205 | + } | |
| 179 | 206 | } |
| 180 | 207 | } |
| 181 | 208 | } |
| ... | ... | @@ -218,10 +245,12 @@ public class HomeworkFeedbackActivity extends BaseRxActivity<ActivityHomeworkFee |
| 218 | 245 | protected void convert(@NonNull BaseViewHolder holder, HomeWork homeWork) { |
| 219 | 246 | int position = getData().indexOf(homeWork); |
| 220 | 247 | holder.setText(R.id.tvNum, String.valueOf(position + 1)); |
| 221 | - if (homeWork.check) { | |
| 248 | + if (homeWork.correction == 1) { | |
| 222 | 249 | holder.setImageResource(R.id.ivType, R.drawable.ic_wrong_small); |
| 223 | - } else { | |
| 250 | + } else if (homeWork.correction == 0){ | |
| 224 | 251 | holder.setImageResource(R.id.ivType, R.drawable.ic_correct_small); |
| 252 | + } else { | |
| 253 | + holder.setImageDrawable(R.id.ivType, null); | |
| 225 | 254 | } |
| 226 | 255 | } |
| 227 | 256 | } | ... | ... |
app/src/main/java/com/hjx/parent/HomeworkSelectActivity.java
| ... | ... | @@ -3,24 +3,20 @@ package com.hjx.parent; |
| 3 | 3 | import android.annotation.SuppressLint; |
| 4 | 4 | import android.content.Intent; |
| 5 | 5 | import android.content.res.ColorStateList; |
| 6 | -import android.graphics.drawable.Drawable; | |
| 7 | 6 | import android.os.Bundle; |
| 8 | 7 | import android.view.View; |
| 9 | -import android.widget.CheckBox; | |
| 10 | 8 | import android.widget.ImageView; |
| 9 | +import android.widget.RadioGroup; | |
| 11 | 10 | import android.widget.TextView; |
| 12 | 11 | |
| 13 | -import androidx.annotation.DrawableRes; | |
| 14 | 12 | import androidx.annotation.NonNull; |
| 15 | 13 | import androidx.annotation.Nullable; |
| 16 | -import androidx.core.content.res.ResourcesCompat; | |
| 17 | -import androidx.lifecycle.MutableLiveData; | |
| 18 | 14 | |
| 19 | 15 | import com.bumptech.glide.Glide; |
| 20 | 16 | import com.chad.library.adapter.base.BaseQuickAdapter; |
| 21 | 17 | import com.chad.library.adapter.base.BaseViewHolder; |
| 22 | 18 | import com.hjx.parent.databinding.ActivityHomeworkSelectBinding; |
| 23 | -import com.hjx.parent.function.Function1; | |
| 19 | +import com.hjx.parent.function.Function0; | |
| 24 | 20 | import com.hjx.parent.rx.BaseRxActivity; |
| 25 | 21 | import com.prws.common.bean.Student; |
| 26 | 22 | import com.prws.common.bean.homework.HomeWork; |
| ... | ... | @@ -35,8 +31,6 @@ public class HomeworkSelectActivity extends BaseRxActivity<ActivityHomeworkSelec |
| 35 | 31 | private ArrayList<HomeWork> mList; |
| 36 | 32 | private Adapter mAdapter = new Adapter(); |
| 37 | 33 | |
| 38 | - MutableLiveData<Integer> selectNum = new MutableLiveData<>(0); | |
| 39 | - | |
| 40 | 34 | @SuppressLint("NotifyDataSetChanged") |
| 41 | 35 | @SuppressWarnings("unchecked,ConstantConditions") |
| 42 | 36 | @Override |
| ... | ... | @@ -45,32 +39,31 @@ public class HomeworkSelectActivity extends BaseRxActivity<ActivityHomeworkSelec |
| 45 | 39 | student = (Student) getIntent().getSerializableExtra("student"); |
| 46 | 40 | mData = (HomeworkList) getIntent().getSerializableExtra("data"); |
| 47 | 41 | mList = (ArrayList<HomeWork>) getIntent().getSerializableExtra("list"); |
| 42 | + if (mList == null) mList = new ArrayList<>(); | |
| 43 | + for (HomeWork homeWork: mList) { | |
| 44 | + homeWork.correction = 0; | |
| 45 | + } | |
| 48 | 46 | |
| 49 | 47 | mAdapter.setNewData(mList); |
| 50 | 48 | binding.recyclerView.setAdapter(mAdapter); |
| 51 | 49 | |
| 52 | - mAdapter.selectCall = i -> selectNum.setValue(selectNum.getValue() + i); | |
| 53 | - selectNum.observe(this, i -> { | |
| 54 | - binding.tvNumber.setText(String.valueOf(i)); | |
| 55 | - if (i == 0) { | |
| 56 | - binding.btnConfirm.setText("作业全对"); | |
| 57 | - binding.btnConfirm.setBackgroundTintList(ColorStateList.valueOf(0xFF4ABC78)); | |
| 58 | - } else { | |
| 59 | - binding.btnConfirm.setText("下一步"); | |
| 60 | - binding.btnConfirm.setBackgroundTintList(ColorStateList.valueOf(0xFF1C90F3)); | |
| 50 | + mAdapter.selectCall = () -> { | |
| 51 | + int right = 0, error = 0, blank = 0; | |
| 52 | + for (HomeWork homeWork: mList) { | |
| 53 | + if (homeWork.correction == 0) right ++; | |
| 54 | + else if (homeWork.correction == 1) error ++; | |
| 55 | + else if (homeWork.correction == 2) blank ++; | |
| 61 | 56 | } |
| 62 | - binding.chkAll.setChecked(i == mList.size() && i != 0); | |
| 63 | - }); | |
| 64 | - | |
| 65 | - binding.chkAll.setOnClickListener(v -> { | |
| 66 | - if (mList.size() == 0) return; | |
| 67 | - boolean b = binding.chkAll.isChecked(); | |
| 68 | - for (HomeWork item: mList) { | |
| 69 | - item.check = b; | |
| 70 | - } | |
| 71 | - selectNum.setValue(b ? mList.size() : 0); | |
| 72 | - mAdapter.notifyDataSetChanged(); | |
| 73 | - }); | |
| 57 | + binding.tvNumber.setText(String.valueOf(error)); | |
| 58 | + binding.tvBlankNumber.setText(String.valueOf(blank)); | |
| 59 | +// if (right == mList.size()) { | |
| 60 | +// binding.btnConfirm.setText("作业全对"); | |
| 61 | +// binding.btnConfirm.setBackgroundTintList(ColorStateList.valueOf(0xFF4ABC78)); | |
| 62 | +// } else { | |
| 63 | +// binding.btnConfirm.setText("下一步"); | |
| 64 | +// binding.btnConfirm.setBackgroundTintList(ColorStateList.valueOf(0xFF1C90F3)); | |
| 65 | +// } | |
| 66 | + }; | |
| 74 | 67 | |
| 75 | 68 | binding.btnConfirm.setOnClickListener(v -> { |
| 76 | 69 | Intent intent = new Intent(this, HomeworkFeedbackActivity.class); |
| ... | ... | @@ -100,7 +93,7 @@ public class HomeworkSelectActivity extends BaseRxActivity<ActivityHomeworkSelec |
| 100 | 93 | public Adapter() { |
| 101 | 94 | super(R.layout.item_homework_detail); |
| 102 | 95 | } |
| 103 | - public Function1<Integer> selectCall; | |
| 96 | + public Function0 selectCall; | |
| 104 | 97 | |
| 105 | 98 | @SuppressLint("SetTextI18n") |
| 106 | 99 | @Override |
| ... | ... | @@ -111,32 +104,30 @@ public class HomeworkSelectActivity extends BaseRxActivity<ActivityHomeworkSelec |
| 111 | 104 | tvNumber.setText("第" + number + "题"); |
| 112 | 105 | Glide.with(mContext).load(homeWork.url).into(imageView); |
| 113 | 106 | |
| 114 | - if (homeWork.check) { | |
| 115 | - holder.itemView.setForeground(getDrawable(R.drawable.border_radius_10_red)); | |
| 116 | - } else { | |
| 117 | - holder.itemView.setForeground(null); | |
| 118 | - } | |
| 119 | - CheckBox checkBox = holder.getView(R.id.checkbox); | |
| 120 | - checkBox.setVisibility(View.VISIBLE); | |
| 121 | - checkBox.setOnCheckedChangeListener(null); | |
| 122 | - checkBox.setChecked(homeWork.check); | |
| 123 | - | |
| 124 | - holder.itemView.setOnClickListener(v -> checkBox.performClick()); | |
| 125 | - checkBox.setOnCheckedChangeListener((v, b) -> { | |
| 126 | - homeWork.check = b; | |
| 127 | - if (selectCall != null) { | |
| 128 | - selectCall.invoke(b ? 1 : -1); | |
| 129 | - } | |
| 130 | - if (homeWork.check) { | |
| 131 | - holder.itemView.setForeground(getDrawable(R.drawable.border_radius_10_red)); | |
| 132 | - } else { | |
| 133 | - holder.itemView.setForeground(null); | |
| 134 | - } | |
| 107 | + setBackground(homeWork, holder); | |
| 108 | + RadioGroup radioGroup = holder.getView(R.id.radioGroup); | |
| 109 | + radioGroup.setVisibility(View.VISIBLE); | |
| 110 | + | |
| 111 | + radioGroup.setOnCheckedChangeListener((group, checkedId) -> { | |
| 112 | + if (checkedId == R.id.rbRight) homeWork.correction = 0; | |
| 113 | + else if (checkedId == R.id.rbError) homeWork.correction = 1; | |
| 114 | + else if (checkedId == R.id.rbBlank) homeWork.correction = 2; | |
| 115 | + setBackground(homeWork, holder); | |
| 116 | + selectCall.invoke(); | |
| 135 | 117 | }); |
| 136 | 118 | } |
| 137 | 119 | |
| 138 | - private Drawable getDrawable(@DrawableRes int res) { | |
| 139 | - return ResourcesCompat.getDrawable(mContext.getResources(), res, null); | |
| 120 | + private void setBackground(HomeWork homeWork, BaseViewHolder helper) { | |
| 121 | + if (homeWork.correction == 0) { | |
| 122 | + helper.setBackgroundRes(R.id.root, R.drawable.bg_feedback_right); | |
| 123 | + helper.setChecked(R.id.rbRight, true); | |
| 124 | + } else if (homeWork.correction == 1) { | |
| 125 | + helper.setBackgroundRes(R.id.root, R.drawable.bg_feedback_error); | |
| 126 | + helper.setChecked(R.id.rbError, true); | |
| 127 | + } else if (homeWork.correction == 2) { | |
| 128 | + helper.setBackgroundRes(R.id.root, R.drawable.bg_feedback_blank); | |
| 129 | + helper.setChecked(R.id.rbBlank, true); | |
| 130 | + } | |
| 140 | 131 | } |
| 141 | 132 | } |
| 142 | 133 | } | ... | ... |
app/src/main/java/com/hjx/parent/HomeworkTopicActivity.java
| ... | ... | @@ -92,8 +92,13 @@ public class HomeworkTopicActivity extends BaseRxActivity<ActivityTopicDetailBin |
| 92 | 92 | TextView textView = (TextView) holder.itemView; |
| 93 | 93 | textView.setText(String.valueOf(getData().indexOf(homeWork) + 1)); |
| 94 | 94 | |
| 95 | - int color = homeWork.check ? 0xFFFF4133 : 0xFF4ABC78; | |
| 96 | - textView.setBackgroundTintList(ColorStateList.valueOf(color)); | |
| 95 | + if (homeWork.correction == null || homeWork.correction == 2) { | |
| 96 | + textView.setBackgroundTintList(ColorStateList.valueOf(0xFF999999)); | |
| 97 | + } else if (homeWork.correction == 0) { | |
| 98 | + textView.setBackgroundTintList(ColorStateList.valueOf(0xFF4ABC78)); | |
| 99 | + } else if (homeWork.correction == 1) { | |
| 100 | + textView.setBackgroundTintList(ColorStateList.valueOf(0xFFFF4133)); | |
| 101 | + } | |
| 97 | 102 | } |
| 98 | 103 | } |
| 99 | 104 | } | ... | ... |
app/src/main/res/drawable/bg_feedback_blank.xml
| ... | ... | @@ -0,0 +1,6 @@ |
| 1 | +<?xml version="1.0" encoding="utf-8"?> | |
| 2 | +<shape xmlns:android="http://schemas.android.com/apk/res/android"> | |
| 3 | + <corners android:radius="10dp"/> | |
| 4 | + <stroke android:color="#FDB900" android:width="2dp"/> | |
| 5 | + <solid android:color="@color/white"/> | |
| 6 | +</shape> | |
| 0 | 7 | \ No newline at end of file | ... | ... |
app/src/main/res/drawable/bg_feedback_error.xml
| ... | ... | @@ -0,0 +1,6 @@ |
| 1 | +<?xml version="1.0" encoding="utf-8"?> | |
| 2 | +<shape xmlns:android="http://schemas.android.com/apk/res/android"> | |
| 3 | + <corners android:radius="10dp"/> | |
| 4 | + <stroke android:color="#FF5138" android:width="2dp"/> | |
| 5 | + <solid android:color="@color/white"/> | |
| 6 | +</shape> | |
| 0 | 7 | \ No newline at end of file | ... | ... |
app/src/main/res/drawable/bg_feedback_right.xml
| ... | ... | @@ -0,0 +1,6 @@ |
| 1 | +<?xml version="1.0" encoding="utf-8"?> | |
| 2 | +<shape xmlns:android="http://schemas.android.com/apk/res/android"> | |
| 3 | + <corners android:radius="10dp"/> | |
| 4 | + <stroke android:color="#00D39C" android:width="2dp"/> | |
| 5 | + <solid android:color="@color/white"/> | |
| 6 | +</shape> | |
| 0 | 7 | \ No newline at end of file | ... | ... |
app/src/main/res/drawable/btn_feedback_blank.xml
| ... | ... | @@ -0,0 +1,16 @@ |
| 1 | +<?xml version="1.0" encoding="utf-8"?> | |
| 2 | +<selector xmlns:android="http://schemas.android.com/apk/res/android"> | |
| 3 | + <item android:state_checked="false"> | |
| 4 | + <shape> | |
| 5 | + <corners android:radius="888dp"/> | |
| 6 | + <solid android:color="#C4DFFF"/> | |
| 7 | + </shape> | |
| 8 | + </item> | |
| 9 | + | |
| 10 | + <item> | |
| 11 | + <shape> | |
| 12 | + <corners android:radius="888dp"/> | |
| 13 | + <solid android:color="#FDB900"/> | |
| 14 | + </shape> | |
| 15 | + </item> | |
| 16 | +</selector> | |
| 0 | 17 | \ No newline at end of file | ... | ... |
app/src/main/res/drawable/btn_feedback_error.xml
| ... | ... | @@ -0,0 +1,16 @@ |
| 1 | +<?xml version="1.0" encoding="utf-8"?> | |
| 2 | +<selector xmlns:android="http://schemas.android.com/apk/res/android"> | |
| 3 | + <item android:state_checked="false"> | |
| 4 | + <shape> | |
| 5 | + <corners android:radius="888dp"/> | |
| 6 | + <solid android:color="#C4DFFF"/> | |
| 7 | + </shape> | |
| 8 | + </item> | |
| 9 | + | |
| 10 | + <item> | |
| 11 | + <shape> | |
| 12 | + <corners android:radius="888dp"/> | |
| 13 | + <solid android:color="#FF5138"/> | |
| 14 | + </shape> | |
| 15 | + </item> | |
| 16 | +</selector> | |
| 0 | 17 | \ No newline at end of file | ... | ... |
app/src/main/res/drawable/btn_feedback_right.xml
| ... | ... | @@ -0,0 +1,16 @@ |
| 1 | +<?xml version="1.0" encoding="utf-8"?> | |
| 2 | +<selector xmlns:android="http://schemas.android.com/apk/res/android"> | |
| 3 | + <item android:state_checked="false"> | |
| 4 | + <shape> | |
| 5 | + <corners android:radius="888dp"/> | |
| 6 | + <solid android:color="#C4DFFF"/> | |
| 7 | + </shape> | |
| 8 | + </item> | |
| 9 | + | |
| 10 | + <item> | |
| 11 | + <shape> | |
| 12 | + <corners android:radius="888dp"/> | |
| 13 | + <solid android:color="#00D39C"/> | |
| 14 | + </shape> | |
| 15 | + </item> | |
| 16 | +</selector> | |
| 0 | 17 | \ No newline at end of file | ... | ... |
app/src/main/res/drawable/shape_radius_10.xml
app/src/main/res/layout/activity_homework_feedback.xml
| ... | ... | @@ -144,6 +144,7 @@ |
| 144 | 144 | android:layout_width="wrap_content" |
| 145 | 145 | android:layout_height="wrap_content"/> |
| 146 | 146 | </LinearLayout> |
| 147 | + | |
| 147 | 148 | <LinearLayout |
| 148 | 149 | android:orientation="horizontal" |
| 149 | 150 | android:layout_marginHorizontal="15dp" |
| ... | ... | @@ -173,12 +174,36 @@ |
| 173 | 174 | android:layout_marginHorizontal="15dp" |
| 174 | 175 | android:layout_width="match_parent" |
| 175 | 176 | android:layout_height="wrap_content"/> |
| 176 | - <TextView | |
| 177 | - android:text="错题已经加入到错题本,到错题本查看详情" | |
| 178 | - android:textSize="12sp" | |
| 179 | - android:textColor="#666" | |
| 177 | + | |
| 178 | + <LinearLayout | |
| 179 | + android:id="@+id/viewBlank" | |
| 180 | + android:orientation="horizontal" | |
| 181 | + android:layout_marginHorizontal="15dp" | |
| 182 | + android:layout_marginTop="15dp" | |
| 183 | + android:layout_width="match_parent" | |
| 184 | + android:layout_height="wrap_content"> | |
| 185 | + <TextView | |
| 186 | + android:text="未答题目" | |
| 187 | + android:textSize="14sp" | |
| 188 | + android:textColor="#333" | |
| 189 | + android:layout_width="wrap_content" | |
| 190 | + android:layout_height="wrap_content"/> | |
| 191 | + <TextView | |
| 192 | + android:id="@+id/btnDetail2" | |
| 193 | + android:text="(点击查看题目详情)" | |
| 194 | + android:textSize="14sp" | |
| 195 | + android:textColor="#1C90F3" | |
| 196 | + android:layout_width="wrap_content" | |
| 197 | + android:layout_height="wrap_content"/> | |
| 198 | + </LinearLayout> | |
| 199 | + | |
| 200 | + <androidx.recyclerview.widget.RecyclerView | |
| 201 | + android:id="@+id/rvBlank" | |
| 202 | + tools:listitem="@layout/item_feedback_num" | |
| 203 | + tools:itemCount="1" | |
| 204 | + android:layout_marginTop="15dp" | |
| 180 | 205 | android:layout_marginHorizontal="15dp" |
| 181 | - android:layout_width="wrap_content" | |
| 206 | + android:layout_width="match_parent" | |
| 182 | 207 | android:layout_height="wrap_content"/> |
| 183 | 208 | </LinearLayout> |
| 184 | 209 | ... | ... |
app/src/main/res/layout/activity_homework_select.xml
| ... | ... | @@ -34,33 +34,29 @@ |
| 34 | 34 | android:layout_marginBottom="8dp" |
| 35 | 35 | android:layout_width="match_parent" |
| 36 | 36 | android:layout_height="wrap_content"> |
| 37 | - <CheckBox | |
| 38 | - android:id="@+id/chkAll" | |
| 39 | - android:text="全选" | |
| 37 | + <Space style="@style/empty_space"/> | |
| 38 | + <TextView | |
| 39 | + android:id="@+id/tvNumber" | |
| 40 | + android:text="0" | |
| 40 | 41 | android:textSize="13sp" |
| 41 | - android:textColor="#333" | |
| 42 | - android:button="@drawable/chk_circle" | |
| 43 | - android:gravity="center_vertical" | |
| 44 | - android:paddingStart="8dp" | |
| 45 | - android:paddingEnd="0dp" | |
| 42 | + android:textColor="#1C90F3" | |
| 46 | 43 | android:layout_width="wrap_content" |
| 47 | 44 | android:layout_height="wrap_content"/> |
| 48 | - <Space style="@style/empty_space"/> | |
| 49 | 45 | <TextView |
| 50 | - android:text="已选择 " | |
| 46 | + android:text=" 道错题, " | |
| 51 | 47 | android:textSize="13sp" |
| 52 | 48 | android:textColor="#333" |
| 53 | 49 | android:layout_width="wrap_content" |
| 54 | 50 | android:layout_height="wrap_content"/> |
| 55 | 51 | <TextView |
| 56 | - android:id="@+id/tvNumber" | |
| 52 | + android:id="@+id/tvBlankNumber" | |
| 57 | 53 | android:text="0" |
| 58 | 54 | android:textSize="13sp" |
| 59 | 55 | android:textColor="#1C90F3" |
| 60 | 56 | android:layout_width="wrap_content" |
| 61 | 57 | android:layout_height="wrap_content"/> |
| 62 | 58 | <TextView |
| 63 | - android:text=" 道错题" | |
| 59 | + android:text=" 道未做题" | |
| 64 | 60 | android:textSize="13sp" |
| 65 | 61 | android:textColor="#333" |
| 66 | 62 | android:layout_width="wrap_content" |
| ... | ... | @@ -83,13 +79,13 @@ |
| 83 | 79 | android:layout_height="wrap_content"> |
| 84 | 80 | <TextView |
| 85 | 81 | android:id="@+id/btnConfirm" |
| 86 | - android:text="作业全对" | |
| 82 | + android:text="下一步" | |
| 87 | 83 | android:textSize="16sp" |
| 88 | 84 | android:textColor="@color/white" |
| 89 | 85 | android:gravity="center" |
| 90 | 86 | android:layout_gravity="center" |
| 91 | 87 | android:background="@drawable/shape_radius_5" |
| 92 | - android:backgroundTint="#4ABC78" | |
| 88 | + android:backgroundTint="#1C90F3" | |
| 93 | 89 | android:layout_width="265dp" |
| 94 | 90 | android:layout_height="36dp"/> |
| 95 | 91 | </FrameLayout> | ... | ... |
app/src/main/res/layout/item_homework_detail.xml
| ... | ... | @@ -2,15 +2,15 @@ |
| 2 | 2 | <LinearLayout |
| 3 | 3 | xmlns:android="http://schemas.android.com/apk/res/android" |
| 4 | 4 | xmlns:tools="http://schemas.android.com/tools" |
| 5 | + android:id="@+id/root" | |
| 5 | 6 | android:orientation="vertical" |
| 6 | 7 | android:background="@drawable/shape_radius_10" |
| 7 | - android:backgroundTint="@color/white" | |
| 8 | 8 | android:paddingVertical="14dp" |
| 9 | 9 | android:layout_marginHorizontal="16dp" |
| 10 | 10 | android:layout_marginVertical="8dp" |
| 11 | 11 | android:layout_width="match_parent" |
| 12 | 12 | android:layout_height="wrap_content" |
| 13 | - tools:ignore="SmallSp"> | |
| 13 | + tools:ignore="SmallSp,HardcodedText"> | |
| 14 | 14 | |
| 15 | 15 | <LinearLayout |
| 16 | 16 | android:orientation="horizontal" |
| ... | ... | @@ -37,13 +37,58 @@ |
| 37 | 37 | android:backgroundTint="#489AFA" |
| 38 | 38 | android:layout_width="wrap_content" |
| 39 | 39 | android:layout_height="wrap_content" /> |
| 40 | + <Space style="@style/empty_space"/> | |
| 41 | + <RadioGroup | |
| 42 | + android:id="@+id/radioGroup" | |
| 43 | + android:visibility="gone" | |
| 44 | + tools:visibility="visible" | |
| 45 | + android:orientation="horizontal" | |
| 46 | + android:weightSum="3" | |
| 47 | + android:gravity="center_vertical" | |
| 48 | + android:paddingHorizontal="10dp" | |
| 49 | + android:layout_gravity="bottom" | |
| 50 | + android:layout_width="wrap_content" | |
| 51 | + android:layout_height="wrap_content"> | |
| 52 | + <RadioButton | |
| 53 | + android:id="@+id/rbRight" | |
| 54 | + android:text="正确" | |
| 55 | + android:textSize="12sp" | |
| 56 | + android:textColor="@color/white" | |
| 57 | + android:gravity="center" | |
| 58 | + android:button="@null" | |
| 59 | + android:background="@drawable/btn_feedback_right" | |
| 60 | + android:layout_marginHorizontal="8dp" | |
| 61 | + android:layout_width="64dp" | |
| 62 | + android:layout_height="20dp" /> | |
| 63 | + <RadioButton | |
| 64 | + android:id="@+id/rbError" | |
| 65 | + android:text="错误" | |
| 66 | + android:textSize="12sp" | |
| 67 | + android:textColor="@color/white" | |
| 68 | + android:gravity="center" | |
| 69 | + android:button="@null" | |
| 70 | + android:background="@drawable/btn_feedback_error" | |
| 71 | + android:layout_marginHorizontal="8dp" | |
| 72 | + android:layout_width="64dp" | |
| 73 | + android:layout_height="20dp" /> | |
| 74 | + <RadioButton | |
| 75 | + android:id="@+id/rbBlank" | |
| 76 | + android:text="未完成" | |
| 77 | + android:textSize="12sp" | |
| 78 | + android:textColor="@color/white" | |
| 79 | + android:gravity="center" | |
| 80 | + android:button="@null" | |
| 81 | + android:background="@drawable/btn_feedback_blank" | |
| 82 | + android:layout_marginHorizontal="8dp" | |
| 83 | + android:layout_width="64dp" | |
| 84 | + android:layout_height="20dp" /> | |
| 85 | + </RadioGroup> | |
| 40 | 86 | </LinearLayout> |
| 41 | 87 | |
| 42 | 88 | <ImageView |
| 43 | 89 | android:id="@+id/ivTopic" |
| 44 | 90 | android:adjustViewBounds="true" |
| 45 | - android:layout_marginStart="10dp" | |
| 46 | - android:layout_marginEnd="4dp" | |
| 91 | + android:layout_marginHorizontal="10dp" | |
| 47 | 92 | android:layout_marginTop="14dp" |
| 48 | 93 | android:layout_width="match_parent" |
| 49 | 94 | android:layout_height="wrap_content" | ... | ... |
libs/common/src/main/java/com/prws/common/bean/homework/Correction.java
| ... | ... | @@ -1,16 +0,0 @@ |
| 1 | -package com.prws.common.bean.homework; | |
| 2 | - | |
| 3 | -public class Correction { | |
| 4 | - | |
| 5 | - public String brief; | |
| 6 | - | |
| 7 | - public int correction; // 0 对, 1 错 | |
| 8 | - | |
| 9 | - public Correction() { | |
| 10 | - } | |
| 11 | - | |
| 12 | - public Correction(String brief, int correction) { | |
| 13 | - this.brief = brief; | |
| 14 | - this.correction = correction; | |
| 15 | - } | |
| 16 | -} |
libs/common/src/main/java/com/prws/common/bean/homework/CorrectionSer.java
| ... | ... | @@ -2,7 +2,7 @@ package com.prws.common.bean.homework; |
| 2 | 2 | |
| 3 | 3 | public class CorrectionSer { |
| 4 | 4 | public String brief; |
| 5 | - public int correction; // 0 对, 1 错 | |
| 5 | + public int correction; // 0 对, 1 错, 2 未做题 | |
| 6 | 6 | public int state; // 1: 已听懂; 2: 基本听懂; 3: 一般听懂 |
| 7 | 7 | |
| 8 | 8 | public CorrectionSer() { | ... | ... |
libs/common/src/main/java/com/prws/common/bean/homework/HomeWork.java
| ... | ... | @@ -20,7 +20,6 @@ public class HomeWork implements Serializable { |
| 20 | 20 | public String answer; |
| 21 | 21 | public String points; |
| 22 | 22 | |
| 23 | - public boolean check = false; //选中为错题 | |
| 24 | 23 | public transient int index = 0; |
| 25 | 24 | public transient int state = 1; |
| 26 | 25 | |
| ... | ... | @@ -39,6 +38,6 @@ public class HomeWork implements Serializable { |
| 39 | 38 | } |
| 40 | 39 | |
| 41 | 40 | public CorrectionSer toSer() { |
| 42 | - return new CorrectionSer(brief, check ? 1 : 0, state); | |
| 41 | + return new CorrectionSer(brief, correction, state); | |
| 43 | 42 | } |
| 44 | 43 | } | ... | ... |
libs/common/src/main/java/com/prws/common/net/NetWorks.java
| ... | ... | @@ -58,7 +58,7 @@ import retrofit2.http.Url; |
| 58 | 58 | */ |
| 59 | 59 | public class NetWorks extends RetrofitUtils { |
| 60 | 60 | //服务器路径 |
| 61 | - public static final NetService service_url = getMachineRetrofit("https://mgr.hjx.com").create(NetService.class); | |
| 61 | + public static final NetService service_url = getMachineRetrofit(BuildConfig.SERVER_URL).create(NetService.class); | |
| 62 | 62 | |
| 63 | 63 | //设缓存有效期为1天 |
| 64 | 64 | protected static final long CACHE_STALE_SEC = 60 * 60 * 24 * 1; | ... | ... |