Developing Expert Systems using iKen Studio Beta:
Steps to follow:
sample iExam Exam System
a. Add iExam as a new application in ‘Application Setting’ and click on Add button .
b.
Add iExam as a new variable Group in
‘Variable Groups’. and click on Add button
c. Click on Create Directory button in application group. System would create a directory named as iExam in virtual directory. It also creates directory Images inside iExam directory. All required files (including images) Generic_Template.htm,Generic_Welcome.htm and Generic_Default.css from GenericTemplates directory and GenericTemplates/Images are copied to application directory. Path of this directory is website/Virtual Directory Name/iExam e.g. www.ikensolutions.com/TestCode/iExam.
d. Click on 'Save to file' , if iExam application and iExam Variable Group is successfully added then System shows this window
Create web templates (Optional)
The system uses generic_template.htm as a template file to create required templates. Web pages/forms entering inputs are created based on file called as template.htm (create this file using step 6) in the iExam directory. Generic_template.htm can be modified (i.e. images and links can be removed or renamed) so that templates would be created with required layout. While editing the generic template file do not delete <--INSERT HERE--> tag (alternatively using slots: [PROMPT],[CONTROL],[JAVASCRIPT_URL] etc. for various it is used by system to insert prompt, controls, etc.
For example figure below shows customized template for 'iExam.'
Use any browser but preferably Internet Explorer or Mozilla Firefox.
a.
b. Select ‘iExam’ from available applications & click on 'Add From the List' and also
c. select ‘iExam’ from available groups & click on "Add From List' button.

b. Login to system as a iKen Studio user.
Login as
system user for system development.
This interface helps to create possible (domain) values and scales that variables can take. For example, in this application possible multiple option to questions etc. can be set. The name of the lists/menus can be same as that of variable names or these can be generic (like CityList) to be used in multiple applications and variables.
Select the 'Menu & Lists' Interfaces of iKen Studio.
For this example, we define
iExam.Q1, iExam.Q2,... as menu names. Each one will have
possible option for that question. e.g. iExam.Q1 can have three options. While
defining question options (menu options), codes can be used to indicate
correct/incorrect answer. e.g. 1 for correct and 0 for wrong. If you
want to give negative marks for wrong selection, code can be set to -1 instead
of 0. .
Click on ‘Show All Menus’
to see menu list.
Go to ‘Global
Variable’ interface of iKen Studio.
Create variables to be required in the expert system in the iExam group using ‘Global Variable Interface’. In this example, variables are iExam.Q1, iExam.Q2...iExam.Q6. These variables are input variables. Create intermediate sub-goals if required. In this expert system, the rules are divided into two test sets. First set of three questions (iExam.Q1, iExam.Q2 and iExam.Q3 on structured design) and second set of three questions (iExam.Q4, iExam.Q5 and iExam.Q6 on database design). So we create two more sub-goal variables as iExam.QSet1 and iExam.QSet2. These variables have values Good or Poor.
Set of rules can be added using rule editor/manager. System provides interactive environment to manage the rules. Make sure that there are no errors when you update the rule. There are large number of functions added to develop good and powerful expert systems.
The
logic of the system.
Candidate has to clear both the test sets
in order to declare result as Good. Means both iExam.QSet1 and
iExam.QSet2 should be evaluated to Good. First test must be
clear in order to go-to second test. If candidate fails in first test
set, then system stops. To clear a first test set, candidate must give first
answer correct and has to give one correct answers out of question no. 2 and
3. To clear the second test/set,
candidate has to answer at least two questions correctly amongst
three.
Write set of rules using
Rule Editor and compile them.
GET_CODE(Exam.Q1)=1 , means if the selected option whose corresponding code is 1 ( is correct answer).
Once the rules are correctly compiled, the system is ready to execute or test. After creation of all rules we need to create web pages for all variables in variable group to do this click on Create Web Pages button. Each webpage contain lot of javascript code for validation of inputs at run time etc. (web pages are created based on variable attributes set using Global Variable Interface)
Click on Create Generic Templates in Rule Manager to create templates Welcome.htm, Template.htm, etc. from Generic_Template.htm, Generic_Welcome.htm and Generic_Default.css files.
The system can be invoked directly from any web-page giving following
URL: VirtualDirectory?main.aspx?Goal=iExam.iExam Result&Action=RunSystem. Where iExam.iExam Result is goal variable name from which system would start backward reasoning.
Alternatively
Generic_Welcome.htm can be modified or a web page e.g.
welcome.htm can be explicitly created as a starting page, which
has start system as a link to start expert system.
For running the system use
the following path:-
http://ikenstudio/testcode/iExam/welcome.htm
The subsequent pages of system are like as shown below.
After successful
execution of system it shows a result as default session report,
as shown in following figure.

If the system does not respond or work properly: add Debug=Yes to URL to store values during system run e.g. VirtualDirectory?main.aspx?Goal=iExam.iExam Result&Action=RunSystem&Debug=Yes. While running the system, ShowDebug.aspx would show run-time dump of the system. It stops at the rule expression which has problem. You can check expressions and variable values using utility called Diagnostics.aspx.
1 . Creating form
Forms can be used to club inputs instead of asking them one by one in Q&A mode. In this expert system, all questions can be grouped and asked in group rather than asking one after other. Form designer helps to create HTML form interactively. Controls are automatically inserted by the system while generating form. System embeds lot of JavaScript code to validate, format etc.
Go ‘Form Designer’ interface of iKen Studio.
a. Add a new Form and design it as per system requirement.
b. Click on 'Create' to create Template of Form and Preview
of form can be seen by 'Preview' button.
c. Create a goal
variable and link the form to that goal variable. Whenever you call this
variable using ASK function, it would display form as follows. All variables appearing in the form, would
get values populated once variable is submitted.
First Rule can be changed to:
Rule No=1 ID=Exam.1
IF
ASK(Exam.Form)
AND GET_CODE(Exam.Q1)=1
AND GET_CODE(Exam.Q2)=1
THEN
Exam.QSet1 IS Good
2 . Creating report for session.
The system uses default reports to show results. However, customized reports
can be designed to change default reports. This example shows how exam report is
designed and used. Report designer helps to create HTML reports which contain
variables. Whenever a report is invoked values are populated into report and
displayed. System embeds lots of JavaScript code to format values, check
conditions etc.
Go to Interfaces 'Report Designer' of iKen
Studio.
a. Add New Report in Report designer (You can customize it by using
various options).
b. You can see report preview by clicking on 'Preview' button
c. Link this report ID iExam_Report to goal variable iExam.FinalResult_Status
Run the system again.