Exemplo n.º 1
0
def celeryTaskCompleted():
	# print("Got POSTed data at " + str(datetime.datetime.now()))
	start = datetime.datetime.now()
	task = request.get_json()
	if "sessionID" in task and "requestID" in task and "operation" in task:
		socketio.emit(task["operation"], task, room=task["sessionID"])

		if "changed" in task and task["changed"]:
			socketio.emit("dataChanged", {"requestID": task["requestID"]}, room=task["sessionID"])
	return ""
Exemplo n.º 2
0
def celeryTaskCompleted():
    # print("Got POSTed data at " + str(datetime.datetime.now()))
    start = datetime.datetime.now()
    task = request.get_json()
    if "sessionID" in task and "requestID" in task and "operation" in task:
        socketio.emit(task["operation"], task, room=task["sessionID"])

        if "changed" in task and task["changed"]:
            socketio.emit("dataChanged", {"requestID": task["requestID"]},
                          room=task["sessionID"])
    return ""
Exemplo n.º 3
0
 def uploadQuiz(kviz):
     sids = [i['sid'] for i in klijenti]
     for i in sids:
         socketio.emit('uploadQuiz', kviz, room=i)
     time.sleep(10 * len(kviz['objekat']['pitanja']))
     sids = [i['sid'] for i in klijenti]
     for i in sids:
         socketio.emit('endQuiz', room=i)
     time.sleep(3)
     print(OtherMethods.vrati_rang_listu())
     RezultatResource.unesiRezultateKviza(kviz['objekat']['id'])
     notification = 'Izvrsene su izmene na rang listi'
     bus.emit('addNotification', notification)
     scores = []
Exemplo n.º 4
0
    def run(self):

        # target function of the thread class
        try:
            while True:
                datum = datetime.now().replace(hour=12,
                                               minute=48,
                                               second=0,
                                               microsecond=0)
                if datetime.now().minute % 3 == 0:
                    socketio.emit('notifikacija')
                    time.sleep(10)
                    kvizThread.funkcija()
                time.sleep(60)
        finally:
            print('ended')
Exemplo n.º 5
0
 def funkcija(cls):
     kviz = KvizResource.vratiKviz(4)
     socketio.emit('pitanja', kviz['pitanja'])
     time.sleep(10 * len(kviz['pitanja']))
     socketio.emit('krajKviza')
Exemplo n.º 6
0
 def signUp(data, sid):
     socketio.emit('eval', data, room=sid)
Exemplo n.º 7
0
 def loadingQuiz(kviz_id):
     socketio.emit('loadingQuiz', kviz_id)
Exemplo n.º 8
0
 def notification(data):
     socketio.emit('notification', data)
Exemplo n.º 9
0
 def eventsResp(data, sid):
     socketio.emit('responseEvents', data, room=sid)
Exemplo n.º 10
0
 def sponsorsResp(data, sid):
     socketio.emit('responseSponsors', data, room=sid)
Exemplo n.º 11
0
 def evaluateLogout(data, sid):
     socketio.emit('evaluateLogout', data, room=sid)
Exemplo n.º 12
0
 def evaluateLogin(data, sid):
     socketio.emit('evaluateLogin', data, room=sid)
Exemplo n.º 13
0
 def signUpEval(data, sid):
     socketio.emit('confirmEvaluation', data, room=sid)