我正在尝试制作一个专家系统来检测网络问题。用户将有 4 个问题,每个问题有 3 到 4 个答案。用户输入后,用户点击按钮,检测并解决问题。我有点明白了,但我知道缺少一些东西。目前,我只添加了一些随机问题和答案,以检查是否确实有效。请帮助使用 java 脚本,因此它将根据答案提供有关网络问题的详细信息。提前致谢!:)
1.Can you access to the internet? <BR>
<select id="internet">
<option value="yes">yes</option>
<option value="No">no</option>
<option value="Yes, but at slow">Yes, but at slow</option>
<option value="Yes/No, it workes but it suddenly it stops and start working again ">Yes/No, it workes but it suddenly it stops and start working again</option>
</select>
<br>
<br><p>
2.Is it just your computer?<BR>
<select id="computer">
<option value="yes">yes</option>
<option value="whole company">whole company</option>
<option value="just my department">just my department</option>
<option value="me and few staff">me and few staff</option>
</select>
<br>
<br><p>
<button onclick="myFunction()">Detect</button>
<p id="Solution"></p>
<script>
function myFunction()
{
if (internet=="no"||computer=="yes")
{
x="check your cable is not cut or loose";
}
else if (internet=="no"||computer=="yes")
{
x="connection problem";
}
else
{
x="other problems....";
}
document.getElementById("Solution").innerHTML=x;
}
</script>