Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 85ae9a926d
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (27 sloc) 1.075 kB
# Model Defining Questions Database
import string
from google.appengine.ext import db
class question(db.Model):
questionNumber = db.IntegerProperty(required=True)
question = db.StringProperty(required=True, multiline=True)
qimage = db.StringProperty()
opt1 = db.StringProperty(required=True, multiline=True)
opt2 = db.StringProperty(required=True, multiline=True)
opt3 = db.StringProperty(required=True, multiline=True)
opt4 = db.StringProperty(required=True, multiline=True)
ans = db.StringProperty(required=True)
def getQuestion(num,var):
query = question.all()
q = query.filter('questionNumber =',num).get()
if q:
return ("{"+
"\"num\" : " + "\""+str(var)+"\""+","+
"\"question\" : "+"\""+q.question.replace('\r\n','<br />')+"\""+","+
"\"image\" : "+"\""+q.qimage+"\""+","+
"\"options\" : " + "["+
"\""+q.opt1.replace('\r\n','<br />')+"\""+","+
"\""+q.opt2.replace('\r\n','<br />')+"\""+","+
"\""+q.opt3.replace('\r\n','<br />')+"\""+","+
"\""+q.opt4.replace('\r\n','<br />')+"\""+
"]"+
"}")
Jump to Line
Something went wrong with that request. Please try again.