Commit 026eaa08 by Piotr Mitros

Minor improvements

parent 1dad5cae
...@@ -138,15 +138,22 @@ class LoncapaProblem(): ...@@ -138,15 +138,22 @@ class LoncapaProblem():
return correct_map return correct_map
def handle_schem(self, element): def handle_schem(self, element):
height = 480 print element
width = 640 height = element.getAttribute('height')
width = element.getAttribute('width')
if height=="":
height=480
if width=="":
width=640
self.lid+=1 self.lid+=1
id=str(self.gid)+'_'+str(self.lid) id=str(self.gid)+'_'+str(self.lid)
html='<input type="hidden" class="schematic" name="{id}" '+ \ html='<input type="hidden" class="schematic" name="input_{id}" '+ \
'height="{height}" width="{width}" value="{value}">' 'height="{height}" width="{width}" value="{value}" id="input_{id}">'
html = html.format(height=height, width=width, id=id, value="")
print html
return html.format(height=height, width=width, id=id, value="") return html
def grade_schem(self, element): def grade_schem(self, element):
return "correct" return "correct"
......
...@@ -100,7 +100,7 @@ function Schematic(input) { ...@@ -100,7 +100,7 @@ function Schematic(input) {
this.status_div.style.position = 'absolute'; this.status_div.style.position = 'absolute';
this.status_div.style.padding = '2px'; this.status_div.style.padding = '2px';
this.status_div.style.backgroundColor = element_style; this.status_div.style.backgroundColor = element_style;
this.status = document.createTextNode('Wow, schematic entry all in javascript!'); this.status = document.createTextNode('Ready.');
this.status_div.appendChild(this.status); this.status_div.appendChild(this.status);
this.connection_points = new Array(); // location string => list of cp's this.connection_points = new Array(); // location string => list of cp's
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment