You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
377 lines
11 KiB
377 lines
11 KiB
3 years ago
|
using UnityEngine;
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine.SceneManagement;
|
||
|
using System;
|
||
|
using AX.NetworkSystem;
|
||
|
public enum BuildType
|
||
|
{
|
||
|
None = 0,
|
||
|
TypeA = 1,
|
||
|
TypeB = 2,
|
||
|
TypeC=3,
|
||
|
TypeD=4,
|
||
|
TypeE = 5,
|
||
|
TypeF = 6,
|
||
|
TypeG=7,
|
||
|
TypeH=8,
|
||
|
TypeOne=9
|
||
|
}
|
||
|
|
||
|
public class ExamInfoHelpClass
|
||
|
{
|
||
|
public static long ExamID = 3;//考试ID
|
||
|
public static long QuestionID = 1;//考题ID
|
||
|
public static long ExamineeID = 1;//考生ID
|
||
|
public static int DisasterID = 0;//灾情ID
|
||
|
private static List<AnswerInfo_o> AnswerList = new List<AnswerInfo_o>();
|
||
|
public static void AddAnswerToList(AnswerInfo_o answer)
|
||
|
{
|
||
|
if (!AnswerList.Contains(answer))
|
||
|
{
|
||
|
AnswerList.Add(answer);
|
||
|
}
|
||
|
}
|
||
|
public static List<AnswerInfo_o> GetAnswerList()
|
||
|
{
|
||
|
return AnswerList;
|
||
|
}
|
||
|
public static string CurrentWorkPath;//Application.dataPath + @"/ExtendFolder/xml/"+MySelf.mySelf.ID+"/"
|
||
|
public static string NameListWorkPath;
|
||
|
public static string savexmlWorkPath;
|
||
|
public static string VideoFilePath = Application.dataPath + @"/Resources/VideoFilePath/";
|
||
|
public static string PictureFilePath = Application.dataPath + @"/Resources/PictureFilePath/";
|
||
|
|
||
|
public enum ApplicationMode : int
|
||
|
{
|
||
|
|
||
|
NONE = 0,
|
||
|
SANDTABLE = 1,//沙盘模式
|
||
|
PATHFINDING = 2//寻路模式
|
||
|
}
|
||
|
public static ApplicationMode applicationMode = ApplicationMode.PATHFINDING;//选择沙盘模式或寻路模式时要给该变量赋值
|
||
|
|
||
|
/// <summary>
|
||
|
/// 场景枚举
|
||
|
/// </summary>
|
||
|
public enum Scene : int
|
||
|
{
|
||
|
大跨度 = 0,
|
||
|
人员密集 = 9,
|
||
|
地下建筑 = 2,
|
||
|
高层 = 11,
|
||
|
工厂 = 4,
|
||
|
危化品 = 5,
|
||
|
隧道 = 6,
|
||
|
土坡房 =7,
|
||
|
工厂卡贝拉 = 8,
|
||
|
空 =10
|
||
|
}
|
||
|
public enum MoreKindSence : int
|
||
|
{
|
||
|
None=0,
|
||
|
More=1
|
||
|
}
|
||
|
public static MoreKindSence MoreKind = MoreKindSence.None;
|
||
|
public static Scene selectSceneID = Scene.空;//选择场景时要将该项赋值
|
||
|
|
||
|
public enum LoadSceneMode : int
|
||
|
{
|
||
|
None = 0,// 空
|
||
|
ExamineMode = 1,//开始答题,自动开始轨迹记录 考核模式
|
||
|
CheckQuestion = 2,//查看考题,不记录
|
||
|
EditQuestion=14,//编辑考题模式,不用重新申请考题ID
|
||
|
CopyQuestion = 15,//复制考题模式,重新申请考题ID
|
||
|
CreatQuestion = 3,//创建考题,要提供灾情设置工具栏
|
||
|
MakeScore = 4,//考官评分,只需要提供轨迹记录添加标签功能
|
||
|
CheckScore = 5,//查看评分,要罗列所有评分记录
|
||
|
CheckAnswer = 6,//查看作答,开始回放该条记录即可
|
||
|
|
||
|
PrepareMode=7,//备课
|
||
|
TeachMode = 8,//授课模式
|
||
|
SelfStudyMode=10,//自学模式
|
||
|
CoursewareMode = 11,//自学课件模式
|
||
|
CourseBaseMode=12,//课件库
|
||
|
PrepareModeLook = 13,//备课查看
|
||
|
EditCourceware=16//编辑课件模式
|
||
|
}
|
||
|
public static LoadSceneMode loadSceneMode = LoadSceneMode.None;
|
||
|
public enum TaskFunc : int
|
||
|
{
|
||
|
情景教学 = 0,
|
||
|
对抗教学,
|
||
|
考题设置,
|
||
|
理论知识学习,
|
||
|
情景学习,
|
||
|
理论知识考核,
|
||
|
情景考核,
|
||
|
成绩评定
|
||
|
}
|
||
|
public static TaskFunc selectTaskFunc = TaskFunc.情景教学;
|
||
|
|
||
|
public enum Role : int
|
||
|
{
|
||
|
考官 = 0,
|
||
|
学员 = 1,
|
||
|
评委 = 2
|
||
|
}
|
||
|
public static Role selectRole = Role.考官;//角色
|
||
|
|
||
|
/// <summary>
|
||
|
/// 每次提交答案时调用该方法生成答案文件名字
|
||
|
/// </summary>
|
||
|
/// <returns></returns>
|
||
|
public static string GenerateAnswerName()
|
||
|
{
|
||
|
string answerName = "";
|
||
|
return answerName;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public class MyEventArgs : EventArgs
|
||
|
{
|
||
|
public string sourceScene;//源场景
|
||
|
public string destinateScene;//目标场景
|
||
|
public MyEventArgs(string sourceScene,string destinateScene)
|
||
|
{
|
||
|
this.sourceScene = sourceScene;
|
||
|
this.destinateScene = destinateScene;
|
||
|
}
|
||
|
}
|
||
|
public class MySceneManager : SceneManager
|
||
|
{
|
||
|
public static List<string> SceneList = new List<string>();
|
||
|
private static MySceneManager instance;
|
||
|
public delegate void MyEventHandler(MyEventArgs args);
|
||
|
public static event MyEventHandler BackToLastSceneEvent;
|
||
|
public static MySceneManager GetInstance()
|
||
|
{
|
||
|
if(null == instance)
|
||
|
{
|
||
|
instance = new MySceneManager();
|
||
|
}
|
||
|
return instance;
|
||
|
}
|
||
|
|
||
|
public static void AddSceneToList(string sceneName)
|
||
|
{
|
||
|
if (!SceneList.Contains(sceneName))
|
||
|
{
|
||
|
SceneList.Add(sceneName);
|
||
|
}
|
||
|
}
|
||
|
public static void MyLoadScene(string sceneName)
|
||
|
{
|
||
|
AddSceneToList(sceneName);
|
||
|
int i;
|
||
|
if (int.TryParse(sceneName, out i))
|
||
|
{
|
||
|
SceneProgressBar.SceneName = sceneName.ToString();
|
||
|
LoadScene("LoadSence");
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
LoadScene(sceneName);
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
//public stat
|
||
|
public static void BackToLastScene()
|
||
|
{
|
||
|
Debug.Log(SceneList.Count);
|
||
|
if (SceneList.Count > 1)
|
||
|
{
|
||
|
var source = SceneList[SceneList.Count - 1];
|
||
|
|
||
|
//SceneList.Remove(SceneList[SceneList.Count - 1]);
|
||
|
|
||
|
var destinate = SceneList[SceneList.Count - 2];
|
||
|
if (BackToLastSceneEvent != null)
|
||
|
{
|
||
|
BackToLastSceneEvent(new MyEventArgs(source, destinate));
|
||
|
}
|
||
|
if (source == "StartExam" && destinate == "ModeSelect")
|
||
|
{
|
||
|
if (TimeManager.CurExam != null)
|
||
|
{
|
||
|
Debug.Log("退出前请提交当前考试!");
|
||
|
return;
|
||
|
}
|
||
|
}
|
||
|
SceneList.Remove(SceneList[SceneList.Count - 1]);
|
||
|
LoadScene(SceneList[SceneList.Count - 1]);
|
||
|
if (destinate == "Login")
|
||
|
{
|
||
|
NetworkManager.Default.SendRequestAsync("LOGOUT_REQUEST", MySelf.mySelf.ID);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
//public struct CourseWareInfo
|
||
|
//{
|
||
|
// public string CourseWareID;//课件ID
|
||
|
// public string CourseWareName;//课件名称
|
||
|
// public string CourseWareCreatorID;//创建者ID
|
||
|
// public string CourseWareCreatorName;//创建者名字
|
||
|
// public string CourseWareCreateTime;//创建时间
|
||
|
// public string CourseWareSize;//课件大小(所有文件大小总和)
|
||
|
// public string CourseWareSceneID;//课件场景ID
|
||
|
// public string CourseWareXmlNames;//包含的所有xml文件名
|
||
|
// public string CourseWareXmlPaths;//包含的所有xml文件路径
|
||
|
//}
|
||
|
/// <summary>
|
||
|
/// 考试信息
|
||
|
/// </summary>
|
||
|
public class ExaminationInfo
|
||
|
{
|
||
|
public long ID { get; set; }
|
||
|
public string Name { get; set; }
|
||
|
public string CreatorID { get; set; }
|
||
|
public string CreatorName { get; set; }
|
||
|
public DateTime CreateTime { get; set; }
|
||
|
public DateTime StartingTime { get; set; }
|
||
|
public DateTime Deadline { get; set; }
|
||
|
public int Duration { get; set; }
|
||
|
public DateTime MarkingDeadline { get; set; }
|
||
|
//public string Examinees { get; set; }
|
||
|
//public string NeedCheckingExaminees { get; set; }
|
||
|
public long PaperID { get; set; }
|
||
|
public List<QuestionInfo> QuestionInfos { get; set; }
|
||
|
public List<AnswerInfo> AnswerInfos { get; set; }
|
||
|
public List<ScoreInfo> ScoreInfos { get; set; }
|
||
|
public int Pattern { get; set; }
|
||
|
}
|
||
|
/// <summary>
|
||
|
/// 考题信息
|
||
|
/// </summary>
|
||
|
public class QuestionInfo
|
||
|
{
|
||
|
public long ID { get; set; }
|
||
|
public string Name { get; set; }
|
||
|
public int SceneType { get; set; }
|
||
|
public string CreatorID { get; set; }
|
||
|
public string CreatorName { get; set; }
|
||
|
public DateTime CreateTime { get; set; }
|
||
|
public string FilePath { get; set; }
|
||
|
public string Intro { get; set; }
|
||
|
public int Pattern{ get; set; }
|
||
|
}
|
||
|
/// <summary>
|
||
|
/// 考题、答案、评分 信息汇总
|
||
|
/// </summary>
|
||
|
public class ItemInfo
|
||
|
{
|
||
|
//考题相关
|
||
|
public string Name { get; set; }
|
||
|
public int SceneType { get; set; }
|
||
|
public string CreatorID { get; set; }
|
||
|
public string CreatorName { get; set; }
|
||
|
public DateTime CreateTime { get; set; }
|
||
|
public string FilePath { get; set; }
|
||
|
//答案相关
|
||
|
public long ExaminationID { get; set; }
|
||
|
public long PaperID { get; set; }
|
||
|
public long QuestionID { get; set; }
|
||
|
//评分相关
|
||
|
public string Score { get; set; }
|
||
|
public long AnswerID { get; set; }
|
||
|
public long ScoreID { get; set; }
|
||
|
}
|
||
|
/// <summary>
|
||
|
/// 答案信息
|
||
|
/// </summary>
|
||
|
public class AnswerInfo
|
||
|
{
|
||
|
public long ID { get; set; }
|
||
|
public string FilePath { get; set; }
|
||
|
public string CreatorID { get; set; }
|
||
|
public string CreatorName { get; set; }
|
||
|
public DateTime CreateTime { get; set; }
|
||
|
public long ExaminationID { get; set; }
|
||
|
public long PaperID { get; set; }
|
||
|
public long QuestionID { get; set; }
|
||
|
}
|
||
|
/// <summary>
|
||
|
/// 评分信息
|
||
|
/// </summary>
|
||
|
public partial class ScoreInfo
|
||
|
{
|
||
|
public long ID { get; set; }
|
||
|
public string Score { get; set; }
|
||
|
public string FilePath { get; set; }
|
||
|
public string CreatorID { get; set; }
|
||
|
public string CreatorName { get; set; }
|
||
|
public DateTime CreateTime { get; set; }
|
||
|
public long ExaminationID { get; set; }
|
||
|
public long PaperID { get; set; }
|
||
|
public long AnswerID { get; set; }
|
||
|
public long QuestionID { get; set; }
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
public struct ExamInfo
|
||
|
{
|
||
|
public string ExamName;
|
||
|
public string ExamID;
|
||
|
public string StartTime;
|
||
|
public string EndTime;
|
||
|
public string DurationTime;
|
||
|
|
||
|
public List<QuestionInfo_o> QuestionList;// = new List<QuestionInfo>();
|
||
|
}
|
||
|
|
||
|
public struct QuestionInfo_o//代表考题信息类,也代表考生信息类
|
||
|
{
|
||
|
public string QuestionID;
|
||
|
public string QuestionName;
|
||
|
public string QuestionXMLPath;
|
||
|
public string SceneID;
|
||
|
}
|
||
|
public struct AnswerInfo_o
|
||
|
{
|
||
|
public string AnswerID;
|
||
|
//public string AnswerName;
|
||
|
public string ExamID;
|
||
|
public string QuestionID;
|
||
|
public string ExamineeID;
|
||
|
public string AnswerXmlPath;
|
||
|
}
|
||
|
public struct ScoreInfo_o
|
||
|
{
|
||
|
public string ScoreID;
|
||
|
public string AnswerID;
|
||
|
public string MakeScorerID;//评分者ID
|
||
|
public string MakeScorerName;//评分者名字
|
||
|
//public string AnswerName;
|
||
|
public string Score;
|
||
|
public string ScoreXmlPath;
|
||
|
public string CreateTime;//该答案的创建时间
|
||
|
}
|
||
|
/// <summary>
|
||
|
/// 评分信息类,本地数据库维护一份,对应评分数据库表结构
|
||
|
/// (因为只在本地维护这一份表,所以拉取信息很全,全部保存在一条记录中)
|
||
|
/// </summary>
|
||
|
public struct ExamRecordInfo
|
||
|
{
|
||
|
public string ExamRecordID;
|
||
|
public string ExamID;
|
||
|
public string ExamName;
|
||
|
public string ExamStartTime;
|
||
|
public string ExamDurationTime;
|
||
|
public string ExamEndTime;
|
||
|
public string QuestionID;
|
||
|
public string QuestionName;
|
||
|
public string QuestionSceneID;
|
||
|
//public string AnswerID;
|
||
|
public string MakeScorerID;//评分者ID
|
||
|
public string MakeScorerName;//评分者名字
|
||
|
//public string QuestionXmlPath;
|
||
|
public string Score;
|
||
|
public string ScoreXmlPath;
|
||
|
}
|
||
|
|
||
|
|