当前位置:网站首页>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;
}
}
}
边栏推荐
- Do you know all the interface test interview questions?
- [error record] cannot open "XXX" because Apple cannot check whether it contains malware
- [opencv learning] [moving object detection]
- [opencv learning] [image filtering]
- Js6day (search, add and delete DOM nodes. Instantiation time, timestamp, timestamp cases, redrawing and reflow)
- ArrayList与LinkedList效率的对比
- 一些突然迸发出的程序思想(模块化处理)
- Linear DP acwing 902 Shortest editing distance
- (6) Web security | penetration test | network security encryption and decryption ciphertext related features, with super encryption and decryption software
- Some sudden program ideas (modular processing)
猜你喜欢

Linear DP acwing 896 Longest ascending subsequence II

上海交大教授:何援军——包围盒(包容体/包围盒子)

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

Js7day (event object, event flow, event capture and bubble, prevent event flow, event delegation, student information table cases)

Js5day (event monitoring, function assignment to variables, callback function, environment object this, select all, invert selection cases, tab column cases)
![[200 opencv routines] 100 Adaptive local noise reduction filter](/img/89/9e9b667dd28cb25af005b6028ef26c.jpg)
[200 opencv routines] 100 Adaptive local noise reduction filter

JS7day(事件对象,事件流,事件捕获和冒泡,阻止事件流动,事件委托,学生信息表案例)

net share

(7) Web security | penetration testing | how does network security determine whether CND exists, and how to bypass CND to find the real IP

Linear DP acwing 902 Shortest editing distance
随机推荐
[error record] cannot open "XXX" because Apple cannot check whether it contains malware
C modifier
面渣逆袭:MySQL六十六问,两万字+五十图详解!有点六
West digital decided to raise the price of flash memory products immediately after the factory was polluted by materials
Unity SKFramework框架(二十一)、Texture Filter 贴图资源筛选工具
[opencv learning] [contour detection]
Js6day (search, add and delete DOM nodes. Instantiation time, timestamp, timestamp cases, redrawing and reflow)
Floyd AcWing 854. Floyd finds the shortest path
Get started REPORT | today, talk about the microservice architecture currently used by Tencent
Jerry's watch ringtone audition [article]
腾讯三面:进程写文件过程中,进程崩溃了,文件数据会丢吗?
三面阿里,有惊无险成功拿到offer定级P7,只能说是真的难
传感器 ADXL335BCPZ-RL7 3轴 加速度计 符合 RoHS/WEEE
Js1day (syntaxe d'entrée / sortie, type de données, conversion de type de données, Var et let différenciés)
上手报告|今天聊聊腾讯目前在用的微服务架构
Jerry's watch delete alarm clock [chapter]
. Net wechat message template push
Js3day (array operation, JS bubble sort, function, debug window, scope and scope chain, anonymous function, object, Math object)
Ltc3307ahv meets EMI standard, step-down converter qca7005-al33 phy
[opencv learning] [image filtering]