当前位置:网站首页>Unity skframework framework (XIII), question module
Unity skframework framework (XIII), question module
2022-07-02 13:07:00 【CoderZ1010】
Catalog
One 、Questions Profile Problem profile
1. Creation of configuration file
Two 、Questions Handler Problem processor
3. Get the specified question according to the question number
One 、Questions Profile Problem profile
1. Creation of configuration file
Right click /Create/Question Profile Menu to create
2. Edit profile
As shown in the figure , Five question types are built into the module , It can be configured in the configuration file , Namely Judgment questions 、 Single topic selection 、 Multiple choice 、 Completion 、 A treatise , They all inherit from Question Base Base class .
1). Judgment questions
2). Single topic selection
3). Multiple choice
4). Completion
5). A treatise
Two 、Questions Handler Problem processor
1. initialization
QuestionsHandler Contains two constructors
/// <summary>
/// Constructors
/// </summary>
/// <param name="profile"> Problem profile </param>
public QuestionsHandler(QuestionsProfile profile)
/// <summary>
/// Constructors
/// </summary>
/// <param name="resourcesPath"> The path to the configuration file </param>
public QuestionsHandler(string resourcesPath)
2.Last、Next、Switch
/// <summary>
/// Last question
/// </summary>
public QuestionBase Last()
/// <summary>
/// Next question
/// </summary>
public QuestionBase Next()
/// <summary>
/// Switch to the designated question according to the question number
/// </summary>
/// <param name="sequence"> Question no </param>
public QuestionBase Switch(int sequence)
3. Get the specified question according to the question number
/// <summary>
/// Get the question according to the question number
/// </summary>
/// <typeparam name="T"> Question type </typeparam>
/// <param name="sequence"> Question no </param>
public T Get<T>(int sequence) where T : QuestionBase
3、 ... and 、Example 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;
}
}
}
边栏推荐
- Redis introduction, scenario and data type
- [opencv learning] [moving object detection]
- Jerry's watch gets the default ringtone selection list [article]
- 阿里发布的Redis开发文档,涵盖了所有的redis操作
- 获取文件版权信息
- 3 a VTT terminal regulator ncp51200mntxg data
- Wechat official account payment prompt MCH_ ID parameter format error
- 难忘阿里,4面技术5面HR附加笔试面,走的真艰难真心酸
- Heap acwing 838 Heap sort
- . Net, C # basic knowledge
猜你喜欢
完全自主可控三维云CAD:CrownCAD便捷的命令搜索,快速定位所需命令具体位置。
上海交大教授:何援军——包围盒(包容体/包围盒子)
JS8day(滚动事件(scroll家族),offset家族,client家族,轮播图案例(待做))
嵌入式软件开发
Js1day (syntaxe d'entrée / sortie, type de données, conversion de type de données, Var et let différenciés)
Fundamentals of face recognition (facenet)
面渣逆袭:MySQL六十六问,两万字+五十图详解!有点六
The redis development document released by Alibaba covers all redis operations
[200 opencv routines] 100 Adaptive local noise reduction filter
架构师必须了解的 5 种最佳软件架构模式
随机推荐
PR usage skills, how to use PR to watermark?
Unity SKFramework框架(二十)、VFX Lab 特效库
js1day(输入输出语法,数据类型,数据类型转换,var和let区别)
上海交大教授:何援军——包围盒(包容体/包围盒子)
Traverse entrylist method correctly
8 examples of using date commands
Fully autonomous and controllable 3D cloud CAD: crowncad's convenient command search can quickly locate the specific location of the required command.
Unity SKFramework框架(十九)、POI 兴趣点/信息点
Obtain file copyright information
Heap acwing 838 Heap sort
Modular commonjs es module
Floyd AcWing 854. Floyd finds the shortest path
. Net wechat message template push
绕过ObRegisterCallbacks需要驱动签名方法
Js4day (DOM start: get DOM element content, modify element style, modify form element attributes, setinterval timer, carousel Map Case)
Analog to digital converter (ADC) ade7913ariz is specially designed for three-phase energy metering applications
Js5day (event monitoring, function assignment to variables, callback function, environment object this, select all, invert selection cases, tab column cases)
(7) Web security | penetration testing | how does network security determine whether CND exists, and how to bypass CND to find the real IP
[opencv learning] [image filtering]
Jerry's watch reads the alarm clock [chapter]