| | |
| | | import com.dollearn.student.R |
| | | import com.dollearn.student.dialog.TipDialog |
| | | import com.dollearn.student.network.HttpManager |
| | | import com.dollearn.student.network.entity.Subject |
| | | import com.dollearn.student.network.entity.SubjectBean |
| | | import com.dollearn.student.network.request |
| | | import com.dollearn.student.ui.TransparentStatusBarActivity |
| | |
| | | |
| | | private fun recover(){ |
| | | HttpManager.teamSchedule(day,week,3).request(this){_,data-> |
| | | view_pager.setCurrentItem(data?.topicIds?.size?:0,false) |
| | | view_pager.setCurrentItem((data?.schedule?:1)-1,false) |
| | | if (view_pager.currentItem != 0) |
| | | tv_last.visible() |
| | | totalCount = data?.answerNumber?:0 |
| | | rightCount = data?.correctNumber?:0 |
| | | } |
| | |
| | | if (view_pager.currentItem == 0) |
| | | finish() |
| | | else{ |
| | | val list = (data?.subjectList?: arrayListOf()).flatMap { it }.subList(0,view_pager.currentItem) |
| | | HttpManager.exitLearning(totalCount,rightCount,day,week,3,data?.data?.id?:"", list.joinToString(",") { it.id }).request(this@IncludeActivity){ _, _-> |
| | | val list = (data?.subjectList?.subList(0,view_pager.currentItem)) |
| | | val arrayListOf = arrayListOf<Subject>() |
| | | list?.forEach { it -> |
| | | it.forEachIndexed { index, subject -> |
| | | if (index == 2||index == 4||index == 5){ |
| | | arrayListOf.add(subject) |
| | | } |
| | | } |
| | | } |
| | | HttpManager.exitLearning(view_pager.currentItem,season,time,totalCount,rightCount,day,week,3,data?.data?.id?:"", arrayListOf.joinToString(",") { it.id }).request(this@IncludeActivity){ _, _-> |
| | | finish() |
| | | } |
| | | } |