当前位置:网站首页>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;
}
}
}
边栏推荐
- About the loading of layer web spring layer components, the position of the layer is centered
- JS6day(DOM结点的查找、增加、删除。实例化时间,时间戳,时间戳的案例,重绘和回流)
- Linear DP acwing 897 Longest common subsequence
- Analog to digital converter (ADC) ade7913ariz is specially designed for three-phase energy metering applications
- NTMFS4C05NT1G N-CH 30V 11.9A MOS管,PDF
- Unity SKFramework框架(十七)、FreeCameraController 上帝视角/自由视角相机控制脚本
- 难忘阿里,4面技术5面HR附加笔试面,走的真艰难真心酸
- Fundamentals of face recognition (facenet)
- [opencv learning] [contour detection]
- Std:: vector batch import fast de duplication method
猜你喜欢
![[error record] cannot open](/img/d3/0435ae698ad635be71729c7c047a22.jpg)
[error record] cannot open "XXX" because Apple cannot check whether it contains malware

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

Hash table acwing 840 Simulated hash table

3 A VTT端接 稳压器 NCP51200MNTXG资料

Mobile layout (flow layout)

Floyd AcWing 854. Floyd finds the shortest path

Ali was killed by two programming problems at the beginning, pushed inward again, and finally landed (he has taken an electronic offer)

spfa AcWing 852. SPFA judgement negative ring

自主可控三维云CAD:CrownCAD赋能企业创新设计

Hash table acwing 841 String hash
随机推荐
Package management tools
Finally, someone explained the supervised learning clearly
net share
Floyd AcWing 854. Floyd finds the shortest path
Rust语言文档精简版(上)——cargo、输出、基础语法、数据类型、所有权、结构体、枚举和模式匹配
Counter attack of flour dregs: MySQL 66 questions, 20000 words + 50 pictures in detail! A little six
ADB basic commands
Jerry's watch time synchronization [chapter]
[opencv learning] [contour detection]
Linear DP acwing 898 Number triangle
C#运算符
The redis development document released by Alibaba covers all redis operations
Apply lnk306gn-tl converter, non isolated power supply
Oracle从入门到精通(第4版)
Ruby: how to copy variables without pointing to the same object- Ruby: how can I copy a variable without pointing to the same object?
JS generates 4-digit verification code
Js2day (also i++ and ++i, if statements, ternary operators, switch, while statements, for loop statements)
Post order traversal sequence of 24 binary search tree of sword finger offer
Direct control PTZ PTZ PTZ PTZ camera debugging (c)
Do you know all the interface test interview questions?