当前位置:网站首页>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;
}
}
}
边栏推荐
- 阿里发布的Redis开发文档,涵盖了所有的redis操作
- 面渣逆袭:MySQL六十六问,两万字+五十图详解!有点六
- Some sudden program ideas (modular processing)
- 一些突然迸发出的程序思想(模块化处理)
- [opencv learning] [Canny edge detection]
- Word efficiency guide - word's own template
- About wechat enterprise payment to change x509certificate2 read certificate information, publish to the server can not access the solution
- Jerry's watch stops ringing [article]
- Js2day (also i++ and ++i, if statements, ternary operators, switch, while statements, for loop statements)
- Redis introduction, scenario and data type
猜你喜欢
![Jerry's watch time synchronization [chapter]](/img/64/a48772b4e503ae0a2d36fc292e4e0d.jpg)
Jerry's watch time synchronization [chapter]

bellman-ford AcWing 853. Shortest path with side limit

Unity SKFramework框架(十六)、Package Manager 开发工具包管理器

Js4day (DOM start: get DOM element content, modify element style, modify form element attributes, setinterval timer, carousel Map Case)

spfa AcWing 851. SPFA finding the shortest path

West digital decided to raise the price of flash memory products immediately after the factory was polluted by materials

阿里初面被两道编程题给干掉,再次内推终上岸(已拿电子offer)

Word efficiency guide - word's own template

Heap acwing 839 Simulated reactor
![[opencv learning] [moving object detection]](/img/2e/9b437b7fe22f1d57334529eda68e37.jpg)
[opencv learning] [moving object detection]
随机推荐
The coloring method determines the bipartite graph acwing 860 Chromatic judgement bipartite graph
基于STM32的OLED 屏幕驱动
VIM super practical guide collection of this one is enough
[opencv learning] [moving object detection]
js1day(输入输出语法,数据类型,数据类型转换,var和let区别)
Ali was killed by two programming problems at the beginning, pushed inward again, and finally landed (he has taken an electronic offer)
Direct control PTZ PTZ PTZ PTZ camera debugging (c)
Finally, someone explained the supervised learning clearly
Ali on three sides, it's really difficult to successfully get the offer rated P7
Mobile layout (flow layout)
Traverse entrylist method correctly
PXE installation UOS prompt NFS over TCP not available from 10 x.x.x
Redis sentinel mechanism and configuration
Unity SKFramework框架(二十一)、Texture Filter 贴图资源筛选工具
Analog to digital converter (ADC) ade7913ariz is specially designed for three-phase energy metering applications
[opencv learning] [image histogram and equalization]
Counter attack of flour dregs: MySQL 66 questions, 20000 words + 50 pictures in detail! A little six
Async/await asynchronous function
Js8day (rolling event (scroll family), offset family, client family, carousel map case (to be done))
Redis transaction mechanism implementation process and principle, and use transaction mechanism to prevent inventory oversold