Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- import numpy as np
- ##-------------------------------- section I ------------------------------------------
- image_list = []
- curve = np.array(["shape2.jpg", "shape3.jpg","shape7.jpg","shape8.jpg", "shape9.jpg","shape11.jpg","shape12.jpg", "shape13.jpg", "shape14.jpg"])
- image_list.extend(curve)
- close = np.array(["shape2.jpg", "shape3.jpg", "shape6.jpg", "shape7.jpg", "shape8.jpg", "shape9.jpg", "shape11.jpg", "shape12.jpg", "shape14.jpg"])
- image_list.extend(close)
- diag = np.array(["shape1.02.jpg", "shape3.jpg", "shape5.jpg", "shape6.jpg", "shape13.jpg"])
- image_list.extend(diag)
- sym = np.array(["shape2.jpg", "shape3.jpg", "shape4.jpg", "shape5.jpg", "shape6.jpg", "shape7.jpg", "shape10.jpg", "shape14.jpg"])
- image_list.extend(sym)
- image_list = np.unique(image_list)
- text = ['curve?', 'sym?', 'diag?', 'sym']
- #counter = 0
- for symbo in image_list:
- #counter += 1
- #print counter
- #print symbo
- exp.sym_cnvs = self.offline_canvas()
- xc = exp.sym_cnvs.xcenter()
- yc = exp.sym_cnvs.ycenter()
- chosen_text = random.choice(text)
- exp.text_cnvs = self.offline_canvas()
- cx = exp.text_cnvs.xcenter()
- cy = exp.text_cnvs.ycenter()
- sympic = exp.get_file(symbo)
- #print type(sympic)
- exp.sym_cnvs.image(sympic, xc, yc)
- exp.text_cnvs.set_font("mono",100)
- exp.text_cnvs.text(chosen_text, cx, cy)
- if symbo in diag:
- if chosen_text == 'diag?':
- exp.set("correct_response", "y")
- else:
- exp.set("correct_response", "n")
- if symbo in curve:
- if chosen_text == 'curve?':
- exp.set("correct_response", "y")
- else:
- exp.set("correct_response", "n")
- if symbo in close:
- if chosen_text == 'close?':
- exp.set("correct_response", "y")
- else:
- exp.set("correct_response", "n")
- if symbo in sym:
- if chosen_text == 'sym?':
- exp.set("correct_response", "y")
- else:
- exp.set("correct_response", "n")
- RUN PHASE:
- exp.sym_cnvs.show()
- self.sleep(3000)
- exp.sym_cnvs.clear()
- exp.text_cnvs.show()
- #self.sleep(3000)
- exp.text_cnvs.clear()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement