package com.example.administrator.webexam.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.example.administrator.webexam.Module.Data.AlreadyDoneQ;
import com.example.administrator.webexam.Module.Data.JudgementQuestions;
import com.example.administrator.webexam.Module.Data.RadioQuestions;
import com.example.administrator.webexam.Module.IAlreadyDoneSomeQuestionsStatus;
import com.example.administrator.webexam.Module.IExaminStatus;
import com.example.administrator.webexam.Module.impl.AlreadyDoneSomeQuestionsStatus;
import com.example.administrator.webexam.Module.impl.ExaminStatus;
import com.example.administrator.webexam.R;
import com.example.administrator.webexam.View.Examnation.IndexExaminationView;
import com.example.administrator.webexam.View.Examnation.JudgeExaminationView;
import com.example.administrator.webexam.View.Examnation.MenuExaminationView;
import com.example.administrator.webexam.View.Examnation.NoHaveFragment;
import com.example.administrator.webexam.View.Examnation.RadioExaminationView;
import java.util.ArrayList;
import java.util.List;
import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class ExaminationActivity extends AppCompatActivity implements RadioExaminationView.FragmentInteraction, JudgeExaminationView.FragmentInteraction,
IndexExaminationView.FragmentInteraction {
@Bind(R.id.examin_time)
TextView examinTime;
@Bind(R.id.vp)
ViewPager vp;
@Bind(R.id.back)
ImageView back;
@Bind(R.id.now_index)
ImageView nowIndex;
private int recLen = 3600;
private MyAdapter myAdapter;
private String examinname;
private static int radiocount;
private static int judecount;
public static int countall;
private IExaminStatus iExaminStatus;
public static String examinid;
public static List<RadioQuestions> list1 = new ArrayList<RadioQuestions>();
public static List<JudgementQuestions> list2 = new ArrayList<JudgementQuestions>();
LocalBroadcastManager mLocalBroadcastManager;
ArrayList<String> arrayList = new ArrayList<String>();
private static int index = 0;
private String OBJECTID = "ObjectId";
private String LOGIN_TYPE = "login_type";
public static String ObjectId;
private static final String Examin_ID = "examinid";
private static final String EXAMIN_NAME = "examinname";
private static final String TYPE_EXAMIN = "examintype";
private static int type;
private static boolean isTimeIn = true;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_examination);
ButterKnife.bind(this);
mLocalBroadcastManager = LocalBroadcastManager.getInstance(this);
Intent intent = getIntent();
Bundle bundle = intent.getExtras();
examinid = bundle.getString(Examin_ID, "");
examinname = bundle.getString(EXAMIN_NAME, "");
type = bundle.getInt(TYPE_EXAMIN);
SharedPreferences userInfo = this.getSharedPreferences("user_login", 0);
ObjectId = userInfo.getString(OBJECTID, "");
iExaminStatus = new ExaminStatus();
if (type == 4) {
loadDatadaily();
countall=13;
} else {
iExaminStatus.countRadioGet(examinid, new IExaminStatus.GetCountCallBack() {
@Override
public void getCount(int count) {
radiocount = count;
iExaminStatus.countJudmGet(examinid, new IExaminStatus.GetCountCallBack() {
@Override
public void getCount(int count) {
judecount = count;
countall = radiocount + judecount + 3;
loadData();
}
});
}
});
}
// Toast.makeText(this,examinname+examinid,Toast.LENGTH_SHORT).show();
for (int i = 0; i < 50; i++) {
arrayList.add("null");
}
}
@OnClick({R.id.back, R.id.now_index})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.back:
finish();
break;
case R.id.now_index:
if (index == 0) {
if (type == 1 || type == 0) {
Toast.makeText(getApplicationContext(), " 请点击查阅", Toast.LENGTH_SHORT).show();
}
Toast.makeText(getApplicationContext(), " 请开始考试", Toast.LENGTH_SHORT)
.show();
} else {
Intent intent = new Intent("com.leyikao.jumptopageexamin");
intent.putExtra("index", countall - 1);
mLocalBroadcastManager.sendBroadcast(intent);
break;
}
}
}
private void setViewPager() {
vp.setCurrentItem(0);
myAdapter = new MyAdapter(getSupportFragmentManager());
vp.setAdapter(myAdapter);
vp.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {
}
@Override
public void onPageScrollStateChanged(int state) {
}
});
vp.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
return true;
}
});
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(this);
IntentFilter filter = new IntentFilter();
filter.addAction("com.leyikao.jumptonextexamin");
filter.addAction("com.leyikao.jumptopageexamin");
lbm.registerReceiver(mMessageReceiver, filter);
}
private void loadDatadaily() {
final IAlreadyDoneSomeQuestionsStatus iStatus = new AlreadyDoneSomeQuestionsStatus();
iStatus.selectTen(ObjectId, false, new IAlreadyDoneSomeQuestionsStatus.GetWQuesitonCalBack() {
@Override
public void get(final List<AlreadyDoneQ> list) {
if (list.size()<10){
Toast.makeText(getApplicationContext(),"试题量不足,请参加模拟考试",Toast.LENGTH_SHORT).show();
}else {
for (int i = 0; i < list.size(); i++) {
if (list.get(i).isRadio()) {
if (i <= 9) {
list1.add(list.get(i).getRid());
}
if (i == 9) {
setViewPager();
}
} else {
if (i <= 9) {
list2.add(list.get(i).getJid());
}
if (i == 9) {
setViewPager();
}
}
}
}
}
});
}
private void loadData() {
// System.out.println("SSSSSSSSSSSSSSSSSS"+examinid);
iExaminStatus.GetRadioAll(examinid, new IExaminStatus.GetAllQuestionCallBack() {
@Override
public void getAllquestion(List<
没有合适的资源?快使用搜索试试~ 我知道了~
基于android的在线考试系统.zip
共418个文件
xml:145个
java:139个
png:42个
需积分: 5 0 下载量 148 浏览量
2024-03-12
16:49:53
上传
评论 1
收藏 4.73MB ZIP 举报
温馨提示
【项目资源】: 包含前端、后端、移动开发、操作系统、人工智能、物联网、信息化管理、数据库、硬件开发、大数据、课程资源、音视频、网站开发等各种技术项目的源码。 包括STM32、ESP8266、PHP、QT、Linux、iOS、C++、Java、python、web、C#、EDA、proteus、RTOS等项目的源码。 【项目质量】: 所有源码都经过严格测试,可以直接运行。 功能在确认正常工作后才上传。 【适用人群】: 适用于希望学习不同技术领域的小白或进阶学习者。 可作为毕设项目、课程设计、大作业、工程实训或初期项目立项。 【附加价值】: 项目具有较高的学习借鉴价值,也可直接拿来修改复刻。 对于有一定基础或热衷于研究的人来说,可以在这些基础代码上进行修改和扩展,实现其他功能。 【沟通交流】: 有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。 鼓励下载和使用,并欢迎大家互相学习,共同进步。 # 注意 1. 本资源仅用于开源学习和技术交流。不可商用等,一切后果由使用者承担。 2. 部分字体以及插图等来自网络,若是侵权请联系删除。
资源推荐
资源详情
资源评论
收起资源包目录
基于android的在线考试系统.zip (418个子文件)
gradlew.bat 2KB
fileSnapshots.bin 5.11MB
classAnalysis.bin 2.41MB
jarAnalysis.bin 927KB
fileHashes.bin 791KB
taskHistory.bin 238KB
taskHistory.bin 77KB
taskJars.bin 25KB
resourceHashesCache.bin 20KB
last-build.bin 1B
built.bin 0B
.gitignore 7B
build.gradle 1KB
build.gradle 622B
settings.gradle 15B
gradlew 5KB
app.iml 13KB
WebExam.iml 861B
guava-19.0.jar 2.2MB
gradle-wrapper.jar 52KB
ExaminationActivity.java 15KB
ExaminStatus.java 10KB
ExaminationPresenter.java 9KB
MenuExaminationView.java 9KB
RegisterPresenter.java 9KB
StudentStatus.java 8KB
AlreadyDoneSomeQuestionsStatus.java 7KB
AddQuestionPagerView.java 7KB
MainActivity.java 7KB
ClassMainTeacherView.java 7KB
QuestionWrongPresenter.java 7KB
MyClassView.java 6KB
TeacherStatus.java 6KB
AddQuestionPagerPresenter.java 6KB
ShowAllPageListView.java 6KB
JudgeExaminationView.java 5KB
RadioExaminationView.java 5KB
MyClassPresenter.java 5KB
ClassmateStatus.java 5KB
AddQuestionSelectView.java 5KB
LoginPresenter.java 5KB
ReportCardStatus.java 5KB
ClassTeacherView.java 5KB
StudentMainPresenter.java 5KB
ClassMainTeacherPresenter.java 5KB
TeacherMainPresenter.java 4KB
RegisterPhone.java 4KB
IndexStudentView.java 4KB
QuestionAnalysisPresenter.java 4KB
MeStudentView.java 4KB
FullscreenActivity.java 4KB
QuestionWrongInfoActivity.java 4KB
ExaminAuthPresenter.java 4KB
QuestionWrongView.java 4KB
LoginFragment.java 4KB
ExaminAuthView.java 4KB
IndexExaminationView.java 4KB
IndexTeacherView.java 4KB
AddQuestionPagerActivity.java 4KB
TeacherRegisterView.java 4KB
UniversityStatus.java 3KB
MyItemDecorationUtils.java 3KB
RegisterActivity.java 3KB
StudentMangItemAdapter.java 3KB
QuestionAnsylterItemAdapter.java 3KB
MeTeacherView.java 3KB
ClassTeacherItemAdapter.java 3KB
RegisterView.java 3KB
HistoryScorePresenter.java 3KB
AddQuestionEndView.java 3KB
AdminActivity.java 3KB
StudentMangView.java 3KB
StudentRegisterView.java 3KB
HistoryScoreView.java 3KB
AddQuestionIndexView.java 2KB
QuestionWrongItemAdapter.java 2KB
ScoreHistoryItemAdapter.java 2KB
StudentMangPresenter.java 2KB
ShowPagerItemAdapter.java 2KB
StudentAuthView.java 2KB
ClassStudentView.java 2KB
ClassMainTeacherActivity.java 2KB
QuestionAnalysisView.java 2KB
TopicSingChoiceDialog.java 2KB
IExaminStatus.java 2KB
AddClassView.java 2KB
AuthTeacherItemAdapter.java 2KB
ShowStudentScoreView.java 2KB
MyClassActivity.java 2KB
ShowAllPageListPresenter.java 2KB
StudentAuthPresenter.java 2KB
QuestionAnalysisActivity.java 2KB
AdminStatus.java 2KB
TeacherInfoForAdminActivity.java 2KB
QuestionWrongActivity.java 2KB
NoHaveFragment.java 2KB
HistoryScoreActivity.java 2KB
ShowAllPageListActivity.java 2KB
StudentMangActivity.java 2KB
ShowStudentScoreActivity.java 2KB
共 418 条
- 1
- 2
- 3
- 4
- 5
资源评论
妄北y
- 粉丝: 1w+
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功