...
|
...
|
@@ -8,6 +8,7 @@ import android.text.SpannableString |
|
|
import android.text.Spanned
|
|
|
import android.text.style.AbsoluteSizeSpan
|
|
|
import android.text.style.ForegroundColorSpan
|
|
|
import android.util.Log
|
|
|
import android.view.LayoutInflater
|
|
|
import android.view.View
|
|
|
import android.view.ViewGroup
|
...
|
...
|
@@ -43,6 +44,9 @@ class TopicAdapter : BaseAdapter<OptionArr, AdapterTopicBinding>() { |
|
|
// 题目类型 1:单选 2:多选 3:判断
|
|
|
var type = 1
|
|
|
|
|
|
// 是否时正确的答题
|
|
|
var isTrue: Boolean = true
|
|
|
|
|
|
// 是否显示正确答案
|
|
|
var showCorrect = false
|
|
|
|
...
|
...
|
@@ -111,8 +115,6 @@ class TopicAdapter : BaseAdapter<OptionArr, AdapterTopicBinding>() { |
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setTextDefault(holder.contentTopic, holder.tvName)
|
|
|
// 单选 / 判断
|
|
|
if (type == 1 || type == 3) {
|
...
|
...
|
@@ -124,11 +126,13 @@ class TopicAdapter : BaseAdapter<OptionArr, AdapterTopicBinding>() { |
|
|
setTextRed(holder.contentTopic, holder.tvName)
|
|
|
}
|
|
|
} else {
|
|
|
//未交卷时显示
|
|
|
setTextGreen(holder.contentTopic, holder.tvName)
|
|
|
}
|
|
|
} else {
|
|
|
if (showCorrect && data.is_correct == 1) {
|
|
|
setTextGreen(holder.contentTopic, holder.tvName)
|
|
|
// 正确答背景应变绿色--需求修改成当有错题时正确答案背景色没变化
|
|
|
// setTextGreen(holder.contentTopic, holder.tvName)
|
|
|
}
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -146,7 +150,8 @@ class TopicAdapter : BaseAdapter<OptionArr, AdapterTopicBinding>() { |
|
|
}
|
|
|
} else {
|
|
|
if (showCorrect && data.is_correct == 1) {
|
|
|
setTextGreen(holder.contentTopic, holder.tvName)
|
|
|
// 正确答背景应变绿色--需求修改成当有错题时正确答案背景色没变化
|
|
|
// setTextGreen(holder.contentTopic, holder.tvName)
|
|
|
}
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -163,8 +168,8 @@ class TopicAdapter : BaseAdapter<OptionArr, AdapterTopicBinding>() { |
|
|
}
|
|
|
|
|
|
private fun setTextGreen(view: View, textView: TextView) {
|
|
|
view.setBackgroundResource(R.drawable.solid_a2_4_08a2)
|
|
|
textView.setTextColor(ContextCompat.getColor(textView.context, R.color.color_e8))
|
|
|
view.setBackgroundResource(R.drawable.solid_0825_4)
|
|
|
textView.setTextColor(ContextCompat.getColor(textView.context, R.color.color_25))
|
|
|
}
|
|
|
|
|
|
private fun previewPhoto(data: Array<String>, context: Context, position: Int) {
|
...
|
...
|
@@ -328,10 +333,9 @@ class PracticePaperAdapter(private val isShowPosition: Boolean = true) : |
|
|
if (dataList[position].isEmpty()) {
|
|
|
list.add("")
|
|
|
} else {
|
|
|
list.add(
|
|
|
if (isTrue(data, dataList[position], data.options_arr)
|
|
|
) "1" else "0"
|
|
|
)
|
|
|
val element = if (isTrue(data, dataList[position], data.options_arr)
|
|
|
) "1" else "0"
|
|
|
list.add(element)
|
|
|
}
|
|
|
}
|
|
|
return list
|
...
|
...
|
|