首先先解压文件,然后是相应的文件导入到相应的PHP源码,看看有没有安装手册,如果没有,再找有没有那个Install.php的文件了,如果有的话,就直接输出www/后的文件路径,进入页面以后,就是一步步提示安装,若是没有找到数据库文件夹,就在PHPMyAdmin中建一个数据库名,里面的表可以不用建,这样安装就没问题了。 或者还有一种就是那个不用管数据库,直接找到Install.php,然后直接安装就行了,数据库是自动生成的,比较简单。 或者是下载的源代码,其中有配置文件,只要把把配置文件调好,其中包括文件保存路径,用户名,密码,网站名......等等,点击保存就好了。 有手册的话就仔细阅读手册,要注意有些讲的是Lunix配置,不用去管它。 还有就是要有耐心啊,是在不会用 就行了。
❷ 求一个用数据结构和c语言编的考试报名管理系统的源代码
可以借助Bai Hi示意我们
有机会可能完成你所面临的任务
具体的要求也可能示意我们
ES:\\
❸ 学生信息管理系统最简单源代码。
方法一:
1、创建一个c语言项目。然后右键头文件,创建一个Stu的头文件。
❹ 在线报名系统源码
可以试试易查分,基本上报名系统具备的功能在易查分都可以实现,3分钟左右就可以生成,不用技术代码什么的,只要把需要统计的内容,比如“报名姓名”“报名考号”“报名密码”等,做成excel电子表格,上传到易查分,就可以生成,手机和电脑都可以查,你可以试试~
下图是利用易查分生成的报名系统截图:
❺ 学生管理系统源代码c++
#include <iostream.h>
#include <string.h>
#include "h1.h"
void menu();
void clear()
{
cin.clear();
cin.ignore();
}
void stu::init_name_grade() //输入学生姓名、班级
{
cout<<"请输入学生姓名:";
cin>>name;
clear();
cout<<"请输入学生班级号:";
cin>>grade;
clear();
}
void stu::init_first() //输入学生第一学期成绩
{
cout<<"学生"<<name<<"第一学期成绩"<<endl;
cout<<"请输入英语成绩:";
cin>>first.english;
clear();
cout<<"请输入数学成绩:";
cin>>first.math;
clear();
first.total=first.english+first.math;
first.aver=first.total/2;
}
void stu::init_second() //输入学生第二学期成绩
{
cout<<"学生"<<name<<"第二学期成绩"<<endl;
cout<<"请输入英语成绩:";
cin>>second.english;
clear();
cout<<"请输入数学成绩:";
cin>>second.math;
clear();
second.total=second.english+second.math;
second.aver=second.total/2;
}
void stu::show_first() //显示学生第一学期成绩
{
cout<<"学生姓名:"<<name<<endl;
cout<<"学生班级:"<<grade<<endl;
cout<<"学生第一学期英语成绩:"<<first.english<<endl;
cout<<"学生第一学期数学成绩:"<<first.math<<endl;
cout<<"学生第一学期总成绩:"<<first.total<<endl;
cout<<"学生第一学期平均成绩:"<<first.aver<<endl;
}
void stu::show_second() //显示学生第二学期成绩
{
cout<<"学生姓名:"<<name<<endl;
cout<<"学生班级:"<<grade<<endl;
cout<<"学生第二学期英语成绩:"<<second.english<<endl;
cout<<"学生第二学期数学成绩:"<<second.math<<endl;
cout<<"学生第二学期总成绩:"<<second.total<<endl;
cout<<"学生第二学期平均成绩:"<<second.aver<<endl;
}
void stu::show_grade() //显示学生所有学期成绩
{
cout<<"学生姓名:"<<name<<endl;
cout<<"学生班级:"<<grade<<endl;
cout<<"学生第一学期英语成绩:"<<first.english<<endl;
cout<<"学生第一学期数学成绩:"<<first.math<<endl;
cout<<"学生第一学期总成绩:"<<first.total<<endl;
cout<<"学生第一学期平均成绩:"<<first.aver<<endl;
cout<<"学生第二学期英语成绩:"<<second.english<<endl;
cout<<"学生第二学期数学成绩:"<<second.math<<endl;
cout<<"学生第二学期总成绩:"<<second.total<<endl;
cout<<"学生第二学期平均成绩:"<<second.aver<<endl;
}
stu_info::stu_info() //stu_info的构造函数
{
num=0;
}
void stu_info::add_name_grade() //添加学生信息(班级、姓名)到数组中
{
int choose;
do
{
per[num].init_name_grade();
num++;
cout<<"继续输入学生信息吗?(0:退出,任意数字键继续...)";
cin>>choose;
clear();
}while(choose!=0);
}
void stu_info::add_first(int gra) //添加第一学期成绩
{
for(int i=0;i<num;i++)
{
if(per[i].grade==gra)
{
per[i].init_first();
}
}
}
void stu_info::add_second(int gra) //添加第二学期成绩
{
for(int i=0;i<num;i++)
{
if(per[i].grade==gra)
{
per[i].init_second();
}
}
}
void stu_info::query_aver(int gra,int term) //按班级、学期及平均分排序显示学生成绩
{
stu temp[100];
stu t;
int sum=0;
for(int i=0;i<num;i++)
{
if(per[i].grade==gra)
{
temp[sum]=per[i];
sum++;
}
}
for(int j=0;j<sum-1;j++)
{
for(int k=sum-1;k>j;k--)
{
if(term==1)
{
if(temp[k].first.aver>temp[k-1].first.aver)
{
t=temp[k];
temp[k]=temp[k-1];
temp[k-1]=t;
}
}
else if(term==2)
{
if(temp[k].second.aver>temp[k-1].second.aver)
{
t=temp[k];
temp[k]=temp[k-1];
temp[k-1]=t;
}
}
else
{
cout<<"该学期不存在!"<<endl;
return;
}
}
}
for( i=0;i<sum;i++)
{
if(term==1)
{
temp[i].show_first();
}
else
{
temp[i].show_second();
}
}
}
void stu_info::modify(int gra,char name[10]) //按班级、姓名查询学生信息并修改学生信息
{
for(int i=0;i<num;i++)
{
if(per[i].grade==gra&&strcmp(per[i].name,name)==0)
{
per[i].init_name_grade();
per[i].init_first();
per[i].init_second();
return;
}
else
{
cout<<"该学生不存在!"<<endl;
}
}
}
void stu_info::query(int gra,char name[10]) //按班级、姓名查询学生信息并输出
{
for(int i=0;i<num;i++)
{
if(per[i].grade==gra&&strcmp(per[i].name,name)==0)
{
per[i].show_grade();
return;
}
else
{
cout<<"该学生不存在!"<<endl;
}
}
}
void stu_info::query_grade(int gra) //按班级输出该班全部学生成绩
{
cout<<gra<<"班级学生的成绩如下:"<<endl;
for(int i=0;i<num;i++)
{
if(per[i].grade==gra)
{
per[i].show_grade();
}
}
}
void stu_info::show_fail(int grade,int term,int course)
{
cout<<"不及格名单如下:"<<endl;
for(int i=0;i<num;i++)
{
if(per[i].grade==grade)
{
if(term==1)
{
if(course==1)
{
if(per[i].first.english<60)
{
cout<<per[i].name<<endl;
}
}else if(course==2)
{
if(per[i].first.math<60)
{
cout<<per[i].name<<endl;
}
}
}
else if(term==2)
{
if(course==1)
{
if(per[i].second.english<60)
{
cout<<per[i].name<<endl;
}
}else if(course==2)
{
if(per[i].second.math<60)
{
cout<<per[i].name<<endl;
}
}
}
else
{
cout<<"该学期不存在!"<<endl;
return;
}
}
}
}
void main()
{
stu_info people;
int grade;
int term;
int choose;
int course;
char name[10];
while(1)
{
menu();
cin>>choose;
clear();
switch(choose)
{
case 1:
people.add_name_grade();break;
case 2:
cout<<"请输入班级号:";
cin>>grade;
clear();
cout<<"请输入学期:";
cin>>term;
clear();
if(term==1)
people.add_first(grade);
else
people.add_second(grade);
break;
case 3:
cout<<"请输入班级号:";
cin>>grade;
clear();
cout<<"请输入学生姓名:";
cin>>name;
clear();
people.modify(grade,name);
break;
case 4:
cout<<"请输入班级号:";
cin>>grade;
clear();
cout<<"请输入学期:";
cin>>term;
clear();
people.query_aver(grade,term);
break;
case 5:
cout<<"请输入班级号:";
cin>>grade;
clear();
people.query_grade(grade);
break;
case 6:
cout<<"请输入班级号:";
cin>>grade;
clear();
cout<<"请输入学期:";
cin>>term;
clear();
cout<<"请输入课程号(1:english,2:math):";
cin>>course;
people.show_fail(grade,term,course);
break;
case 7:
cout<<"请输入班级号:";
cin>>grade;
clear();
cout<<"请输入学生姓名:";
cin>>name;
clear();
people.query(grade,name);
break;
case 8:return;
default:cout<<"选择错误,请重新选择!"<<endl;
}
}
}
void menu()
{
cout<<" 请选择操作"<<endl;
cout<<"-------------------------------------------------------------"<<endl;
cout<<" 1、输入学生姓名、班级"<<endl;
cout<<" 2、按学期、班级录入学生成绩"<<endl;
cout<<" 3、修改学生成绩"<<endl;
cout<<" 4、按班级平均分对学生成绩排序"<<endl;
cout<<" 5、按班级输出学生的成绩单"<<endl;
cout<<" 6、按科目输出不及格学生名单"<<endl;
cout<<" 7、查询学生成绩单"<<endl;
cout<<" 8、退出系统"<<endl;
}
这上面是实现功能,下面是类的定义和声明 希望对你有用
struct term
{
int english;
int math;
int aver;
int total;
};
class stu
{
char name[10];
int grade;
struct term first;
struct term second;
public:
friend class stu_info;
void init_name_grade();
void init_first();
void init_second();
void show_grade();
void show_first();
void show_second();
};
class stu_info
{
stu per[100];
int num;
public:
stu_info();
void add_name_grade();
void add_first(int gra);
void add_second(int gra);
void query_aver(int gra,int term);
void modify(int gra,char name[10]);
void query(int gra,char name[10]);
void query_grade(int gra);
void show_fail(int grade,int term,int course);
};
❻ 求在线报名系统源代码
http://www.pangue.com/down.html
盘古教育通用报名系统是盘古教育网根据目前网上各种报名方式,综合各种行业开发出来的一套能够适用于学校,企业,培训机构的在线电子报名系统!
一、自定义无限级报名学科分类;
二、设置报名者在报名时候必须提交的信息;
三、在线邮件/QQ回复报名者;
四、并可以将任意报名学科/类型的报名者信息导出到本地电脑,让你不上网也可以随时随时察看;
五、强大的系统还原功能,让你的系统能够还原到任意还原点,是你系统数据安全的有力保证!
v2.0升级说明:
增加了免费用户发邮件的功能,3种邮件发送方式
Setup程序自动安装系统。
❼ 学生管理系统php源码谁有
php学生管理系统源码,供大家参考,具体内容如下
功能:
1.添加/删除/修改
2.数据存储.
界面分布:
index.php
--->主界面
add.php --->stu添加
action ---> sql中add/del/update
(处理html表单-->mysql的数据存储 && 页面跳转)
edit.php --->stu修改
menu.php
-->首页
1. index.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>学生信息管理</title>
<script>
function doDel(id) {
if(confirm('确认删除?')) {
window.location='action.php?action=del&id='+id;
}
}
</script>
</head>
<body>
<center>
<?php
include ("menu.php");
?>
<h3>浏览学生信息</h3>
<table width="500" border="1">
<tr>
<th>ID</th>
<th>姓名</th>
<th>性别</th>
<th>年龄</th>
<th>班级</th>
<th>操作</th>
</tr>
<?php
// 1. 链接数据库
try{
$pdo = new PDO("uri:mysqlPdo.ini","root","1");
}catch (PDOException $e) {
die('connection failed'.$e->getMessage());
}
//2.执行sql
$sql_select = "select * from stu";
//3.data 解析
foreach ( $pdo->query($sql_select) as $row) {
echo "<tr>";
echo "<th>{$row['id']} </th>";
echo "<th>{$row['name']}</th>";
echo "<th>{$row['sex']} </th>";
echo "<th>{$row['age']} </th>";
echo "<th>{$row['classid']}</th>";
echo "<td>
<a href='edit.php?id={$row['id']}'>修改</a>
<a href='javascript:void(0);' onclick='doDel({$row['id']})'>删除</a>
</td>";
echo "</tr>";
}
?>
</table>
</center>
</body>
</html>
2. add.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>学生管理系统</title>
</head>
<body>
<center>
<?php include ('menu.php'); ?>
<h3>增加学生信息</h3>
<form action="action.php?action=add" method="post">
<table>
<tr>
<td>姓名</td>
<td><input type="text" name="name"></td>
</tr>
<tr>
<td>年龄</td>
<td><input type="text" name="age"></td>
</tr>
<tr>
<td>性别</td>
<td><input type="radio" name="sex" value="男">男</td>
<td><input type="radio" name="sex" value="女">女</td>
</tr>
<tr>
<td>班级</td>
<td><input type="text" name="classid"></td>
</tr>
<tr>
<!-- <td> </td>-->
<td><a href="index.php">返回</td>
<td><input type="submit" value="添加"></td>
<td><input type="reset" value="重置"></td>
</tr>
</table>
</form>
</center>
</body>
</html>
3. action.php
<?php
/**
* Created by PhpStorm.
* User: hyh
* Date: 16-7-7
* Time: 下午9:37
*/
//1. 链接数据库
try{
$pdo = new PDO("uri:mysqlPdo.ini","root","1");
}catch (PDOException $e) {
// echo 'Connection failed: ' . $e->getMessage();
die('connection failed'.$e->getMessage());
}
//2.action 的值做对操作
switch ($_GET['action']){
case 'add'://add
$name = $_POST['name'];
$sex = $_POST['sex'];
$age = $_POST['age'];
$classid = $_POST['classid'];
$sql = "insert into stu (name, sex, age, classid) values ('{$name}', '{$sex}','{$age}','{$classid}')";
$rw = $pdo->exec($sql);
if ($rw > 0){
echo "<script>alter('添加成功');</script>";
}else{
echo "<script>alter('添加失败');</script>";
}
header('Location: index.php');
break;
case 'del'://get
$id = $_GET['id'];
$sql = "delete from stu where id={$id}";
$rw = $pdo->exec($sql);
if ($rw > 0){
echo "<script>alter('删除成功');</script>";
}else{
echo "<script>alter('删除失败');</script>";
}
header('Location: index.php');
break;
case 'edit'://post
$id = $_POST['id'];
$name = $_POST['name'];
$age = $_POST['age'];
$classid = $_POST['classid'];
$sex = $_POST['sex'];
// echo $id, $age, $age, $name;
$sql = "update stu set name='{$name}', age={$age},sex='{$sex}',classid={$classid} where id={$id};";
// $sql = "update myapp.stu set name='jike',sex='女', age=24,classid=44 where id=17";
print $sql;
$rw = $pdo->exec($sql);
if ($rw > 0){
echo "<script>alter('更新成功');</script>";
}else{
echo "<script>alter('更新失败');</script>";
}
header('Location: index.php');
break;
default:
header('Location: index.php');
break;
}
4.edit.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>学生管理系统</title>
</head>
<body>
<center>
<?php include ('menu.php');
//1. 链接数据库
try{
$pdo = new PDO("uri:mysqlPdo.ini","root","1");
}catch (PDOException $e) {
die('connection failed'.$e->getMessage());
}
//2.执行sql
$sql_select = "select * from stu where id={$_GET['id']}";
$stmt = $pdo->query($sql_select);
if ($stmt->rowCount() >0) {
$stu = $stmt->fetch(PDO::FETCH_ASSOC); // 解析数据
}else{
die("no have this id:{$_GET['id']}");
}
?>
<h3>修改学生信息</h3>
<form action="action.php?action=edit" method="post">
<input type="hidden" name="id" value="<?php echo $stu['id'];?>">
<table>
<tr>
<td>姓名</td>
<td><input type="text" name="name" value="<?php echo $stu['name'];?>"></td>
</tr>
<tr>
<td>年龄</td>
<td><input type="text" name="age" value="<?php echo $stu['age'];?>"></td>
</tr>
<tr>
<td>性别</td>
<td>
<input type="radio" name="sex" value="男" <?php echo ($stu['sex'] == "男")? "checked":"";?> >男
</td>
<td>
<input type="radio" name="sex" value="女" <?php echo ($stu['sex'] == "女")? "checked":"";?> >女
</td>
</tr>
<tr>
<td>班级</td>
<td><input type="text" name="classid" value="<?php echo $stu['classid']?>"></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="更新"></td>
<td><input type="reset" value="重置"></td>
</tr>
</table>
</form>
</center>
<?php
?>
</body>
</html>
5. menu.php
<!DOCTYPE html>
<html lang="en">
<body>
<h2>学生管理系统</h2>
<a href="index.php"> 浏览学生</a>
<a href="add.php"> 添加学生</a>
<hr>
</body>
</html>
❽ 学生考试管理系统,JAva源代码
//主类EnglishTest——
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class EnglishTest extends JFrame
{
TestArea testPanel=null;
Container con=null;
public EnglishTest()
{
super("模拟考试");
testPanel=new TestArea();
con=getContentPane();
con.add(testPanel,BorderLayout.CENTER);
addWindowListener(new WindowAdapter()
{ public void windowClosing(WindowEvent e)
{ System.exit(0);
}
});
setVisible(true);
setBounds(60,40,660,460);
con.validate();
validate();
}
public static void main(String args[])
{
new EnglishTest();
}
}
//读取试题 ReadTestquestion
import java.io.*;
import java.util.*;
public class ReadTestquestion
{ String filename="",
correctAnswer="",
testContent="" ,
selection="" ;
int score=0;
long time=0;
boolean 完成考试=false;
File f=null;
FileReader in=null;
BufferedReader 读取=null;
public void setFilename(String name)
{ filename=name;
score=0;
selection="";
try {
if(in!=null&&读取!=null)
{
in.close();
读取.close();
}
f=new File(filename);
in=new FileReader(f);
读取=new BufferedReader(in);
correctAnswer=(读取.readLine()).trim();
String temp=(读取.readLine()).trim() ;
StringTokenizer token=new StringTokenizer(temp,":");
int hour=Integer.parseInt(token.nextToken()) ;
int minute=Integer.parseInt(token.nextToken());
int second=Integer.parseInt(token.nextToken());
time=1000*(second+minute*60+hour*60*60);
}
catch(Exception e)
{
testContent="没有选择试题";
}
}
public String getFilename()
{
return filename;
}
public long getTime()
{
return time;
}
public void set完成考试(boolean b)
{
完成考试=b;
}
public boolean get完成考试()
{
return 完成考试;
}
public String getTestContent()
{ try {
String s=null;
StringBuffer temp=new StringBuffer();
if(读取!=null)
{
while((s=读取.readLine())!=null)
{
if(s.startsWith("**"))
break;
temp.append("\n"+s);
if(s.startsWith("endend"))
{
in.close();
读取.close();
完成考试=true;
}
}
testContent=new String(temp);
}
else
{
testContent=new String("没有选择试题");
}
}
catch(Exception e)
{
testContent="试题内容为空,考试结束!!";
}
return testContent;
}
public void setSelection(String s)
{
selection=selection+s;
}
public int getScore()
{ score=0;
int length1=selection.length();
int length2=correctAnswer.length();
int min=Math.min(length1,length2);
for(int i=0;i<min;i++)
{ try{
if(selection.charAt(i)==correctAnswer.charAt(i))
score++;
}
catch( e)
{
i=0;
}
}
return score;
}20:10 03-8-31
public String getMessages()
{
int length1=selection.length();
int length2=correctAnswer.length();
int length=Math.min(length1,length2);
String message="正确答案:"+correctAnswer.substring(0,length)+"\n"+
"你的回答:"+selection+"\n";
return message;
}
}
//考试区域TestArea
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.io.*;
class FileName implements FilenameFilter
{
String str=null;
FileName (String s)
{
str="."+s;
}
public boolean accept(File dir,String name)
{
return name.endsWith(str);
}
}
public class TestArea extends JPanel implements ActionListener,ItemListener,Runnable
{
Choice list=null;
JTextArea 试题显示区=null,消息区=null;
JCheckBox box[];
JButton 提交该题答案,读取下一题,查看分数;
ReadTestquestion 读取试题=null;
JLabel welcomeLabel=null;
Thread countTime=null;
long time=0;
JTextField timeShow=null;
boolean 是否关闭计时器=false,
是否暂停计时=false;
JButton 暂停或继续计时=null;
public TestArea()
{
list= new Choice();
String 当前目录=System.getProperty("user.dir");
File dir=new File(当前目录);
FileName fileTxt=new FileName("txt");
String fileName[]=dir.list(fileTxt);
for(int i=0;i<fileName.length;i++)
{
list.add(fileName[i]);
}
试题显示区=new JTextArea(15,12);
试题显示区.setLineWrap(true);
试题显示区.setWrapStyleWord(true);
试题显示区.setFont(new Font("TimesRoman",Font.PLAIN,14));
试题显示区.setForeground(Color.blue);
消息区=new JTextArea(8,8);
消息区.setForeground(Color.blue);
消息区.setLineWrap(true);
消息区.setWrapStyleWord(true);
countTime=new Thread(this);
String s[]={"A","B","C","D"};
box=new JCheckBox[4];
for(int i=0;i<4;i++)
{
box[i]=new JCheckBox(s[i]);
}
暂停或继续计时=new JButton("暂停计时");
暂停或继续计时.addActionListener(this);
提交该题答案=new JButton("提交该题答案");
读取下一题=new JButton("读取第一题");
读取下一题.setForeground(Color.blue);
提交该题答案.setForeground(Color.blue);
查看分数=new JButton("查看分数");
查看分数.setForeground(Color.blue);
提交该题答案.setEnabled(false);
提交该题答案.addActionListener(this);
读取下一题.addActionListener(this);
查看分数.addActionListener(this);
list.addItemListener(this);
读取试题=new ReadTestquestion();
JPanel pAddbox=new JPanel();
for(int i=0;i<4;i++)
{
pAddbox.add(box[i]);
}
Box boxH1=Box.createVerticalBox(),
boxH2=Box.createVerticalBox(),
baseBox=Box.createHorizontalBox();
boxH1.add(new JLabel("选择试题文件"));
boxH1.add(list);
boxH1.add(new JScrollPane(消息区));
boxH1.add(查看分数);
timeShow=new JTextField(20);
timeShow.setHorizontalAlignment(SwingConstants.RIGHT);
timeShow.setEditable(false);
JPanel p1=new JPanel();
p1.add(new JLabel("剩余时间:"));
p1.add(timeShow);
p1.add(暂停或继续计时);
boxH1.add(p1);
boxH2.add(new JLabel("试题内容:"));
boxH2.add(new JScrollPane(试题显示区));
JPanel p2=new JPanel();
p2.add(pAddbox);
p2.add(提交该题答案);
p2.add(读取下一题);
boxH2.add(p2);
baseBox.add(boxH1);
baseBox.add(boxH2);
setLayout(new BorderLayout());
add(baseBox,BorderLayout.CENTER);
welcomeLabel=new JLabel("欢迎考试,提高英语水平",JLabel.CENTER);
welcomeLabel.setFont(new Font("隶书",Font.PLAIN,24));
welcomeLabel.setForeground(Color.blue);
add(welcomeLabel,BorderLayout.NORTH);
}
public void itemStateChanged(ItemEvent e)
{
timeShow.setText(null);
是否关闭计时器=false;
是否暂停计时=false;
暂停或继续计时.setText("暂停计时");
String name=(String)list.getSelectedItem();
读取试题.setFilename(name);
读取试题.set完成考试(false);
time=读取试题.getTime();
if(countTime.isAlive())
{
是否关闭计时器=true;
countTime.interrupt();
}
countTime=new Thread(this);
消息区.setText(null);
试题显示区.setText(null);
读取下一题.setText("读取第一题");
提交该题答案.setEnabled(false);
读取下一题.setEnabled(true);
welcomeLabel.setText("欢迎考试,你选择的试题:"+读取试题.getFilename());
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==读取下一题)
{
读取下一题.setText("读取下一题");
提交该题答案.setEnabled(true);
String contentTest=读取试题.getTestContent();
试题显示区.setText(contentTest);
消息区.setText(null);
读取下一题.setEnabled(false);
try {
countTime.start();
}
catch(Exception event)
{
}
}
if(e.getSource()==提交该题答案)
{
读取下一题.setEnabled(true);
提交该题答案.setEnabled(false);
String answer="?";
for(int i=0;i<4;i++)
{
if(box[i].isSelected())
{
answer=box[i].getText();
box[i].setSelected(false);
break;
}
}
读取试题.setSelection(answer);
}
if(e.getSource()==查看分数)
{
int score=读取试题.getScore();
String messages=读取试题.getMessages();
消息区.setText("分数:"+score+"\n"+messages);
}
if(e.getSource()==暂停或继续计时)
{
if(是否暂停计时==false)
{
暂停或继续计时.setText("继续计时");
是否暂停计时=true;
}
else if(是否暂停计时==true)
{
暂停或继续计时.setText("暂停计时");
是否暂停计时=false;
countTime.interrupt();
}
}
}
public synchronized void run()
{
while(true)
{
if(time<=0)
{
是否关闭计时器=true;
countTime.interrupt();
提交该题答案.setEnabled(false);
读取下一题.setEnabled(false);
timeShow.setText("用时尽,考试结束");
}
else if(读取试题.get完成考试())
{
是否关闭计时器=true;
timeShow.setText("考试效果:分数*剩余时间(秒)="+1.0*读取试题.getScore()*(time/1000));
countTime.interrupt();
提交该题答案.setEnabled(false);
读取下一题.setEnabled(false);
}
else if(time>=1)
{
time=time-1000;
long leftTime=time/1000;
long leftHour=leftTime/3600;
long leftMinute=(leftTime-leftHour*3600)/60;
long leftSecond=leftTime%60;
timeShow.setText(""+leftHour+"小时"+leftMinute+"分"+leftSecond+"秒");
}
try
{
Thread.sleep(1000);
}
catch(InterruptedException ee)
{
if(是否关闭计时器==true)
return ;
}
while(是否暂停计时==true)
{
try
{
wait();
}
catch(InterruptedException ee)
{
if(是否暂停计时==false)
{
notifyAll();
}
}
}
}
}
}