")
End If
If InStr(1, Temp, " 0 Then
If InStr(1, Temp, "rowspan") > 0 Then
Temp2 = " | 0 Then
Temp4 = Split(Temp3, " ")(0)
Else
Temp4 = Split(Temp3, ">")(0)
End If
Temp2 = Temp2 & Temp4 & Chr(34)
If InStr(1, Temp, "colspan") > 0 Then
Temp2 = Temp2 & " colspan=" & Chr(34)
Temp3 = Split(Temp, "colspan=")(1)
If InStr(1, Temp3, " ") > 0 Then
Temp4 = Split(Temp3, " ")(0)
Else
Temp4 = Split(Temp3, ">")(0)
End If
Temp2 = Temp2 & Temp4 & Chr(34)
End If
Temp2 = Temp2 & ">"
Temp2 = Replace(Temp2, Chr(34) & Chr(34), Chr(34))
HTMLSon = Replace(HTMLSon, Temp, Temp2)
End If
If InStr(1, Temp, "colspan") > 0 Then
Temp2 = " | 0 Then
Temp4 = Split(Temp3, " ")(0)
Else
Temp4 = Split(Temp3, ">")(0)
End If
Temp2 = Temp2 & Temp4 & Chr(34)
If InStr(1, Temp, "rowspan") > 0 Then
Temp2 = Temp2 & " rowspan=" & Chr(34)
Temp3 = Split(Temp, "rowspan=")(1)
If InStr(1, Temp3, " ") > 0 Then
Temp4 = Split(Temp3, " ")(0)
Else
Temp4 = Split(Temp3, ">")(0)
End If
Temp2 = Temp2 & Temp4 & Chr(34)
End If
Temp2 = Temp2 & ">"
Temp2 = Replace(Temp2, Chr(34) & Chr(34), Chr(34))
HTMLSon = Replace(HTMLSon, Temp, Temp2)
End If
If InStr(1, Temp, "colspan") = 0 Then
If InStr(1, Temp, "rowspan") = 0 Then
HTMLSon = Replace(HTMLSon, Temp, " | ")
End If
End If
If InStr(1, Temp, "rowspan") = 0 Then
If InStr(1, Temp, "colspan") = 0 Then
HTMLSon = Replace(HTMLSon, Temp, " | ")
End If
End If
End If
Exit For
ElseIf k = UBound(Dizi) Then
HTMLSon = Replace(HTMLSon, Temp, "")
End If
Next k
Konum = Bitir + 1
HTMLSon = Replace(HTMLSon, " ", "")
HTMLSon = Replace(HTMLSon, vbNewLine & vbNewLine, " ")
HTMLSon = Replace(HTMLSon, " ", " ")
HTMLSon = Replace(HTMLSon, "> <", ">" & vbNewLine & "<")
Loop
HTMLSon = Replace(HTMLSon, "img/quiz", "img/quiz_" & UniteNo2 & "_")
Temp = "": Temp2 = "": Temp3 = "": Temp4 = ""
Set ADO = CreateObject("ADODB.Stream")
ADO.Charset = "utf-8"
ADO.Open
ADO.WriteText HTMLSon
ADO.SaveToFile Klasor & UniteNo2 & "_quiz.html", 2
ADO.Close
End Sub
Sub Quiz_5_CSV_Uret(ByVal QuizHTML As String, _
ByVal UniteNo2 As Long)
Set ADO = CreateObject("ADODB.Stream")
ADO.Charset = "utf-8"
ADO.Open
ADO.LoadFromFile QuizHTML
HTMLDoc = ADO.ReadText
ADO.Close
Konum = 1
Do While InStr(Konum, HTMLDoc, "¨qq") > 0
Basla = InStr(Konum, HTMLDoc, "¨qq")
Bitir = InStr(Basla + 1, HTMLDoc, "¨qq")
If Bitir = 0 Then Bitir = Len(HTMLDoc)
Temp = Mid(HTMLDoc, Basla, (Bitir - Basla))
Temp = Replace(Temp, vbNewLine, " ")
Temp = Replace(Temp, " ", " ")
'SORU KOKU AYIKLAMA BASLANGICI
If InStr(1, Temp, "¨qq") > 0 Then
Basla2 = InStr(1, Temp, "¨qq")
Bitir2 = InStr(Basla2 + 1, Temp, "qq¨")
Soru = Mid(Temp, Basla2, (Bitir2 - Basla2))
Soru = Replace(Soru, "¨qq", "")
Soru = "" & Soru & " "
End If
'SORU KOKU AYIKLAMA SONU
'VARSA A SIKKI AYIKLAMA BASLANGICI
If InStr(1, Temp, "¨aa") > 0 Then
Basla2 = InStr(1, Temp, "¨aa")
Bitir2 = InStr(Basla2 + 1, Temp, "aa¨")
ASikki = Mid(Temp, Basla2, (Bitir2 - Basla2))
ASikki = Replace(ASikki, "¨aa", "")
ASikki = "" & ASikki & " "
If InStr(1, ASikki, "**") > 0 Then
DogruYanit = "a": ASikki = Replace(ASikki, "**", "")
End If
End If
'VARSA A SIKKI AYIKLAMA SONU
'VARSA B SIKKI AYIKLAMA BASLANGICI
If InStr(1, Temp, "¨bb") > 0 Then
Basla2 = InStr(1, Temp, "¨bb")
Bitir2 = InStr(Basla2 + 1, Temp, "bb¨")
BSikki = Mid(Temp, Basla2, (Bitir2 - Basla2))
BSikki = Replace(BSikki, "¨bb", "")
BSikki = "" & BSikki & " "
If InStr(1, BSikki, "**") > 0 Then
DogruYanit = "b": BSikki = Replace(BSikki, "**", "")
End If
End If
'VARSA B SIKKI AYIKLAMA SONU
'VARSA C SIKKI AYIKLAMA BASLANGICI
If InStr(1, Temp, "¨cc") > 0 Then
Basla2 = InStr(1, Temp, "¨cc")
Bitir2 = InStr(Basla2 + 1, Temp, "cc¨")
CSikki = Mid(Temp, Basla2, (Bitir2 - Basla2))
CSikki = Replace(CSikki, "¨cc", "")
CSikki = "" & CSikki & " "
If InStr(1, CSikki, "**") > 0 Then
DogruYanit = "c": CSikki = Replace(CSikki, "**", "")
End If
End If
'VARSA C SIKKI AYIKLAMA SONU
'VARSA D SIKKI AYIKLAMA BASLANGICI
If InStr(1, Temp, "¨dd") > 0 Then
Basla2 = InStr(1, Temp, "¨dd")
Bitir2 = InStr(Basla2 + 1, Temp, "dd¨")
DSikki = Mid(Temp, Basla2, (Bitir2 - Basla2))
DSikki = Replace(DSikki, "¨dd", "")
DSikki = "" & DSikki & " "
If InStr(1, DSikki, "**") > 0 Then
DogruYanit = "d": DSikki = Replace(DSikki, "**", "")
End If
End If
'VARSA D SIKKI AYIKLAMA SONU
'VARSA E SIKKI AYIKLAMA BASLANGICI
If InStr(1, Temp, "¨ee") > 0 Then
Basla2 = InStr(1, Temp, "¨ee")
Bitir2 = InStr(Basla2 + 1, Temp, "ee¨")
ESikki = Mid(Temp, Basla2, (Bitir2 - Basla2))
ESikki = Replace(ESikki, "¨ee", "")
ESikki = "" & ESikki & " "
If InStr(1, ESikki, "**") > 0 Then
DogruYanit = "e": ESikki = Replace(ESikki, "**", "")
End If
End If
'VARSA E SIKKI AYIKLAMA SONU
Call Quiz_6_Soru_Ekle(UniteNo2) 'SORUYU ARRAY'E EKLEMEK ICIN DEGISKENLERI ALT ISLEME GONDER
Konum = Bitir 'BIR SONRAKI (DONGU) SORU ICIN NUMARAYI ARTIR
Loop
End Sub
Sub Quiz_6_Soru_Ekle(ByVal UniteNo3 As Long)
m = m + 1
ReDim Preserve ArrCSV(1 To m)
ArrCSV(m) = ArrCSV(m) & Chr(34) & SoruID & Chr(34) & ","
ArrCSV(m) = ArrCSV(m) & Chr(34) & DersID & Chr(34) & ","
ArrCSV(m) = ArrCSV(m) & Chr(34) & UniteNo3 & Chr(34) & ","
If DogruYanit <> "" Then
ArrCSV(m) = ArrCSV(m) & Chr(34) & Chr(199) & "oktan Se" & Chr(231) & "meli" & Chr(34) & ","
Else
ArrCSV(m) = ArrCSV(m) & Chr(34) & "Klasik" & Chr(34) & ","
End If
ArrCSV(m) = ArrCSV(m) & Chr(34) & Soru & Chr(34) & ","
ArrCSV(m) = ArrCSV(m) & Chr(34) & ASikki & Chr(34) & ","
ArrCSV(m) = ArrCSV(m) & Chr(34) & BSikki & Chr(34) & ","
ArrCSV(m) = ArrCSV(m) & Chr(34) & CSikki & Chr(34) & ","
ArrCSV(m) = ArrCSV(m) & Chr(34) & DSikki & Chr(34) & ","
ArrCSV(m) = ArrCSV(m) & Chr(34) & ESikki & Chr(34) & ","
ArrCSV(m) = ArrCSV(m) & Chr(34) & DogruYanit & Chr(34) & ","
ArrCSV(m) = ArrCSV(m) & Chr(34) & Format(Now, "yyyy-mm-dd hh:mm:ss") & Chr(34)
ArrCSV(m) = Replace(ArrCSV(m), Chr(160), " ") '160: SABIT BOSLUK, 32: KLAVYEDEN CIKAN SPACE
ArrCSV(m) = Replace(ArrCSV(m), "p> ", "p>")
ArrCSV(m) = Replace(ArrCSV(m), " ", "")
ArrCSV(m) = Replace(ArrCSV(m), "> <", "><")
ArrCSV(m) = Replace(ArrCSV(m), Chr(34) & " <", Chr(34) & "<")
ArrCSV(m) = Replace(ArrCSV(m), "> " & Chr(34), ">" & Chr(34))
ArrCSV(m) = Replace(ArrCSV(m), " ", "")
ArrCSV(m) = Replace(ArrCSV(m), " ", "")
ArrCSV(m) = Replace(ArrCSV(m), " ", "")
'Debug.Print ArrCSV(m)
Soru = ""
ASikki = "": BSikki = "": CSikki = "": DSikki = "": ESikki = ""
DogruYanit = ""
SoruID = SoruID + 1
End Sub
'Bir karakterin Chr kodunu almak için Asc("a") deyimini kullanin _
Kaynak: Chat GPT 3.5 _
Kod uyarlama: Muharrem DOGANCI
|