📄 trandumper.htm
字号:
End Sub
Sub SecondPage()
Dim f, fc, f1, s, a, strTmp, isEnd
Dim PATH, i
Set f = top.hid.filesys.GetFolder(top.hid.FOLDER)
Set fc = f.Files
FILES=""
i = 0
For Each f1 in fc
If UCase(Right(f1.name,3)) = "TXT" or (UCase(right(f1.name,3)) = "HTM" and UCase(Right(f1.name,14)) <> "TRANDUMPER.HTM" and UCase(Right(f1.name,10))<>"README.HTM") Then
Set a = top.hid.filesys.OpenTextFile(top.hid.FOLDER & f1.name, 1, False)
MEMO = MEMO & "<input type=hidden name=MEMO value="""
Do While a.AtEndOfStream <> True
strTmp=Trim(join(split(a.ReadLine, Chr(9)),""))
arrTmp = Split(strTmp, ".")
If UBound(arrTmp) = -1 Then
ReDim arrTmp(0)
End If
If NOT IsNumeric(arrTmp(0)) Then arrTmp(0) = 0
If arrTmp(0)> 0 and arrTmp(0) < 999 Then ' O Subject
Exit Do
Else
If Len(strTmp) > 0 Then
MEMO = MEMO & " " & strTmp
Else
MEMO = MEMO & vbCrLf
End If
End If
Loop
MEMO = MEMO & """>"
a.Close
Set a = Nothing
i = i + 1
FILES = FILES & "<option value='" & f1.name & "'>" & Left(f1.name, Len(f1.name)-4)
End If
Next
MEMO = MEMO & "<input type=hidden name=MEMO value=''><input type=hidden name=MEMO value=''>"
FILES = FILES & "<option value=''> "
Set fc = Nothing
Set f = Nothing
top.document.title="TranDumper V2.1"
document.write "<html><body background='./images/bg1.gif'>" & top.hid.LOGO & "<font size=2 face=Verdana><dd><b>Select a Test: <input type=checkbox name=learnmode onClick=""if (learnmode.checked==true) { top.hid.learnmode=1} else { top.hid.learnmode=0}"">Learn Mode " &_
"<input type=checkbox name=randomquest onClick=""if (randomquest.checked==true) { top.hid.randomquest=1} else { top.hid.randomquest=0}"">Random Questions " &_
"<input type=checkbox name=randomans onClick=""if (randomans.checked==true) { top.hid.randomans=1} else { top.hid.randomans=0}"">Random Answers <br>" & MEMO &_
"<center><select name='myChoice' size=6 onClick=""if((myChoice.selectedIndex)<0) return(0);if (myChoice(myChoice.selectedIndex).value == '') star.disabled = true;if(myChoice(myChoice.selectedIndex).value != '') star.disabled = false; area.value=top.main.MEMO(myChoice.selectedIndex).value;top.hid.AA=myChoice(myChoice.selectedIndex).value"">" & FILES & "</select></center><dd>Description:</b></font><br><center><textarea rows=7 cols=58 name=area></textarea><br><br><br><button name=star disabled onClick=""document.location.href='Trandumper.htm?frame'""> <b>Start</b> </button> <button onClick=""document.location.href='Trandumper.htm?first'""> <font face=Arail><b>Exit</font> </button></center></body></html>"
End Sub
Sub HomePage()
top.document.title="TranDumper V2.1"
document.write "<center><font color=blue size=5><b><i>" & Left(top.hid.AA, Len(top.hid.AA)-4) & " (" & CStr(parent.up.MM) & " questions)</i></b></font><p><BUTTON OnClick=""parent.up.ChNumberQ();parent.up.tick();document.location.href='./Trandumper.htm?1'""><font face=Verdana><b>Ready to Go</b></font></BUTTON></center>"
End Sub
Sub WriteFrame()
Dim FRAM
FRAM = "<title>TranDumper V2.1</title>" &_
"<frameset framespacing=0 rows='0,20,*,50' frameborder=NO>" &_
"<frame src='./Trandumper.htm?up' name='up' marginwidth=0 frameborder=NO scrolling=NO NORESIZE>" &_
"<frame src='./Trandumper.htm?topp' name='topp' marginwidth=0 frameborder=NO scrolling=NO NORESIZE>" &_
"<frameset framespacing=0 cols='36,*,15' frameborder=NO>" &_
"<frame src='./Trandumper.htm?left' name='left' frameborder=NO bordercolor=white scrolling=NO NORESIZE>" &_
"<frame src='./Trandumper.htm?0' name='side' frameborder=YES bordercolor=black scrolling=AUTO>" &_
"<frame src='./Trandumper.htm?right' name='right' frameborder=NO bordercolor=white scrolling=NO NORESIZE>" &_
"</frameset>" &_
"<frame src='./Trandumper.htm?down' name='down' marginwidth=0 frameborder=NO scrolling=NO NORESIZE>" &_
"</frameset>"
document.write FRAM
End Sub
Sub WriteTopp()
TOPP = "<html><body background='./images/bg1.gif'><center><table border=0 width=96% cellspacing=0 cellpadding=0>" &_
"<tr><td width=150>" &_
"<font face='Verdana' style='font-size:16px'><input type=checkbox name='Marked' disabled onClick=""if (Marked.checked) parent.up.Markk(parent.up.II)=1; else parent.up.Markk(parent.up.II)=0;""> " &_
"<b>Mark" &_
"<td><font face='Verdana' style='font-size:16px'><b>Time Now: <font color=blue><span ID=Now>00:00:00"&_
"</span></font></b></font>" &_
"<td align=right><font face='Verdana' style='font-size:16px'><b>Time Elapsed: <font color=blue><span ID=Clock>00:00:00"&_
"</span></font></b></font>" &_
"</tr></table></body></html>"
document.write TOPP
End Sub
Function WriteRadio(ByVal item1, ByVal english)
If item1 = parent.up.Usr(parent.up.II) Then
strChecked = "CHECKED"
Else
strChecked = ""
End If
WriteRadio = "<tr valign=top><td valign=top><input type=radio name=myChkbx " & strChecked & " value='" & item1 & "' " & parent.up.DISAB & " onClick=""parent.up.Usr(parent.up.II)=this.value;for(i=0;i<myChkbx.length;i++){myChkbx(i).disabled=true;} if(this.value==parent.up.Ans(parent.up.II)){ parent.up.WRIGHTS= parent.up.WRIGHTS + 1; parent.up.TOTALS = parent.up.TOTALS + Math.ceil(1000/parent.up.MM); if(parent.up.TOTALS > 1000) parent.up.TOTALS=1000; parent.down.right.innerHTML=parent.up.WRIGHTS; parent.down.total.innerHTML=parent.up.TOTALS; parent.left.GIF.src='./images/right.gif';myResult='Congratulation! ';} else { parent.up.WRONGS= parent.up.WRONGS + 1; parent.down.wrong.innerHTML=parent.up.WRONGS; parent.left.GIF.src='./images/wrong.gif';myResult='Sorry! ';} parent.side.MYRESULT.innerHTML=myResult; parent.up.ShowHint();""><font face=Verdana size=2><span ID=SELE>"
If (parent.up.DISAB<>"" and InStr(parent.up.Ans(parent.up.II), item1)>0) Then WriteRadio = WriteRadio & "<font color=red><b>"
WriteRadio = WriteRadio & item1 & ". </span><td valign=bottom><font face=Verdana size=2><span ID=ENGL>"
If (parent.up.DISAB<>"" and InStr(parent.up.Ans(parent.up.II), item1)>0) Then WriteRadio = WriteRadio & "<font color=red><b>"
WriteRadio = WriteRadio & english & "</span></tr>"
End Function
Function WriteChkbx(ByVal j, item1, ByVal english)
If InStr(parent.up.Usr(parent.up.II), item1) > 0 Then
strChecked = "CHECKED"
Else
strChecked = ""
End If
WriteChkbx = "<tr valign=top><td valign=top><input type=checkbox name=myChkbx " & strChecked & " value='" & item1 & "' " & parent.up.DISAB & " onClick=""if(myChkbx(" & j & ").checked && parent.up.Usr(parent.up.II).indexOf(myChkbx(" & j & ").value)<0){parent.up.Usr(parent.up.II) = parent.up.Usr(parent.up.II) + '" & item1 & "';} if(! myChkbx(" & j & ").checked && parent.up.Usr(parent.up.II).indexOf(myChkbx(" & j & ").value)>=0){parent.up.Usr(parent.up.II) = parent.up.Usr(parent.up.II).slice(0,parent.up.Usr(parent.up.II).indexOf('" & item1 & "')) + parent.up.Usr(parent.up.II).slice(parent.up.Usr(parent.up.II).indexOf('" & item1 & "')+1, parent.up.Usr(parent.up.II).length);} if(parent.up.Usr(parent.up.II).length==parent.up.Ans(parent.up.II).length) { parent.up.JJ=parent.up.JJ + '[' + parent.up.II + ']'; for(i=0;i<myChkbx.length;i++){myChkbx(i).disabled=true;} j=0; for(i=0;i<parent.up.Usr(parent.up.II).length;i++){ if (parent.up.Ans(parent.up.II).indexOf(parent.up.Usr(parent.up.II).slice(i,i+1))>=0){j=j+1;}} if (j==parent.up.Ans(parent.up.II).length) { parent.up.WRIGHTS= parent.up.WRIGHTS + 1;parent.up.TOTALS = parent.up.TOTALS + Math.ceil(1000/parent.up.MM); if(parent.up.TOTALS>1000)parent.up.TOTALS=1000; parent.down.right.innerHTML=parent.up.WRIGHTS; parent.down.total.innerHTML=parent.up.TOTALS; parent.left.GIF.src='./images/right.gif';myResult='Congratulation! ';} else { parent.up.WRONGS= parent.up.WRONGS + 1; parent.down.wrong.innerHTML=parent.up.WRONGS; parent.left.GIF.src='./images/wrong.gif';myResult='Sorry! ';} parent.side.MYRESULT.innerHTML=myResult; parent.up.ShowHint();}""><font face=Verdana size=2><span ID=SELE>"
If (parent.up.DISAB<>"" and InStr(parent.up.Ans(parent.up.II), item1)>0) Then WriteChkbx = WriteChkbx & "<font color=red><b>"
WriteChkbx = WriteChkbx & item1 & ". </span><td valign=bottom><font face=Verdana size=2><span ID=ENGL>"
If (parent.up.DISAB<>"" and InStr(parent.up.Ans(parent.up.II), item1)>0) Then WriteChkbx = WriteChkbx & "<font color=red><b>"
WriteChkbx = WriteChkbx & english & "</span></tr>"
End Function
Sub WriteSide()
Dim HEAD, ITEMS, ansTmp
top.document.title="Item " & parent.up.II & " (" & Left(top.hid.AA,1) & parent.up.S(parent.up.II) & ") of " & parent.up.MM & " [" & Left(top.hid.AA, Len(top.hid.AA)-4) & "]"
HEAD = "<HTML><BODY BGCOLOR=white leftmargin=0 topmargin=0 rightmargin=0>" &_
"<table border=0 cellspacing=10 cellpadding=0 width=100%><tr><td width=3%><td width=97%>" &_
"<font face='Verdana' size=2>"
SUBJ = parent.up.Subject(parent.up.II)
ITEMS = ""
If Len(parent.up.Ans(parent.up.II)) > 1 Then
ansTmp = join(split(parent.up.Ans(parent.up.II), ","), "")
ansTmp = join(split(ansTmp, " "), "")
parent.down.numbers.innerHTML="Select <font color=blue>" & Len(ansTmp) & "</font> correct answers."
Else
parent.down.numbers.innerHTML="Select the best answer."
End If
For j = 1 to parent.up.MAXIMJ
If parent.up.Body(parent.up.II, j) <> "" Then
If Len(parent.up.Ans(parent.up.II)) > 1 Then
ITEMS = ITEMS & WriteChkbx(j-1, parent.up.Opti(parent.up.II,j), parent.up.Body(parent.up.II, j))
Else
ITEMS = ITEMS & WriteRadio(parent.up.Opti(parent.up.II,j), parent.up.Body(parent.up.II, j))
End If
ELSE
Exit For
End If
Next
TAIL = "<tr><td><td><font size=4 face=Verdana color=blue><b><span ID=MYRESULT></span></b></font><span ID=COMM>"
If (parent.up.DISAB <> "") Then
TAIL = TAIL & "<font face=Verdana color=red size=2><b>Answer: " & parent.up.Ans(parent.up.II) & "</font><br><font size=2 face=Verdana color=DarkBlue><b>"
If top.hid.randomans = 0 then
TAIL = TAIL & parent.up.Desc(parent.up.II)
End If
End If
TAIL = TAIL & " <br></span></tr></table></body></html><span ID=SELE></span><span ID=ENGL></span><input type=hidden name=myChkbx>"
document.write HEAD & SUBJ & "<P>" & ITEMS & TAIL
If (InStr(parent.up.JJ, "[" & parent.up.II & "]")>0) Then
parent.up.ShowHint()
End If
End Sub
Sub WriteDown()
DOWN = "<html><head></head>" &_
"<BODY background='./images/bg1.gif' leftmargin=0 topmargin=0 rightmargin=0>" &_
"<table border=0 cellspacing=0 cellpadding=0><tr><td width=230><font face=Verdana style='font-size:16px'><nobr><b> <span name='numbers' ID='numbers'></span><td><font face=Verdana style='font-size:16px' color=black><b><nobr>Correct: <font color=blue><span ID='right'>0</span></font> , Incorrect: <font color=red><span ID='wrong'>0</span></font> , Your Score: <font color=blue><span ID='total'>0</span></font>/1000</tr></table>" &_
"<center><table border=0 width=96%>" &_
"<tr>" &_
"<td><font face=Verdana style='font-size:12px'><button name=nextt onClick=""parent.side.location.href='Trandumper.htm?1'"" disabled> <font style='font-size:12px'><b>" &_
"Next </font></button>" &_
"<td><font face=Verdana style='font-size:12px'><button name=prev onClick=""parent.side.location.href='Trandumper.htm?2'"" disabled> <font style='font-size:12px'><b>Previous</b> </font></button>" &_
"<td><font face=Verdana style='font-size:12px'><button name=answ onClick=""if(parent.up.JJ.indexOf('['+parent.up.II+']')<0){ parent.up.JJ=parent.up.JJ + '[' + parent.up.II + ']'; parent.up.WRONGS= parent.up.WRONGS + 1; parent.down.wrong.innerHTML=parent.up.WRONGS; } parent.up.ShowHint();"" disabled> <font style='font-size:12px'>" &_
"<b>Answer</b> </button>" &_
"<td><font face=Verdana style='font-size:12px'><button disabled name=review onClick=""parent.side.location.href='Trandumper.htm?review'""> <font style='font-size:12px'>" &_
"<b>Review</b> </button>" &_
"<td align=right><font face=Verdana style='font-size:12px'><button name=exitt onClick=""if(confirm('Are you sure to quit this exam?')){ top.hid.learnmode=0; top.hid.randomquest=0; top.hid.randomans=0; parent.location.href='Trandumper.htm?second';}""> <font style='font-size:12px'>" &_
"<b>Exit</b> </button>" &_
"</table></body></html>"
document.write DOWN
End Sub
Function ChkAnswer(ITEM)
Dim j, i
j=0
For i=1 To Len(parent.up.Usr(ITEM))
If (InStr(parent.up.Ans(ITEM), Mid(parent.up.Usr(ITEM),i,1)) >0) Then
j=j+1
End If
Next
If (j=Len(parent.up.Ans(ITEM))) Then
ChkAnswer = True
Else
ChkAnswer = False
End If
End Function
Sub ChNumberQ()
Dim newMMStr
Dim newMM
newMM = 0
newMMStr = ""
If top.hid.learnmode=0 then
If (confirm("This file has " & CStr(parent.up.MM) & " questions. Do you want change the number of questions ?")) then
newMMStr = InputBox("Enter a number between 1 and " & CStr(parent.up.MM) & " :", "Number of questions")
If isNumeric(newMMStr) then
newMM = CInt(newMMStr)
If newMM < 1 or newMM > parent.up.MM then
MsgBox "Invalid value for number of questions. The default value will be used!"
else
parent.up.MM = newMM
End If
Else
MsgBox "Invalid value for number of questions. The default value will be used!"
End If
End If
End If
End Sub
Sub SaveWrong()
Dim a, tmpStr
Dim i, j
ForAppending = 8
TristateFalse = 0
i = 0
j = 0
If Not top.hid.filesys.FileExists(top.hid.FOLDER & parent.side.WRONG.value) Then
Set a = top.hid.filesys.CreateTextFile(top.hid.FOLDER & parent.side.WRONG.value, True)
SaveType = "Saved !"
Else
Set a = top.hid.filesys.OpenTextFile(top.hid.FOLDER & parent.side.WRONG.value, ForAppending,TristateFalse)
SaveType = "Appended !"
End If
For i = 1 To parent.up.MM
If (InStr(parent.up.JJ, "[" & i & "]") > 0) Then
If (Not ChkAnswer(i)) Then
tmpStr=parent.up.Subject(i)
tmpStr=Join(Split(tmpStr,"<BR>"),Chr(13) & Chr(10))
a.WriteLine i & ". (" & Left(top.hid.AA,1) & parent.up.S(i) & ")" & tmpStr
For j = 1 To MAXIMJ
If parent.up.Opti(i,j) <> "" Then
a.WriteLine parent.up.Opti(i,j) & ". " & parent.up.Body(i,j)
Else
Exit For
End If
Next
a.WriteLine ""
a.WriteLine "Answer: " & parent.up.Ans(i)
If parent.up.randomans = 0 then
tmpStr=parent.up.Desc(i)
tmpStr=Join(Split(tmpStr,"<BR>"),Chr(13) & Chr(10))
a.WriteLine tmpStr
End If
a.WriteLine ""
a.WriteLine ""
End If
End If
Next
a.Close
MsgBox parent.side.WRONG.value & " has " & SaveType
End Sub
</script>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -