added refresh when working with quiz folder, debug logs enabled in folder mode, added new zoom content
This commit is contained in:
+4
-21
@@ -10,8 +10,9 @@ local function index(window, q, callback)
|
||||
label.align = ALIGN_CENTER
|
||||
label.textColor = color.white
|
||||
label.color = color.new("#363ac8")
|
||||
label.borderColor = color.new("#363ac8")
|
||||
label:scaleFont(.075)
|
||||
label.drawBorder = false
|
||||
label:scaleFont(.4)
|
||||
label:centerFont()
|
||||
|
||||
if not q.imageA or q.imageA == "" then
|
||||
error("Missing 'imageA' field for question!")
|
||||
@@ -38,29 +39,11 @@ local function index(window, q, callback)
|
||||
imageHolder2:setAspectSize(imageHolder2.imageWidth, imageHolder2.imageHeight)
|
||||
imageHolder2:setDualDim(0, 0, 0, 0, .6, 0, .4, 1)
|
||||
|
||||
local correct = window:newTextButton("Correct",0,-200,0,100,0,1,.5)
|
||||
correct.color = color.new("#52b11b")
|
||||
local wrong = window:newTextButton("Wrong",0,-200,0,100,.5,1,.5)
|
||||
wrong.color = color.new("#bd2626")
|
||||
local skip = window:newTextButton("Skip",0,-100,0,100,.25,1,.5)
|
||||
skip.color = color.new("#5d5d5d")
|
||||
|
||||
window.apply({
|
||||
centerY = {true},
|
||||
}, imageHolder, plusLabel, imageHolder2)
|
||||
|
||||
window.apply({
|
||||
scaleFont={.7},
|
||||
centerFont={},
|
||||
align=window.ALIGN_CENTER,
|
||||
OnReleased=function(self)
|
||||
if self.text == "Skip" then
|
||||
callback()
|
||||
return
|
||||
end
|
||||
callback(self.text == "Correct")
|
||||
end,
|
||||
}, correct, wrong, skip)
|
||||
useDefaultHandler(callback)
|
||||
end
|
||||
|
||||
local function update(dt)
|
||||
|
||||
@@ -25,6 +25,7 @@ local function index(window, q, callback)
|
||||
label:setFont(50)
|
||||
label:centerFont()
|
||||
label:scaleFont(2/3)
|
||||
label.drawBorder = false
|
||||
|
||||
local choices = window:newFrame(noOf(0,.3,1,.7))
|
||||
choices.color = color.new("#363ac8")
|
||||
|
||||
+5
-20
@@ -10,14 +10,15 @@ local label
|
||||
local imageHolder
|
||||
|
||||
local function index(window, q, callback)
|
||||
frame = window:newFrame(0,0,0,-200,0,.2,1,.8)
|
||||
frame = window:newFrame(0,0,0,0,0,.2,1,.8)
|
||||
frame.visibility = 0
|
||||
label = window:newTextLabel(" " ..q.title.. " ",0,0,0,0,0,0,1,.2)
|
||||
label.align = ALIGN_CENTER
|
||||
label.textColor = color.white
|
||||
label.color = color.new("#363ac8")
|
||||
label:scaleFont(.5)
|
||||
label:scaleFont(.4)
|
||||
label:centerFont()
|
||||
label.drawBorder = false
|
||||
if not q.image or q.image == "" then
|
||||
error("Missing 'image' field for question!")
|
||||
end
|
||||
@@ -26,24 +27,8 @@ local function index(window, q, callback)
|
||||
imageHolder:centerX(true)
|
||||
imageHolder:centerY(true)
|
||||
imageHolder:setDualDim(0,0,imageHolder.imageWidth,imageHolder.imageHeight)
|
||||
local correct = window:newTextButton("Correct",0,-200,0,100,0,1,.5)
|
||||
correct.color = color.new("#52b11b")
|
||||
local wrong = window:newTextButton("Wrong",0,-200,0,100,.5,1,.5)
|
||||
wrong.color = color.new("#bd2626")
|
||||
local skip = window:newTextButton("Skip",0,-100,0,100,.25,1,.5)
|
||||
skip.color = color.new("#5d5d5d")
|
||||
window.apply({
|
||||
scaleFont={.7},
|
||||
centerFont={},
|
||||
align=window.ALIGN_CENTER,
|
||||
OnReleased=function(self)
|
||||
if self.text == "Skip" then
|
||||
callback()
|
||||
return
|
||||
end
|
||||
callback(self.text == "Correct")
|
||||
end,
|
||||
},correct,wrong,skip)
|
||||
|
||||
useDefaultHandler(callback)
|
||||
end
|
||||
|
||||
local function update(dt) -- time in seconds that has passed since
|
||||
|
||||
+3
-18
@@ -16,24 +16,9 @@ local function index(window, q, callback)
|
||||
label.color = color.new("#363ac8")
|
||||
label:centerFont()
|
||||
label:scaleFont(.075)
|
||||
local correct = window:newTextButton("Correct",0,-200,0,100,0,1,.5)
|
||||
correct.color = color.new("#52b11b")
|
||||
local wrong = window:newTextButton("Wrong",0,-200,0,100,.5,1,.5)
|
||||
wrong.color = color.new("#bd2626")
|
||||
local skip = window:newTextButton("Skip",0,-100,0,100,.25,1,.5)
|
||||
skip.color = color.new("#5d5d5d")
|
||||
gui.apply({
|
||||
scaleFont={.7},
|
||||
centerFont={},
|
||||
align=gui.ALIGN_CENTER,
|
||||
OnReleased=function(self)
|
||||
if self.text == "Skip" then
|
||||
callback()
|
||||
return
|
||||
end
|
||||
callback(self.text == "Correct")
|
||||
end,
|
||||
},correct,wrong,skip)
|
||||
label.drawBorder = false
|
||||
|
||||
useDefaultHandler(callback)
|
||||
end
|
||||
|
||||
local function update(dt) -- time in seconds that has passed since
|
||||
|
||||
+9
-22
@@ -15,13 +15,17 @@ local function index(window, q, callback)
|
||||
callback()
|
||||
return
|
||||
end
|
||||
frame = window:newFrame(0,0,0,-200,0,.2,1,.8)
|
||||
frame = window:newFrame(0,0,0,0,0,.2,1,.8)
|
||||
frame.visibility = 0
|
||||
label = window:newTextLabel(" " ..q.title.. " ",0,0,0,0,0,0,1,.2)
|
||||
label.align = ALIGN_CENTER
|
||||
label.textColor = color.white
|
||||
label.color = color.new("#363ac8")
|
||||
imageHolder = frame:newImageButton("assets/images/speaker.png",0,0,0,0,0,0,.3,.4)
|
||||
label:scaleFont(.4)
|
||||
label:centerFont()
|
||||
label.drawBorder = false
|
||||
imageHolder = frame:newImageButton("assets/images/speaker.png",0,0,0,0,0,0,.3,.3)
|
||||
imageHolder.scale = "h"
|
||||
imageHolder:setAspectSize(imageHolder.imageWidth,imageHolder.imageHeight)
|
||||
imageHolder:centerX(true)
|
||||
imageHolder:centerY(true)
|
||||
@@ -38,29 +42,12 @@ local function index(window, q, callback)
|
||||
sound:seek(0)
|
||||
end)
|
||||
end)
|
||||
local correct = window:newTextButton("Correct",0,-200,0,100,0,1,.5)
|
||||
correct.color = color.new("#52b11b")
|
||||
local wrong = window:newTextButton("Wrong",0,-200,0,100,.5,1,.5)
|
||||
wrong.color = color.new("#bd2626")
|
||||
local skip = window:newTextButton("Skip",0,-100,0,100,.25,1,.5)
|
||||
skip.color = color.new("#5d5d5d")
|
||||
window.apply({
|
||||
fitFont={},
|
||||
align=window.ALIGN_CENTER,
|
||||
OnReleased=function(self)
|
||||
sound:stop()
|
||||
if self.text == "Skip" then
|
||||
callback()
|
||||
return
|
||||
end
|
||||
callback(self.text == "Correct")
|
||||
end,
|
||||
},correct,wrong,skip)
|
||||
|
||||
useDefaultHandler(callback)
|
||||
end
|
||||
|
||||
local function update(dt) -- time in seconds that has passed since
|
||||
label:fitFont()
|
||||
label:centerFont()
|
||||
|
||||
end
|
||||
|
||||
return {
|
||||
|
||||
+4
-20
@@ -22,7 +22,8 @@ local function index(window, q, callback)
|
||||
label.textColor = color.white
|
||||
label.color = color.new("#363ac8")
|
||||
label:centerFont()
|
||||
label:scaleFont(.5)
|
||||
label:scaleFont(.4)
|
||||
label.drawBorder = false
|
||||
local holder = frame:newFrame(-300, -200, 600, 400, .5, .5)
|
||||
holder:centerX(true)
|
||||
holder:centerY(true)
|
||||
@@ -33,25 +34,8 @@ local function index(window, q, callback)
|
||||
video:play()
|
||||
end)
|
||||
video.XButton.visible = false
|
||||
local correct = window:newTextButton("Correct",0,-200,0,100,0,1,.5)
|
||||
correct.color = color.new("#52b11b")
|
||||
local wrong = window:newTextButton("Wrong",0,-200,0,100,.5,1,.5)
|
||||
wrong.color = color.new("#bd2626")
|
||||
local skip = window:newTextButton("Skip",0,-100,0,100,.25,1,.5)
|
||||
skip.color = color.new("#5d5d5d")
|
||||
window.apply({
|
||||
scaleFont={.7},
|
||||
centerFont={},
|
||||
align=window.ALIGN_CENTER,
|
||||
OnReleased=function(self)
|
||||
video:stop()
|
||||
if self.text == "Skip" then
|
||||
callback()
|
||||
return
|
||||
end
|
||||
callback(self.text == "Correct")
|
||||
end,
|
||||
},correct,wrong,skip)
|
||||
|
||||
useDefaultHandler(callback)
|
||||
end
|
||||
|
||||
local function update(dt) -- time in seconds that has passed since
|
||||
|
||||
+13
-24
@@ -10,14 +10,16 @@ local label
|
||||
local imageHolder
|
||||
|
||||
local function index(window, q, callback)
|
||||
frame = window:newFrame(0,0,0,-200,0,.2,1,.8)
|
||||
frame = window:newFrame(0,0,0,0,0,.2,1,.8)
|
||||
frame.visibility = 0
|
||||
label = window:newTextLabel(" " ..q.title.. " ",0,0,0,0,0,0,1,.2)
|
||||
label.align = ALIGN_CENTER
|
||||
label.textColor = color.white
|
||||
label.color = color.new("#363ac8")
|
||||
label:scaleFont(.5)
|
||||
label:scaleFont(.4)
|
||||
label:centerFont()
|
||||
label.drawBorder = false
|
||||
|
||||
local errors = {}
|
||||
|
||||
if type(q.zoom) ~= "string" and q.zoom ~= "" then
|
||||
@@ -33,7 +35,7 @@ local function index(window, q, callback)
|
||||
end
|
||||
|
||||
local zooms = {q.zoom, q.minzoom, q.fullimage}
|
||||
print(q.fullimage)
|
||||
|
||||
local index = 1
|
||||
local mul = 1
|
||||
|
||||
@@ -55,35 +57,22 @@ local function index(window, q, callback)
|
||||
|
||||
imageHolder:OnReleased(function()
|
||||
index = index + 1
|
||||
print(index)
|
||||
if index == 2 then
|
||||
mul = .5
|
||||
if q["zoom-deduct"] then
|
||||
mul = .5
|
||||
end
|
||||
elseif index == 3 then
|
||||
mul = .25
|
||||
if q["zoom-deduct"] then
|
||||
mul = .25
|
||||
end
|
||||
else
|
||||
index = 3
|
||||
end
|
||||
imageHolder:setImage(zooms[index])
|
||||
setMultiplier(mul)
|
||||
end)
|
||||
|
||||
local correct = window:newTextButton("Correct",0,-200,0,100,0,1,.5)
|
||||
correct.color = color.new("#52b11b")
|
||||
local wrong = window:newTextButton("Wrong",0,-200,0,100,.5,1,.5)
|
||||
wrong.color = color.new("#bd2626")
|
||||
local skip = window:newTextButton("Skip",0,-100,0,100,.25,1,.5)
|
||||
skip.color = color.new("#5d5d5d")
|
||||
window.apply({
|
||||
scaleFont={.7},
|
||||
centerFont={},
|
||||
align=window.ALIGN_CENTER,
|
||||
OnReleased=function(self)
|
||||
if self.text == "Skip" then
|
||||
callback()
|
||||
return
|
||||
end
|
||||
callback(self.text == "Correct", mul)
|
||||
end,
|
||||
},correct,wrong,skip)
|
||||
useDefaultHandler(callback)
|
||||
end
|
||||
|
||||
local function update(dt) -- time in seconds that has passed since
|
||||
|
||||
Reference in New Issue
Block a user