Pages creation
Pages Design
Web pages for the system are created by the same way as classic web pages (with the HTML language), but „pseudo tags“ are added into this pages that allows to make consultations with the system. A view of the „pseudo tags“ and it`s functions are in the section „Pseudo tags“.
Kinds of Pages
index_htm.dta
This page serves for selecting knowledge base. It`s only one even if there are more set of pages on the server and it must be placed directly into the directory pages. This page can be automatically skip in the case when there is only one set of pages on the server - you must check the option Skip index page if only one base in the options. If there are more set of pages on the server and you want to skip this page also, you can do this with a JavaScript for redirectiong to the next page and the select base send as a parameter. You can find the example of the Javascript in the next section (the name of base is send as parameter baze).
Into the index page, there must be the list for choose a base. You put this list in the page as following:
<UL> <#ListOfBases></UL>
Exaple of JavaScript for Skip the Index
If the index page may be skiped, it neccessary put following code in the head of page „index_htm.dta“ and to the tag <BODY> add the attribute OnLoad="Presmeruj()".
<SCRIPT language="Javascript">
var pole = window.location.search.substr(1).split("&");
var httpGetVars = new Array();
for(i = 0; i < pole.length; i++){
httpGetVars[pole[i].split("=")[0]] = unescape(pole[i].split("=")[1]);
}
function Presmeruj(){
window.location = "loadbase="+httpGetVars["baze"]+"<#id>";
};
</SCRIPT>
desc_htm.dta
This page serves for show the descriptions of the base. It`ll be showed after the base is selected.
The page has to include a button for start the consultation:
<FORM action="question">
<INPUT type="Submit" Value="Start"/>
<INPUT Type="hidden" name="id" Value="<#id_number>">
</FORM>
Another suitable „pseudo tag“ for this page is tag for insert the description of the knowledge base:
<#BaseDescription>
dotazbinary_htm.dta
This page serves for qetting a question to a binary attribute to an user.
The page has to include the following script into the head of the page, where you can change the text that are displayed to
an user (the tag #ReplaceValue has to be there only in the case that buttons with predefined answers are in the page):
<SCRIPT language="JavaScript">
WeightOutOfRange = "Weight out of range!";
NotWeight = "Weight isn`t set!";
NotNumber = "Value isn`t a number!";
<#ReplaceValue>
<#CheckOfBinary>
</SCRIPT>
Next, the page must include tag for question`s text: <#NameOfAttribute>,
begin of form for send the answer: <#BeginForm>,
input box for weight: <#InputValue>,
end of form:
<INPUT Type="submit" Value="OK" class="buttonOK"> <INPUT Type="hidden" name="id" Value="<#id_number>"></FORM>
Another suitable tags are:
tag for attribut`s comment: <#CommentOfAttribute>
tag for range of weight: <#WeightRange>
buttons with predefined answers:
<INPUT Type="submit" Value="Certainly Yes" OnClick="InputValue('yes')">
<INPUT Type="submit" Value="Certainly No" OnClick="InputValue('no')">
<INPUT Type="submit" Value="Irrelevant" OnClick="InputValue('irrelevant')">
<INPUT Type="submit" Value="Unknown" OnClick="InputValue('unknown')">
dotazsingle_htm.dta
This page serves for qetting a question to a single nominal attribute to an user.
The page has to include the following script into the head of the page, where you can change the text that are displayed to
an user (the tag #ReplaceValue has to be there only in the case that buttons with predefined answers are in the page):
<SCRIPT language="JavaScript">
WeightOutOfRange = "Weight out of range!";
NotWeight = "Weight isn`t set!";
NotNumber = "Value isn`t a number!";
<#ReplaceValue>
<#CheckOfSingle>
</SCRIPT>
Next, the page must include tag for question`s text: <#NameOfAttribute>,
begin of form for send the answer: <#BeginForm>,
box for select the answer(the attribute line determines the number of line of the box): <#SelectValue lines="1">,
input box for weight: <#InputValue>,
end of form:
<INPUT Type="submit" Value="OK" class="buttonOK"> <INPUT Type="hidden" name="id" Value="<#id_number>"></FORM>
Another suitable tags are:
tag for attribut`s comment: <#CommentOfAttribute>
tag for range of weight: <#WeightRange>
buttons with predefined answers:
<INPUT Type="submit" Value="Certainly Yes" OnClick="InputValue('yes')">
<INPUT Type="submit" Value="Irrelevant" OnClick="InputValue('irrelevant')">
<INPUT Type="submit" Value="Unknown" OnClick="InputValue('unknown')">
dotazmultiple_htm.dta
This page serves for qetting a question to a set nominal attribute to an user.
The page has to include the following script into the head of the page, where you can change the text that are displayed to
an user (the tag #ReplaceMultipleValue has to be there only in the case that buttons with predefined answers are in the page):
<SCRIPT language="JavaScript">
WeightOutOfRange = "Weight out of range in the box number ";
NotNumber = "Value isn`t a number!";
<#ReplaceMultipleValue>
<#CheckOfMultiple>
</SCRIPT>
Next, the page must include tag for question`s text: <#NameOfAttribute>,
begin of form for send the answer: <#BeginForm>,
list of propositions with box for answers and buttons with predefined answers (if the relevant attribute are included): <#ListOfMultiple yesbutton="Yes" nobutton="No" unknownbutton="Unknown" irrelevantbutton="Irrelevant">,
end of form:
<INPUT Type="submit" Value="OK" class="buttonOK"> <INPUT Type="hidden" name="id" Value="<#id_number>"></FORM>
Another suitable tags are:
tag for attribut`s comment: <#CommentOfAttribute>
tag for range of weight: <#WeightRange>
dotaznumeric_htm.dta
This page serves for qetting a question to a numeric attribute to an user.
The page has to include the following script into the head of the page, where you can change the text that are displayed to
an user (the tag #ReplaceValue has to be there only in the case that buttons with predefined answers are in the page):
<SCRIPT language="JavaScript">
WeightOutOfRange = "Weight out of range!";
ValueOutOfRange = "Value out of range!";
NotNumber = "Value isn`t a number!";
NotValue = "Value isn`t set!";
<#ReplaceValue>
<#CheckOfNumeric>
</SCRIPT>
Next, the page must include tag for question`s text: <#NameOfAttribute>,
begin of form for send the answer: <#BeginForm>,
input box for value: <#InputValue>,
end of form:
<INPUT Type="submit" Value="OK" class="buttonOK"> <INPUT Type="hidden" name="id" Value="<#id_number>"></FORM>
Another suitable tags are:
tag for attribut`s comment: <#CommentOfAttribute>
tag for range of value: <#ValueRange>
buttons with predefined answers:
<INPUT Type="submit" Value="Irrelevant" OnClick="InputValue('irrelevant')">
<INPUT Type="submit" Value="Unknown" OnClick="InputValue('unknownnumeric')">
result_htm.dta
This page serves for showing results of consultations. The system will display this page when it evaluate goals of the consultation.
The page shall include a table with result. A design of the table can be as following:
<TABLE cellspacing="2" cellpadding="2">
<TR>
<TD><b>Name</b></TD>
<TD><b>Min. weight</b></TD>
<TD><b>Max. weight</b></TD>
<TD><b>Status</b></TD>
</TR>
<#AllPropositionsTrue>
<#AllPropositionsNeutral>
<#AllPropositionsFalse>
</TABLE>
The table cann`t include the tags for all propositions (#AllPropositions...), but for exaple onlyfor goals (#Results...) or
for others propositions (#Propositions...). It can also include onlypositive or negative results.
In the page, there shall be a link to the page for correcting the answers: <a href="questionnaire<#id>">Correcting answers</a>
questionnaire_htm.dta
This page serves for correcting answers. There are displayed all questions and answers and an user can modify it. The page with result is showing after sending this page.
The page has to include the following script into the head of the page, where you can change the text that are displayed to
an user:
<SCRIPT language="JavaScript">
WeightOutOfRange = "Weight out of range!";
ValueOutOfRange = "Value out of range!";
NotNumber = "Value isn`t a number!";
NotValue = "Value isn`t set!";
NotWeight = "Weight isn`t set!";
CertainlyYes = "Certainly Yes";
CertainlyNo = "Certainly No";
ProbablyYes = "Probably Yes";
ProbablyNo = "Probably No";
Unknown = "Unknown";
Irrelevant = "Irrelevant";
<#ReplaceMultipleValue>
<#CheckQuestionnaire>
<#QuestionnaireNotNumbers>
</SCRIPT>
Next, the page must include begin of form for send the answer: <#BeginForm>,
list of propositions with box for answers and buttons with predefined answers (if the relevant attribute are included): <#Questionnaire yesbutton="Yes" nobutton="No" unknownbutton="Unknown" irrelevantbutton="Irrelevant">,
end of form:
<INPUT Type="submit" Value="Odeslat"> <INPUT Type="hidden" name="id" Value="<#id_number>"></FORM>
If you want that the weight of attributes arn`t displayed but there are replaced by the words, add to the tag „<BODY>“ attribute „OnLoad="Nahrad()"“.
Pseudo tags
tag | inserted code | page | description |
<#ListOfBases> |
<LI><A href = "loadbase= baze i"> baze i </A></LI>
... |
index | List of bases availabled on the server. |
<#id> | ?id= user`s id | all pages | Insert into reference parameter with user`s ID. |
<#id_number> | user`s id | all pages | Insert into page the number of user`s ID. |
<#BeginForm> | <FORM action="question" onsubmit="return kontrolaDat(this)"> |
dotazbinary
dotazsingle dotazmultiple dotaznumeric |
Begin of form for input weight. |
<#NameOfAttribute> | name of attribute |
dotazbinary
dotazsingle dotazmultiple dotaznumeric |
Name of attribute of actual question. |
<#CommentOfAttribute> | comment of attribute |
dotazbinary
dotazsingle dotazmultiple dotaznumeric |
Comment of attribute of actual question. |
<#InputValue> | <INPUT name="attribute`s id"> |
dotazbinary
dotazsingle dotaznumeric |
Box for input of weight. |
function PrevodCisel |
function PrevodCisel(zadanaHodnota) {
index = zadanaHodnota.indexOf("."); if (index > -1) { zadanaHodnota = zadanaHodnota.substring(0,index) + "," + zadanaHodnota.substring(index+1,zadanaHodnota.length); } else { index = zadanaHodnota.indexOf(","); if (index > -1) { zadanaHodnota = zadanaHodnota.substring(0,index) + "." + zadanaHodnota.substring(index+1,zadanaHodnota.length); }; }; return zadanaHodnota; }; |
part of another tags | Function for conversion of decimal signs to the rights. |
function KontrolaCisla |
function KontrolaCisla(zadanaHodnota) {
if (isNaN(zadanaHodnota)){ zadanaHodnota = PrevodCisel(zadanaHodnota); if (isNaN(zadanaHodnota)){alert(NotNumber);return false;}; }; if(zadanaHodnota != "") { if((parseFloat(zadanaHodnota) >= parseFloat(- weight range))&&(parseFloat(zadanaHodnota) <= parseFloat(weight range))) { return true; } else { alert(WeightOutOfRange); return false; }; } else { alert(NotWeight); return false; }; }; |
part of another tags | Check of number in the weight range of base. |
<#CheckOfBinary> |
function PrevodCisla
function KontrolaCisla function kontrolaDat(vstup) { zadanaHodnota = vstup. attribute`s id.value; strednik = zadanaHodnota.indexOf(";"); if (strednik > 0) { s1 = zadanaHodnota.substring(0,strednik); if (KontrolaCisla(s1)) { s2 = zadanaHodnota.substring(strednik+1,zadanaHodnota.length); return KontrolaCisla(s2); } else {return false;}; } return KontrolaCisla(zadanaHodnota); }; |
dotazbinary | Javascript for check of weight of binary question. |
<#CheckOfSingle> | see CheckOfBinary | dotazsingle | Javascript for check of weight of single nominal question. |
<#CheckOfNumeric> |
function PrevodCisla
function KontrolaCisla function kontrolaHodnoty(vstup) if(vstup != "") { if (isNaN(zadanaHodnota)){ alert(NotValue); return false; } for lower limit [ s1 = "lower limit"; s1 = PrevodCisel(s1); if(parseFloat(vstup) < parseFloat(s1)) { alert(ValueOutOfRange); return false; }; ] For upper limit [ s2 = "upper limit"; s2 = PrevodCisel(s2); if(parseFloat(vstup) > parseFloat(s2)) { alert(ValueOutOfRange); return false; }; ] return true; } else {return false;}; }; function kontrolaDat(vstup) { zadanaHodnota = vstup. attribute`s id.value; if ((zadanaHodnota.indexOf("[") == 0)&&(zadanaHodnota.indexOf("]") == zadanaHodnota.length - 1)){ return true;}; strednik = zadanaHodnota.indexOf(";"); if (strednik > 0) { s1 = zadanaHodnota.substring(0,strednik); s1 = PrevodCisel(s1); if (kontrolaHodnoty(s1) == false){ return false;}; s2 = zadanaHodnota.substring(strednik+1,zadanaHodnota.length); s2 = PrevodCisel(s2); if (kontrolaHodnoty(s2) == false){ return false;} else {return true;}; } else { if (!(isNaN(zadanaHodnota))){ zadanaHodnota = PrevodCisel(zadanaHodnota); return kontrolaHodnoty(zadanaHodnota);} else { alert(NotValue); return false; }; }; }; |
dotaznumeric | JavaScript for check value of numeric question |
<#CheckOfMultiple> |
function PrevodCisla
function KontrolaCisla function kontrolaDat(vstup) { For each propositions of set attributes [ zadanaHodnota = vstup. proposition`s id.value; strednik = zadanaHodnota.indexOf(";"); if (strednik > 0) { s1 = zadanaHodnota.substring(0,strednik); if (KontrolaCisla(s1)) { s2 = zadanaHodnota.substring(strednik+1,zadanaHodnota.length); if (!(KontrolaCisla(s2))){ return false; }; } else {return false;}; } else { if (zadanaHodnota != "") { if (isNaN(zadanaHodnota)){ zadanaHodnota = PrevodCisel(zadanaHodnota); if (isNaN(zadanaHodnota)){alert(NotNumber);return false;}; }; if((parseFloat(zadanaHodnota) < parseFloat(- weight range))||(parseFloat(zadanaHodnota) > parseFloat(weight range))) { alert(WeightOutOfRange + "' + inttostr(i+1)+'"); return false; }; }; }; ] return true; }; |
dotazmultiple | JavaScript for check weights of multiple attribute |
<#ReplaceValue> |
function InputValue(hodnota){
if (hodnota == "yes") {hodnota = "weight range";} else if (hodnota == "no") {hodnota = "- weight range";} else if (hodnota == "irrelevant") {hodnota = "0;0";} else if (hodnota == "unknown") {hodnota = "- weight range; weight range";} else if (hodnota == "unknownnumeric") {hodnota = "[- weight range; weight range]";} else if (hodnota.substring(0,7) == "weight:") { hodnota = hodnota.substring(8,hodnota.length); }; document.all[' id atributu '].value = hodnota; }; |
dotazbinary
dotazsingle dotaznumeric |
Function that replace the value of button by relevant numeric weight. |
<#ReplaceMultipleValue> |
function InputValue(hodnota, vstup){
if (hodnota == "yes") {hodnota = "weight range";} else if (hodnota == "no") {hodnota = "- weight range";} else if (hodnota == "irrelevant") {hodnota = "0;0";} else if (hodnota == "unknown") {hodnota = "- weight range; weight range";}; else if (hodnota == "unknownnumeric") {hodnota = "[- weight range; weight range]";} else if (hodnota.substring(0,7) == "weight:") { hodnota = hodnota.substring(8,hodnota.length); }; document.all[vstup].value = hodnota; }; |
dotazmultiple | Function that replace the value of button by relevant numeric weight for propositions of set attribute. |
<#WeightRange> | - weight range; weight range |
dotazbinary
dotazsingle dotazmultiple |
Weight range of knowledge base. |
<#ValueRange Decimal="number"> | lower limit - upper limit | dotaznumeric | Value range of numeric attribute. Parameter decimal set the number of decimal places for round the numbers. |
<#SelectValue lines="number"> |
<SELECT name="value" size="number">
For each proposition of single attribute [ <OPTION value="proposition`s id" selected to the first > proposition`s name ] </SELECT> |
dotazsingle | Select list of answerst for single question. |
<#ListOfMultiple yesbutton="text 1" nobutton="text 2" irrelevantbutton="text 3" unknownbutton="text 4"> |
For each proposition of set attribute:
<TR> <TD> proposition`s name </TD> <TD><INPUT name="id výroku"></TD><TD> If yesbutton is set [ <INPUT Type="button" Value="text 1 OnClick="InputValue('yes',' proposition`s id ')" class="yesbutton"> ] If nobutton is set [ <INPUT Type="button" Value="text 2" OnClick="InputValue('no',' proposition`s id ')" class="nobutton"> ] If irrelevantbutton is set[ <INPUT Type="button" Value="text 3" OnClick="InputValue('irrelevant',' proposition`s id ')" class="irrelevantbutton"> ] If unknownbutton is set[ <INPUT Type="button" Value="text 4" OnClick="InputValue('unknown',' proposition`s id ')" class="unknownbutton"> ] </TD></TR> |
dotazmultiple | Boxes for set weights of propositions of set attribute. |
<#ResultsTrue> |
For each positive goals:
<TR> <TD class="result_true"> proposition`s name </TD> <TD class="result_true"> minimal weight </TD> <TD class="result_true"> maximal weight (if it`s same as the minimal, then nothing) </TD <TD class="result_true"> proposition`s status </TD> </TR> |
results | Table with goals with positiv weight. For each proposition, there are name, minimal and maximal weight and proposition`s status. |
<#ResultsFalse> |
For each negative goals:
<TR> <TD class="result_false"> proposition`s name </TD> <TD class="result_false"> minimal weight </TD> <TD class="result_false"> maximal weight (if it`s same as the minimal, then nothing) </TD <TD class="result_false"> proposition`s status </TD> </TR> |
results | Table with goals with negativ weight. For each proposition, there are name, minimal and maximal weight and proposition`s status. |
<#ResultsNeutral> |
For each neutral goals:
<TR> <TD class="result_neutral"> proposition`s name </TD> <TD class="result_neutral"> minimal weight </TD> <TD class="result_neutral"> maximal weight (if it`s same as the minimal, then nothing) </TD <TD class="result_neutral"> proposition`s status </TD> </TR> |
results | Table with goals with neutral weight (minimal weight lower or equal than 0, maximal weight greater or equal than 0). For each proposition, there are name, minimal and maximal weight and proposition`s status. |
<#AllPropositionsTrue> |
For each positive propositions:
<TR> <TD class="result_true"> proposition`s name </TD> <TD class="result_true"> minimal weight </TD> <TD class="result_true"> maximal weight (if it`s same as the minimal, then nothing) </TD <TD class="result_true"> proposition`s status </TD> </TR> |
results | Table with propositions with positiv weight. For each proposition, there are name, minimal and maximal weight and proposition`s status. |
<#AllPropositionsFalse> |
For each negative propositions:
<TR> <TD class="result_false"> proposition`s name </TD> <TD class="result_false"> minimal weight </TD> <TD class="result_false"> maximal weight (if it`s same as the minimal, then nothing) </TD <TD class="result_false"> proposition`s status </TD> </TR> |
results | Table with propositions with negativ weight. For each proposition, there are name, minimal and maximal weight and proposition`s status. |
<#AllPropositionsNeutral> |
For each neutral propositions:
<TR> <TD class="result_neutral"> proposition`s name </TD> <TD class="result_neutral"> minimal weight </TD> <TD class="result_neutral"> maximal weight (if it`s same as the minimal, then nothing) </TD <TD class="result_neutral"> proposition`s status </TD> </TR> |
results | Table with propositions with neutral weight (minimal weight lower or equal than 0, maximal weight greater or equal than 0). For each proposition, there are name, minimal and maximal weight and proposition`s status. |
<#PropositionsTrue> |
For each positive propositions without goals:
<TR> <TD class="result_true"> proposition`s name </TD> <TD class="result_true"> minimal weight </TD> <TD class="result_true"> maximal weight (if it`s same as the minimal, then nothing) </TD <TD class="result_true"> proposition`s status </TD> </TR> |
results | Table with propositions without goals with positive weight. For each proposition, there are name, minimal and maximal weight and proposition`s status. |
<#PropositionsFalse> |
For each negative propositions without goals:
<TR> <TD class="result_false"> proposition`s name </TD> <TD class="result_false"> minimal weight </TD> <TD class="result_false"> maximal weight (if it`s same as the minimal, then nothing) </TD <TD class="result_false"> proposition`s status </TD> </TR> |
results | Table with propositions without goals with negative weight. For each proposition, there are name, minimal and maximal weight and proposition`s status. |
<#PropositionsNeutral> |
For each neutral propositions without goals:
<TR> <TD class="result_neutral"> proposition`s name </TD> <TD class="result_neutral"> minimal weight </TD> <TD class="result_neutral"> maximal weight (if it`s same as the minimal, then nothing) </TD <TD class="result_neutral"> proposition`s status </TD> </TR> |
results | Table with propositions without goals with neutral weight (minimal weight lower or equal than 0, maximal weight greater or equal than 0). For each proposition, there are name, minimal and maximal weight and proposition`s status. |
<#ResultsNameTrue> |
For each positive goals:
<TR> <TD class="result_true"> proposition`s name </TD> </TR> |
results | Table with goal`s name with positive weight. |
ResultsNameNeutral |
For each neutral goals:
<TR> <TD class="result_neutral"> proposition`s name </TD> </TR> |
results | Table with goal`s name with neutral weight. |
<#ResultsNameFalse> |
For each negative goals:
<TR> <TD class="result_false"> proposition`s name </TD> </TR> |
results | Table with goal`s name with negative weight. |
<#ResultsWeightTrue> |
For each positive goals:
<TR> <TD class="result_true"> minimal weight </TD> <TD class="result_true"> maximal weight (if it`s same as the minimal, then nothing) </TD </TR> |
results | Table with goal`s weight with positive weight. |
<#ResultsWeightNeutral> |
For each neutral goals:
<TR> <TD class="result_neutral"> minimal weight </TD> <TD class="result_neutral"> maximal weight (if it`s same as the minimal, then nothing) </TD </TR> |
results | Table with goal`s weight with neutral weight. |
<#ResultsWeightFalse> |
For each negative goals:
<TR> <TD class="result_false"> minimal weight </TD> <TD class="result_false"> maximal weight (if it`s same as the minimal, then nothing) </TD </TR> |
results | Table with goal`s weight with negative weight. |
<#ResultsCommentTrue> |
For each positive goals:
<TR> <TD class="result_true"> proposition`s comment </TD> </TR> |
results | Table with goal`s comment with positive weight. |
<#ResultsCommentNeutral> |
For each neutral goals:
<TR> <TD class="result_neutral"> proposition`s comment </TD> </TR> |
results | Table with goal`s comment with neutral weight. |
<#ResultsCommentFalse> |
For each negative goals:
<TR> <TD class="result_false"> proposition`s comment </TD> </TR> |
results | Table with goal`s comment with negative weight. |
<#NameOfBase> | Name of base | all pages | The name of actual knowledge base. |
<#BaseDescription> | base description | all pages | Description of actual knowledge base. |
<#Questionnaire yesbutton="text 1" pyesbutton="text 1b" nobutton="text 2" pnobutton="text 2b" irrelevantbutton="text 3" unknownbutton="text 4"> |
For each questions:
If it`s binary attribute [ <TR> <TD class="questioncell"> attribute`s name </TD> <TD class="answercell"><FONT id="text attribute`s id"></FONT> <p style="visibility: hidden"> <INPUT name="attribute`s id" value="minimal weight of attribute; maximal weight of attribute"></p> </TD> <TD class="buttonscell"> if yesbutton is set [ <INPUT Type="button" Value="text 1" OnClick="InputValue('yes',' attribute`s id '), Nahrad()" class="yesbutton"><BR> ] if nobutton is set [ <INPUT Type="button" Value="text 2" OnClick="InputValue('no',' attribute`s id '), Nahrad()" class="nobutton"><BR> ] if pyesbutton is set [ <INPUT Type="button" Value="text 1b" OnClick="InputValue('weight: rozsah báze znalostí / 2 ',' attribute`s id '), Nahrad()" class="pyesbutton"><BR> ] je-li zadán pnobutton [ <INPUT Type="button" Value="text 2b" OnClick="InputValue('weight:- rozsah báze znalostí / 2 ',' attribute`s id '), Nahrad()" class="pnobutton"><BR> ] je-li zadán irrelevantbutton [ <INPUT Type="button" Value="text 3" OnClick="InputValue('irrelevant',' attribute`s id '), Nahrad()" class="irrelevantbutton"><BR> ] je-li zadán unknownbutton [ <INPUT Type="button" Value="text 4" OnClick="InputValue('unknown',' attribute`s id '), Nahrad()" class="unknownbutton"><BR> ] </TR> ] Jde-li o jednoduchý nominální atribut [ <TR> <TD class="questioncell"> jméno atributu </TD> <TD class="answercell"><SELECT name="attribute`s id __value" size="3"> pro každý výrok atributu [ <OPTION value="id výroku" pro vybraný výrok [ selected ] > proposition`s name ] </SELECT><BR><BR> <FONT id="text attribute`s id"></FONT><p style="visibility: hidden"><INPUT name="attribute`s id" value="váha vybraného výroku"></p></TD> <TD class="buttonscell"> if yesbutton is set [ <INPUT Type="button" Value="text 1" OnClick="InputValue('yes',' attribute`s id '), Nahrad()" class="yesbutton"><BR> ] if pyesbutton is set [ <INPUT Type="button" Value="text 1b" OnClick="InputValue('weight: rozsah báze znalostí / 2 ',' attribute`s id '), Nahrad()" class="pyesbutton"><BR> ] je-li zadán irrelevantbutton [ <INPUT Type="button" Value="text 3" OnClick="InputValue('irrelevant',' attribute`s id '), Nahrad()" class="irrelevantbutton"><BR> ] je-li zadán unknownbutton [ <INPUT Type="button" Value="text 4" OnClick="InputValue('unknown',' attribute`s id '), Nahrad()" class="unknownbutton"><BR> ] </TD></TR> ] Jde-li o množinový nominální atribut, tak pro každý výrok atributu [ <TR> <TD class="questioncell"> proposition`s name </TD> <TD class="answercell"><FONT id="text attribute`s id __ id výroku"></FONT><p style="visibility: hidden"><INPUT name="attribute`s id __ id výroku" value="minimal weight; maximální váha"></p></TD> <TD class="buttonscell"> if yesbutton is set [ <INPUT Type="button" Value="text 1" OnClick="InputValue('yes',' attribute`s id __ id výroku '), Nahrad()" class="yesbutton"><BR> ] if nobutton is set [ <INPUT Type="button" Value="text 2" OnClick="InputValue('no',' attribute`s id __ id výroku '), Nahrad()" class="nobutton"><BR> ] if pyesbutton is set [ <INPUT Type="button" Value="text 1b" OnClick="InputValue('weight: rozsah báze znalostí / 2 ',' attribute`s id __ id výroku '), Nahrad()" class="pyesbutton"><BR> ] if pnobutton is set [ <INPUT Type="button" Value="text 2b" OnClick="InputValue('weight:- rozsah báze znalostí / 2 ',' attribute`s id __ id výroku '), Nahrad()" class="pnobutton"><BR> ] if irrelevantbutton is set [ <INPUT Type="button" Value="text 3" OnClick="InputValue('irrelevant',' attribute`s id __ id výroku '), Nahrad()" class="irrelevantbutton"><BR> ] if unknownbutton is set [ <INPUT Type="button" Value="text 4" OnClick="InputValue('unknown',' attribute`s id __ id výroku '), Nahrad()" class="unknownbutton"><BR> ] </TD></TR> ] If it`s numeric attribute [ <TR> <TD class="questioncell"> attribute`s name </TD> if value of attribute is set [ if (Atr.weight.min_hodnota = vaha_TRUE[0]) and (Atr.weight.max_hodnota = vaha_TRUE[1]) then <TD class="answercell"><INPUT name="attribute`s id" value="minimal value; maximal value"></TD> ] if the weight of attribute is set [ <TD class="answercell"><INPUT name="attribute`s id" value="[minimal weight; maximální váha]"></TD> ] <TD class="buttonscell"> if unknownbutton is set [ <INPUT Type="button" Value="text 4" OnClick="InputValue('unknownnumeric',' attribute`s id ')" class="unknownbutton"><BR> ] ] |
questionnaire | Table of a questionnaire. |
<#BeginFormQuestionnaire> | <FORM action="forward" onsubmit="return kontrolaDat(this)"> | questionnaire | Begin form of questionnaire. |
CheckQuestionnaire |
rozmez := Uzivatel.RozmeziVah; function PrevodCisla
function KontrolaCisla for each attributes [ if it`s question to numeric attribute [ if (Atr is TAtribut_numeric)and(Atr.dotaz = question) then begin if TAtribut_numeric(Atr).omezen_zdola then s1 := Fltostr(TAtribut_numeric(Atr).dolni_mez); if TAtribut_numeric(Atr).omezen_shora then s2 := Fltostr(TAtribut_numeric(Atr).horni_mez); function kontrolaHodnoty attribute`s id (vstup){ if(vstup != "") { if (isNaN(vstup)){ alert(NotValue); return false; } if attribute has lower limit [ if TAtribut_numeric(Atr).omezen_zdola then s1 = "lower limit"; s1 = PrevodCisel(s1); if(parseFloat(vstup) < parseFloat(s1)) { alert(ValueOutOfRange); return false; }; ] if attribute has upper limit [ s2 = "upper limit"; s2 = PrevodCisel(s2); if(parseFloat(vstup) > parseFloat(s2)) { alert(ValueOutOfRange); return false; }; ] return true; } else {return false;} }; ] function kontrolaDat(vstup) { for each questions [if it`s binary or single attribute [ zadanaHodnota = vstup. attribute`s id.value; strednik = zadanaHodnota.indexOf(";"); if (strednik > 0) { s1 = zadanaHodnota.substring(0,strednik); if (KontrolaCisla(s1)) { s2 = zadanaHodnota.substring(strednik+1,zadanaHodnota.length); if (!(KontrolaCisla(s2))){return false;}; } else {return false;}; } else { if (!(KontrolaCisla(zadanaHodnota))){return false;}; }; ] if it`s set attribute, then for each it`s propositions [ zadanaHodnota = vstup. attribute`s id __ proposition`s id.value; strednik = zadanaHodnota.indexOf(";"); if (strednik > 0) { s1 = zadanaHodnota.substring(0,strednik); if (KontrolaCisla(s1)) { s2 = zadanaHodnota.substring(strednik+1,zadanaHodnota.length); if (!(KontrolaCisla(s2))){ return false; }; } else {return false;}; } else { if (zadanaHodnota != "") { if (isNaN(zadanaHodnota)){ zadanaHodnota = PrevodCisel(zadanaHodnota); if (isNaN(zadanaHodnota)){alert(NotNumber);return false;}; }; if((parseFloat(zadanaHodnota) < parseFloat(- weight range))||(parseFloat(zadanaHodnota) > parseFloat(weight range))) { alert(WeightOutOfRange + "pořadí výroku"); return false; }; }; }; ] if it`s numeric attribute [ zadanaHodnota = vstup. attribute`s id.value; if ((zadanaHodnota.indexOf("[") == 0)&&(zadanaHodnota.indexOf("]") == zadanaHodnota.length - 1)){ return true;}; strednik = zadanaHodnota.indexOf(";"); if (strednik > 0) { s1 = zadanaHodnota.substring(0,strednik); s1 = PrevodCisel(s1); if (kontrolaHodnoty attribute`s id (s1) == false){ return false;}; s2 = zadanaHodnota.substring(strednik+1,zadanaHodnota.length); s2 = PrevodCisel(s2); if (kontrolaHodnoty attribute`s id (s2) == false){ return false;} else {;}; } else { if (!(isNaN(zadanaHodnota))){ zadanaHodnota = PrevodCisel(zadanaHodnota); if(!(kontrolaHodnoty attribute`s id (zadanaHodnota))){return false;};} else { alert(NotValue); return false; }; }; ] ] return true;}; |
questionnaire | Javascript for check of filled questionnaire. |
QuestionnaireNotNumbers |
function NahradHodnoty(vaha,id){
strednik = vaha.indexOf(";"); if (strednik > 0) { s1 = vaha.substring(0,strednik); s2 = vaha.substring(strednik+1,vaha.length); } else { s1 = vaha; s2 = vaha; }; if ((parseFloat(s1) == weight range) +')&&(parseFloat(s2) == weight range)){ document.all[id].innerText = CertainlyYes;}; if ((parseFloat(s1) == - weight range)&&(parseFloat(s2) == - weight range)){ document.all[id].innerText = CertainlyNo;}; if ((parseFloat(s1) == - weight range)&&(parseFloat(s2) == weight range)){ document.all[id].innerText = Unknown;}; if ((parseFloat(s1) == 0)&&(parseFloat(s2) == 0)){ document.all[id].innerText = Irrelevant;}; if ((parseFloat(s1) == weight range / 2)&&(parseFloat(s2) == weight range / 2)){ document.all[id].innerText = ProbablyYes;}; if ((parseFloat(s1) == - weight range vah / 2)&&(parseFloat(s2) == - weight range / 2)){ document.all[id].innerText = ProbablyNo;}; }; function Nahrad(){ pro všechny dotazy [jde-li o binární nebo jednoduchý atribut [ NahradHodnoty(document.all["attribute`s id"].value, "text attribute`s id") ] jde-li o množinový atribut, tak pro všechny jeho výroky [ NahradHodnoty(document.all["attribute`s id __ proposition`s id"].value, "text attribute`s id __ proposition`s id") ] ] }; |
questionnaire | Javascript for replacing the weigts by it`s words equivalents. |