当前位置:网站首页>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 : QuestionBase3、 ... 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;
}
}
}
边栏推荐
- Ltc3307ahv meets EMI standard, step-down converter qca7005-al33 phy
- Efficiency comparison between ArrayList and LinkedList
- Interval DP acwing 282 Stone merging
- Redis introduction, scenario and data type
- Interview questions for software testing - a collection of interview questions for large factories in 2022
- ASP. Net MVC default configuration, if any, jumps to the corresponding program in the specified area
- Direct control PTZ PTZ PTZ PTZ camera debugging (c)
- Jerry's weather code table [chapter]
- Typora+docsify quick start
- js5day(事件监听,函数赋值给变量,回调函数,环境对象this,全选反选案例,tab栏案例)
猜你喜欢

Js6day (search, add and delete DOM nodes. Instantiation time, timestamp, timestamp cases, redrawing and reflow)

spfa AcWing 851. SPFA finding the shortest path

js5day(事件监听,函数赋值给变量,回调函数,环境对象this,全选反选案例,tab栏案例)

The redis development document released by Alibaba covers all redis operations

日本赌国运:Web3.0 ,反正也不是第一次失败了!

Fully autonomous and controllable 3D cloud CAD: crowncad's convenient command search can quickly locate the specific location of the required command.

挥发性有机物TVOC、VOC、VOCS气体检测+解决方案

架构师必须了解的 5 种最佳软件架构模式

Apply lnk306gn-tl converter, non isolated power supply

Linear DP acwing 902 Shortest editing distance
随机推荐
Linear DP acwing 899 Edit distance
JSON serialization and parsing
面渣逆袭:MySQL六十六问,两万字+五十图详解!有点六
Use MySQL events to regularly perform post seven world line tasks
Jerry's weather code table [chapter]
Js1day (input / output syntax, data type, data type conversion, VaR and let differences)
PXE installation UOS prompt NFS over TCP not available from 10 x.x.x
Mui WebView down refresh pull-up load implementation
Everyone wants to eat a broken buffet. It's almost cold
8A 同步降压稳压器 TPS568230RJER_规格信息
Jerry's watch delete alarm clock [chapter]
Linear DP acwing 895 Longest ascending subsequence
Interview questions for software testing - a collection of interview questions for large factories in 2022
Std:: vector batch import fast de duplication method
Visual studio efficient and practical extension tools and plug-ins
[opencv learning] [common image convolution kernel]
[opencv learning] [moving object detection]
Hundreds of web page special effects can be used. Don't you come and have a look?
Jerry's watch reads the alarm clock [chapter]
Word efficiency guide - word's own template