📄 viewsurveyresultpage.asp
字号:
rcs.open sql, con, 1, 1
totalVoters = rcs.RecordCount
rcs.close
thisReplies = getQuestionAnsweredTimes(questionId)
chooseRate = persentRate(thisReplies, totalVoters)
tempCode = "<table width='900' align='center' style='border:solid; border-color:#CCCCCC; border-width:thin; margin-top:20;'>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
tempCode = "<tr><th colSpan='8' align='left' style='background-color:#9CCEFF;'>" & questionTitle & "</th></tr>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
tempCode = "<tr style='background-color=#ACCEFF;'><td colSpan=6>Totally Survey Replies:</td> <td id ='"&questionId&"' align='center' colSpan=2>" & totalVoters & "</td></tr>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
tempCode = "<tr style='background-color=#BCCEFF;'> <td colSpan=6>Replies Times For This Question:</td> <td id ='" & questionId &"RepliedTimes' align='center'>" & thisReplies & "</td> <td id ='" & questionId &"RepliedRate' align='center'>" & chooseRate & " %</td></tr>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
set ranksSet = questionsNode.item(i).childNodes.item(4).childNodes.item(0).childNodes.item(0).childNodes
ranksNum = ranksSet.length
tempCode = "<tr style='background-color=#B7CDCA;'><td></td><td>replying rate</td>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
nullColsNum = 0
for m = 0 to ranksNum-1 step 1
rankTitle = ranksSet.item(m).Text
if not len(rankTitle) = 0 then
tempCode = "<td align='center'>" & trim(rankTitle) & "</td>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
else
nullColsNum = nullColsNum +1
end if
next
if not nullColsNum = 0 then
tempCode = "<td colSpan = " & nullColsNum & "></td>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
end if
tempCode = "</tr>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
set answerSet = questionsNode.item(i).childNodes.item(4).childNodes
gridAnswersNum = answerSet.length
for m = 1 to gridAnswersNum-1 step 1
gridAnswerId = answerSet.item(m).getAttribute("id")
answerTopic = answerSet.item(m).childNodes.item(0).Text
tempCode = "<tr style='background-color=#B7CDCA;'><td>" & answerTopic & "</td>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
subQuestionReplyTimes = getSubQuestionReplyTimes( questionId, gridAnswerId )
tempCode = "<td id='"&gridAnswerId&"'>"&persentRate(subQuestionReplyTimes,thisReplies)&" %</td>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
for k = 0 to answersNum-1 step 1
answerId = answersNode.item(k).getAttribute("id")
if inStr(answerId, "rank")<>0 then
temp = left(answerId, inStr(answerId, "rank")-1)
if trim(LCase(gridAnswerId)) = trim(LCase(temp)) then
answerReplies = getCheckedCount(questionId, answerId)
answerRate = persentRate(answerReplies, subQuestionReplyTimes)
tempCode="<td id='"&answerId&"' align='center' width=100>"&answerRate&" %</td>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
end if
end if
next
if not nullColsNum = 0 then
tempCode = "<td colSpan=" & nullColsNum & " ></td>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
end if
tempCode = "</tr>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
next
tempCode = "</table>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
end if
if isText <> 0 and isGrid = 0 then
sql = "select * from " & questionId
rcs.open sql, con, 1, 1
totalVoters = rcs.RecordCount
rcs.close
thisReplies = getQuestionAnsweredTimes(questionId)
chooseRate = persentRate(thisReplies, totalVoters)
tempCode = "<table width='900' align='center' style='border:solid; border-color:#CCCCCC; border-width:thin; margin-top:20;'>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
tempCode = "<tr><th colSpan='4' align='left' style='background-color:#9CCEFF;'>" & questionTitle & "</th></tr>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
tempCode = "<tr style='background-color=#ACCEFF;'><td colSpan=2>Totally Survey Replies:</td> <td id ='"&questionId&"' align='center' colSpan=2>" & totalVoters & "</td></tr>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
tempCode = "<tr style='background-color=#BCCEFF;'><td colSpan=2 >Replies Times For This Question:</td> <td id ='" & questionId &"RepliedTimes' align='center'>" & thisReplies & "</td> <td id ='" & questionId &"RepliedRate' align='center'>" & chooseRate & " %</td></tr>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
optionsNum = questionsNode.item(i).childNodes.item(4).childNodes.length
for k = 1 to optionsNum-1 step 1
answerName = questionsNode.item(i).childNodes.item(4).childNodes.item(k).childNodes.item(0).Text
subAnswerId = questionsNode.item(i).childNodes.item(4).childNodes.item(k). childNodes.item(0).getAttribute("id")
selectedNum = getTextCommentsNum(questionId, subAnswerId)
createTextDoc questionId, subAnswerId, questionTitle, answerName
answerRate = persentRate(selectedNum, thisReplies)
tempCode = "<tr style='background-color=#B7CDCA;'><td >" & answerName & "</td>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
tempCode = "<td id='"&subAnswerId&"RepliedTimes' align='center'>" & selectedNum & "</td>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
tempCode = "<td id='"&subAnswerId&"RepliedRate' align='center' width=100>"& answerRate &" %</td>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
tempCode = "<td align='center' width=100><a target='_blank' href=../comments/"&subAnswerId&".doc>replies</a></td></tr>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
next
tempCode = "</table>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
'
end if
if ( isText <> 0 )and isGrid <> 0 then
sql = "select * from " & questionId
rcs.open sql, con, 1, 1
totalVoters = rcs.RecordCount
rcs.close
thisReplies = getQuestionAnsweredTimes(questionId)
chooseRate = persentRate(thisReplies, totalVoters)
tempCode = "<table width='900' align='center' style='border:solid; border-color:#CCCCCC; border-width:thin; margin-top:20;'>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
tempCode = "<tr><th colSpan='8' align='left' style='background-color:#9CCEFF;'>" & questionTitle & "</th></tr>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
tempCode = "<tr style='background-color=#ACCEFF;'><td colSpan=6>Totally Survey Replies:</td> <td id ='"&questionId&"' align='center' colSpan=2>" & totalVoters & "</td></tr>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
tempCode = "<tr style='background-color=#BCCEFF;'> <td colSpan=6>Replies Times For This Question:</td> <td id ='" & questionId &"RepliedTimes' align='center'>" & thisReplies & "</td> <td id ='" & questionId &"RepliedRate' align='center'>" & chooseRate & " %</td></tr>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
set ranksSet = questionsNode.item(i).childNodes.item(4).childNodes.item(0).childNodes.item(0).childNodes
ranksNum = ranksSet.length
tempCode = "<tr style='background-color=#B7CDCA;'><td></td><td>replying rate</td>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
nullColsNum = 0
for m = 0 to ranksNum-1 step 1
rankTitle = ranksSet.item(m).Text
if not len(rankTitle) = 0 then
tempCode = "<td align='center'>" & trim(rankTitle) & "</td>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
else
nullColsNum = nullColsNum +1
end if
next
if not nullColsNum = 0 then
tempCode = "<td colSpan = " & nullColsNum & "></td>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
end if
tempCode = "</tr>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
set answerSet = questionsNode.item(i).childNodes.item(4).childNodes
gridAnswersNum = answerSet.length
for m = 1 to gridAnswersNum-1 step 1
gridAnswerId = answerSet.item(m).getAttribute("id")
answerTopic = answerSet.item(m).childNodes.item(0).Text
tempCode = "<tr style='background-color=#B7CDCA;'><td>" & answerTopic & "</td>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
subQuestionReplyTimes = getSubQuestionReplyTimes( questionId, gridAnswerId )
tempCode = "<td id='"& gridAnswerId &"'>"&persentRate(subQuestionReplyTimes, thisReplies)&" %</td>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
for k = 0 to answersNum-1 step 1
answerId = answersNode.item(k).getAttribute("id")
if inStr(answerId, "rank")<>0 then
temp = left(answerId, inStr(answerId, "rank")-1)
if trim(LCase(temp)) = trim(LCase(gridAnswerId)) then
rankTitle = ranksSet.item(right(answerId, 1)-1).Text
createTextDoc questionId, answerId, questionTitle, answerTopic &"---"&rankTitle
answerReplies = getTextCommentsNum(questionId, answerId)
answerRate = persentRate(answerReplies, thisReplies)
tempCode = "<td id='" & answerId &"'align='center' width=100><a target='_blank' href=../comments/"&answerId & ".doc>" & answerRate & " %</a></td>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
end if
end if
next
if not nullColsNum = 0 then
tempCode = "<td colSpan=" & nullColsNum & " ></td>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
end if
tempCode = "</tr>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
next
tempCode = "</table>"
htmlCode = htmlCode & tempCode
response.Write(tempCode)
end if
next
set answersSet =nothing
set rcs = nothing
set con = nothing
set questionsNode = nothing
set questionDom = nothing
set answerDom = nothing
set answersNode = nothing
end function
function createReportSnapShot(htmlCode)
folderPath = Server.MapPath("../scripts")
on error resume next
if Err.number<>0 then
response.Write "xml file copying failed"
end if
dim copier,xmlFile, resource
set copier=Server.CreateObject("Scripting.FileSystemObject")
set xmlFile=copier.CreateTextFile(folderPath & "/dynamicAnalysis.asp",true)
xmlFile.Write(htmlCode)
xmlFile.close
set xmlFile=nothing
set copier=nothing
response.Redirect("dynamicAnalysis.asp")
end function
if Err.number<>0 then
if Err.number=6 then
response.Write("<h2 align='center'>No survey was replied<h2>")
else
response.Write "Failed, please try again" &err
end if
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -