寻找构建“TestMaker”的技巧(问题与回应)带有评估引擎的应用程序

发布于 2024-12-13 10:51:41 字数 2689 浏览 3 评论 0原文

我正在做一个新项目。 我最好的比喻是心理评估测试者。

方面#1。 最终业务用户需要创建测试问题。与问题类型。以及适用时对问题的可能回答。

示例:

1.  Do you have red hair?  (T/F)

2.  What is your favorite color?  (Single Response/Multiple Choice)
    (Possible Responses: Red, Yellow, Black, White)

3.  What size shoe do you wear (rounded to next highest size)?  (Integer)

4.  How much money do you have on you right now?  (Dollar Amount (decimal))

因此,我需要能够创建问题、问题类型以及某些问题的可能答案。

这里:

数字 1 是“对或错”的已知类型。

第 2 种是“单一响应/多项选择”的已知类型,最终业务用户将创建可能的响应。

数字 3 是已知的“整数”类型。最终用户(接受评估的人)基本上可以输入任何整数值。

数字 4 是一种已知的“十进制”类型。与整数相同。

方面#2。 最终业务用户需要评估此人的响应。并将一些标量值分配给一组响应。

示例:

如果有人回答:

1.  T
2.  Red
3.  >=8
4.  (Not considered for this situation)

一些精神科医生专家发现,如果有人回答上述问题,那么您患抑郁症的风险比正常人高出 85%。 (其中 85% 是最终业务用户(精神病学家)可以作为参数输入的数字。

因此,方面 #2 正在运行某人的响应,并确定结果。

必须设置“响应网格”,以便它将按优先级排序顺序遍历(部分或全部)可能性,然后在满足所有条件(在单行上)后,退出结果

如下:

(1.) T     (2.) Red       (3.) >=8    ... Result = 85%
(1.) T     (2.) Yellow    (3.) >=8    ... Result = 70%
(1.) F     (2.) Red       (3.) >=8    ... Result = 50%
(1.) F     (2.) Yellow    (3.) >=8    ... Result = 40%

一旦找到匹配项,您就会以百分比退出 。如果你没有找到。 另外,运行

这个心理评估模拟示例,我不需要定义每个排列的心理评估问题,它们只是“绒毛”。在上面的网格中,我故意遗漏了问题#4。它与结果无关。

也可以有一个“这个人认真对待这个问题吗?”的评估网格:(

(3.) >=20    (4.) >=$1,000    ... Result = False

鞋码的可能性>= 20岁并且拥有大量资金你口袋里的压力非常低,因此你可能没有认真对待心理测试。)

如果没有找到规则(在我的真实应用程序中,而不是这个模型),我会抛出异常或只是不在乎。我不需要默认或失败规则。 在上面,红色和黄色是“令人担忧”的最喜欢的颜色。如果您最喜欢的颜色是黑色或白色,则它与您的抑郁症风险因素无关。

我过去曾使用过业务规则引擎。 (例如 InRule)。 它们非常昂贵,而且不在预算之内。

BizTalk 业务规则框架是一种可能性。不理想,但可能。

我对任何规则引擎的问题是“词汇表”(请注意,我对业务规则引擎的经验有限)是基于具有静态属性的对象。

public class Employee
{
        public string LastName
        { get; set; }

        public DateTime HireDate
        { get; set; }

        public decimal AnnualSalary
        { get; set; }

        public void AdjustSalary(int percentage)
        {
            this.AdjustSalary= this.AdjustSalary + (this.AdjustSalary * percentage);
        }

}

这将很容易创建业务规则。

If 
        the (Employee's HireDate) is before (10 years ago) 

then 
        (Increase Their Salary) By (5) Percent.)

else
        (Increase Their Salary) By (3) Percent.)

但在我的情况下,测试由(动态)问题和(动态)响应组成,而不是预先确定的属性。

所以我想我正在寻找一些想法来研究如何实现这一目标。

我知道我可以相当快地构建一个“TestMaker”应用程序。

最大的问题是将问题和(可能的回答)整合到“评估规则”中。

感谢您的任何提示。

技术: DotNet 4.0 框架 Sql Server 2008 后端数据库 VS2010专业版,C#

I'm working on a new project.
My best analogy would be a psychological evaluation test maker.

Aspect #1.
The end-business-user needs to create test questions. With question types. And possible responses to the questions when applicable.

Examples:

1.  Do you have red hair?  (T/F)

2.  What is your favorite color?  (Single Response/Multiple Choice)
    (Possible Responses: Red, Yellow, Black, White)

3.  What size shoe do you wear (rounded to next highest size)?  (Integer)

4.  How much money do you have on you right now?  (Dollar Amount (decimal))

So I need to be able to create questions, their question type, and for some of the questions, possible answers.

Here:

Number 1 is a know type of "True or False".

Number 2 is a know type of "Single Response/Multiple Choice" AND the end-business-user will create the possible responses.

Number 3 is a known type of "Integer". The end-user (person taking the evaluation) can basically put in any integer value.

Number 4 is a known type of "Decimal". Same thing as Integer.

Aspect #2.
The end-business-user needs to evaluate the person's responses. And assign some scalar value to a set of responses.

Example:

If someone responded:

1.  T
2.  Red
3.  >=8
4.  (Not considered for this situation)

Some psychiatrist-expert figures out that if someone answered with the above responses, that you are a 85% more at risk for depression than the normal. (Where 85% is a number the end-business-user (psychiatrist) can enter as a parameter.

So Aspect #2 is running through someone's responses, and determining a result.

The "response grid" would have to be setup so that it will go through (some or all) the possibilities in a priority ranking order, and then after all conditions are met (on a single row), exit out with the result.

Like this:

(1.) T     (2.) Red       (3.) >=8    ... Result = 85%
(1.) T     (2.) Yellow    (3.) >=8    ... Result = 70%
(1.) F     (2.) Red       (3.) >=8    ... Result = 50%
(1.) F     (2.) Yellow    (3.) >=8    ... Result = 40%

Once a match is found, you exit with the percentage. If you don't find a match, you go to the next rule.

Also, running with this psych evaluation mock example, I don't need to define every permutation. A lot of questions of psych evaluations are not actually used, they are just "fluff". So in my grid above, I have purposely left out question #4. It has no bearing on the results.

There can also be a "Did this person take this seriously?" evaluation grid:

(3.) >=20    (4.) >=$1,000    ... Result = False

(The possibility of having a shoe size >= 20 and having big dollars in your pocket is very low, thus you probably did not take the psych test seriously.)

If no rule is found, (in my real application, not this mock up), I would throw an exception or just not care. I would not need a default or fall-through rule.
In the above, Red and Yellow are "worrisome" favorite colors. If your favorite color is black or white, it has no bearing upon your depression risk factor.

I have used Business Rule Engines in the past. (InRule for example).
They are very expensive, and it is not in the budget.

BizTalk Business Rules Framework is a possibility. Not de$irable, but possible.

My issue with any Rules-Engine is that the "vocabulary" (I have limited experience with business rules engines, mind you) is based off of objects, with static properties.

public class Employee
{
        public string LastName
        { get; set; }

        public DateTime HireDate
        { get; set; }

        public decimal AnnualSalary
        { get; set; }

        public void AdjustSalary(int percentage)
        {
            this.AdjustSalary= this.AdjustSalary + (this.AdjustSalary * percentage);
        }

}

This would be easy to create business rules.

If 
        the (Employee's HireDate) is before (10 years ago) 

then 
        (Increase Their Salary) By (5) Percent.)

else
        (Increase Their Salary) By (3) Percent.)

But in my situation, the Test is composed of (dynamic) Questions and (dynamic) Responses, not predetermined properties.

So I guess I'm looking for some ideas to investigate on how to pull this off.

I know I can build a "TestMaker" application fairly quickly.

The biggest issue is integrating the Questions and (Possible Responses) into "evaluating rules".

Thanks for any tips.

Technologies:
DotNet 4.0 Framework
Sql Server 2008 Backend Database
VS2010 Pro, C#

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

痞味浪人 2024-12-20 10:51:41

如果它是一个小型应用程序,即 10 多个用户而不是 1000 个用户,并且它不是业务关键型应用程序,那么我会推荐 Excel。

优点是,大多数商业用户都非常熟悉 Excel,并且很可能在他们的计算机上安装了 Excel。基本上,您将 Excel 工作簿发送给您的业务用户。他们将输入问题、类型(小数、真假等)。单击触发 Excel 宏的按钮。这可以生成 XML 配置文件或将问题放入 SQL 中。您的应用程序只是像往常一样读取它、显示它并收集响应。

Excel 的主要优势体现在第 2 方面,即动态用户选择业务规则。在同一 Excel 文档的另一张表格中,最终业务用户可以根据需要指定任意数量的响应/问题排列。 Excel 用户非常熟悉输入简单的公式,例如 =If(A1 > 20 && A2 <50) 等。用户再次按下按钮并生成配置文件或将数据输入到 SQL Server。

在您的应用程序中,您迭代规则表并将其应用于响应。

考虑到用户/调查的数量等。这个简单的解决方案将比 biztalk 或完整的海关规则引擎简单得多。如果您需要与多个系统对话、集成数据、执行规则、创建工作流程等,那么 Biztalk 会很好。大多数其他规则引擎也适用于真正大型、复杂的规则系统。该规则系统的复杂性不仅仅是规则或排列的数量,它主要是必须与多个系统对话或“结束约会”某些规则或为未来的开始日期添加规则等。

在您的情况下,Excel基于网页系统或类似的数据网格可以很好地工作。当然,除非您正在为 Gartner 或其他一些全球数据调查公司或主要政府统计组织做一个项目。在这种情况下,我会建议 Biztalk 或其他商业规则引擎。

在您的例子中,它的 SQL 表包含问题、答案类型、要应用的规则。通过 Excel 或“网络中的 Excel”通过数据网格进行输入,然后只需迭代规则并将其应用到响应表即可。

If it's a small application, i.e 10s of users as opposed to 1000s, and its not business critical, then I would recommend Excel.

The advantages are, most business users are very familiar with excel and most probably have it on their machines. Basically you ship an Excel Workbook to your business users. They would enter the questions, the Type (Decimal, True False etc.). Click a button which triggers an excel macro. This could generate an XML configuration file or put the questions into SQL. Your application just reads it, displays it and collects responses as usual.

The main advantage of Excel comes in Aspect #2, the dynamic user chosen business rules. In another sheet of the same Excel document, the end business user can specify as many of the permutations of the responses/questions as they feel like. Excel users are very familiar with inputting simple formulas like =If(A1 > 20 && A2 <50) etc. Again the user pushes a button and generates either a configuration file or input the data into SQL server.

In your application you iterate through the Rules table and apply it to the responses.

Given the number of users/surveys etc. This simple solution would be much more simpler than biztalk or a full on customs rules engine. Biztalk would be good if you need to talk to multiple system, integrate their data, enforce rules, create work flow etc. Most of the other rules engines are also geared towards really big, complex rule system. The complexity in this rule systems, isn't just the number of rules or permutations, it is mostly having to talk to multiple system or "End dating" certain rules or putting in rules for future kick off dates etc.

In your case an Excel based or a similar datagrid on a webpage system would work fine. Unless of course you are doing a project for Gartner or some other global data survey firm or a major government statistical organisation. In that case I would suggest Biztalk or other commercial rules engines.

In your case, its SQL tables with Questions, Answer Types, Rules To Apply. Input is made user friendly via Excel or "Excel in the web" via a datagrid and then just iterate through the rules and apply them to the response table.

怀念你的温柔 2024-12-20 10:51:41

您确定要使用业务规则引擎来解决此问题吗?

据我了解,BRE 的用例

  • 主要是静态执行流,
  • 一些决策确实经常变化

在您的用例中,整个系统(Q/A 流和评估)是动态的,所以恕我直言,一种简单的领域特定语言整个系统将是一个更好的解决方案。


您可能想从 testMaker - 完全适合此工作流程的基于网络的软件。 (免责声明:我为这个项目做出了一些贡献。)它的评分规则非常基本,所以这可能对你没有多大帮助。它旨在将数据导出到 SPSS 并从那里构建报告......

Are you sure you want to use a business rule engine for this problem?

As far as I understand it, the usecase for a BRE is

  • Mostly static execution flow
  • Some decisions do change often

In your usecase, the whole system (Q/A-flow and evaluation) are dynamic, so IMHO a simple domain specific language for the whole system would be a better solution.


You might want to take some inspiration from testMaker - a web based software exactly for this workflow. (Disclaimer: I contributed a bit to this project.) Its scoring rules are quite basic, so this might not help you that much. It was designed to export data to SPSS and build reports from there...

紫轩蝶泪 2024-12-20 10:51:41

确保您正在建模适合分层对象的数据库本文将帮助

创建用于测试的表
创建问题表,其中包含问题、testid、问题类型列
为答案、答案 id、问题 id、答案和 istrue 列创建表
答案属于问题
一个问题可以有多个答案

为用户或员工创建表
为用户答案、答案 ID、所选答案

评估创建表(使用对象变量进行布尔整数覆盖,在使用函数之前使用 try catch 以实现高异常覆盖。):

function(questiontype,answer,useranswer)
switch(questiontype) //condition can be truefalse, biggerthan,smallerthan, equals
{
case: "biggerthan": if(useranswer>answer) return true else return false;
case "truefalse": if(useranswer==answer) return true else return false
case "equals": if(useranswer==answer) return true else return false
}

以数据字典的形式获取输出并在此处发布。
如果没有数据模式,您获得的帮助将是有限的。

Be sure you are modeling a database suitable for hierarchical objects This article would help

create table for test
create tables for questions, with columns question, testid, questiontype
create tables for answers, answer id,question id, answer and istrue columns
answers belong to questions
one question can have many answer

create table for user or employee
create table for user answers, answer id, selected answer

evaluation (use object variables for boolean-integer coverage, use try catch before using function for high exception coverage.):

function(questiontype,answer,useranswer)
switch(questiontype) //condition can be truefalse, biggerthan,smallerthan, equals
{
case: "biggerthan": if(useranswer>answer) return true else return false;
case "truefalse": if(useranswer==answer) return true else return false
case "equals": if(useranswer==answer) return true else return false
}

get output as a data dictionary and post here please.
without a data schema the help you get will be limited.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文