当前位置:网站首页>Unity SKFramework框架(十三)、Question 问题模块
Unity SKFramework框架(十三)、Question 问题模块
2022-07-02 09:45:00 【CoderZ1010】
目录
一、Questions Profile 问题配置文件
1.配置文件的创建
通过右键/Create/Question Profile菜单进行创建

2.配置文件的编辑

如图所示,模块中内置了五种题型,可以在配置文件中进行配置,分别是判断题、单选题、多选题、填空题、论述题,它们均继承自Question Base基类。

1).判断题

2).单选题

3).多选题

4).填空题

5).论述题

二、Questions Handler 问题处理器
1.初始化
QuestionsHandler包含两个构造函数
/// <summary>
/// 构造函数
/// </summary>
/// <param name="profile">问题配置文件</param>
public QuestionsHandler(QuestionsProfile profile)
/// <summary>
/// 构造函数
/// </summary>
/// <param name="resourcesPath">配置文件的路径</param>
public QuestionsHandler(string resourcesPath)2.Last、Next、Switch
/// <summary>
/// 上一题
/// </summary>
public QuestionBase Last()
/// <summary>
/// 下一题
/// </summary>
public QuestionBase Next()
/// <summary>
/// 根据题号切换到指定问题
/// </summary>
/// <param name="sequence">题号</param>
public QuestionBase Switch(int sequence)3.根据题号获取指定的问题
/// <summary>
/// 根据题号获取问题
/// </summary>
/// <typeparam name="T">题型</typeparam>
/// <param name="sequence">题号</param>
public T Get<T>(int sequence) where T : QuestionBase三、Example 示例
using UnityEngine;
using SK.Framework;
public class Example : MonoBehaviour
{
private QuestionsHandler handler;
private QuestionBase question;
private void Start()
{
handler = new QuestionsHandler("New Questions Profile");
}
private void OnGUI()
{
GUILayout.BeginHorizontal();
if (GUILayout.Button("Last", GUILayout.Width(200f), GUILayout.Height(50f)))
question = handler.Last();
if (GUILayout.Button("Next", GUILayout.Width(200f), GUILayout.Height(50f)))
question = handler.Next();
GUILayout.EndHorizontal();
if (question == null) return;
switch (question.Type)
{
case QuestionType.JUDGE: break;
case QuestionType.SINGLE_CHOICE:
GUILayout.Label(string.Format(" {0}.{1}", question.Sequence, question.Question));
GUILayout.BeginHorizontal();
if (GUILayout.Button("A")) Debug.Log(question.IsCorrect(0));
if (GUILayout.Button("B")) Debug.Log(question.IsCorrect(1));
if (GUILayout.Button("C")) Debug.Log(question.IsCorrect(2));
if (GUILayout.Button("D")) Debug.Log(question.IsCorrect(3));
GUILayout.EndHorizontal();
break;
case QuestionType.MULTIPLE_CHOICE: break;
case QuestionType.COMPLETION: break;
case QuestionType.ESSAY: break;
default: break;
}
}
}
边栏推荐
- Unity SKFramework框架(十九)、POI 兴趣点/信息点
- 3 a VTT terminal regulator ncp51200mntxg data
- 绕过ObRegisterCallbacks需要驱动签名方法
- Unforgettable Ali, 4 skills, 5 hr additional written tests, it's really difficult and sad to walk
- Jerry's watch time synchronization [chapter]
- 堆 AcWing 838. 堆排序
- Structured data, semi-structured data and unstructured data
- Floyd AcWing 854. Floyd finds the shortest path
- Analog to digital converter (ADC) ade7913ariz is specially designed for three-phase energy metering applications
- Typora+docsify quick start
猜你喜欢

Counter attack of flour dregs: MySQL 66 questions, 20000 words + 50 pictures in detail! A little six

三面阿里,有惊无险成功拿到offer定级P7,只能说是真的难

完全自主可控三维云CAD:CrownCAD便捷的命令搜索,快速定位所需命令具体位置。

JS6day(DOM结点的查找、增加、删除。实例化时间,时间戳,时间戳的案例,重绘和回流)

The coloring method determines the bipartite graph acwing 860 Chromatic judgement bipartite graph

C modifier
![[opencv learning] [image filtering]](/img/4c/fe22e9cdf531873a04a7c4e266228d.jpg)
[opencv learning] [image filtering]

Linear DP acwing 902 Shortest editing distance
![Jerry's watch modifies the alarm clock [chapter]](/img/d6/04fb8143027578bb707529a05db548.jpg)
Jerry's watch modifies the alarm clock [chapter]
![JDBC 预防sql注入问题与解决方法[PreparedStatement]](/img/32/f71f5a31cdf710704267ff100b85d7.png)
JDBC 预防sql注入问题与解决方法[PreparedStatement]
随机推荐
[opencv learning] [Canny edge detection]
Interesting interview questions
Interview questions for software testing - a collection of interview questions for large factories in 2022
Jerry's watch ringtone audition [article]
Oracle从入门到精通(第4版)
JDBC prevent SQL injection problems and solutions [preparedstatement]
spfa AcWing 852. SPFA judgement negative ring
三面阿里,有惊无险成功拿到offer定级P7,只能说是真的难
Record idea shortcut keys
spfa AcWing 851. SPFA finding the shortest path
Counting class DP acwing 900 Integer partition
West digital decided to raise the price of flash memory products immediately after the factory was polluted by materials
移动式布局(流式布局)
[opencv learning] [image histogram and equalization]
JS10day(api 阶段性完结,正则表达式简介,自定义属性,过滤敏感词案例,注册模块验证案例)
[opencv] [image gradient]
堆 AcWing 838. 堆排序
一些突然迸发出的程序思想(模块化处理)
Direct control PTZ PTZ PTZ PTZ camera debugging (c)
Execute any method of any class through reflection