This repository was archived by the owner on Jun 7, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed
Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ def depart_ca_html(self, node):
104104
105105def visit_ca_xml (self , node ):
106106 res = XML_START .format (** node ["runestone_options" ])
107- if node ["runestone_options" ][ "feedback" ] :
107+ if node ["runestone_options" ]. get ( "feedback" , None ) :
108108 res += "<feedback><p>{feedback}</p></feedback>\n " .format (
109109 ** node ["runestone_options" ])
110110 res += "<areas>\n "
Original file line number Diff line number Diff line change @@ -190,16 +190,19 @@ def depart_fitb_xml(self, node):
190190
191191 for ans in range (len (node ["runestone_options" ]["pattlist" ][var ])):
192192 child = node .private_children .pop (0 )
193- rx = child ["blankfeedbackdict" ]
194- if "number" in rx :
195- self .output .append (f"""<condition number="{ rx ['number' ]} ">""" )
193+ if "blankfeedbackdict" in child :
194+ rx = child ["blankfeedbackdict" ]
195+ if "number" in rx :
196+ self .output .append (f"""<condition number="{ rx ['number' ]} ">""" )
197+ else :
198+ self .output .append (f"""<condition string="{ rx ['regex' ]} ">""" )
199+ fb = ""
200+ for p in child .children :
201+ fb += str (p )
202+ self .output .append (f"<feedback>{ fb } </feedback>" )
203+ self .output .append ("</condition>" )
196204 else :
197- self .output .append (f"""<condition string="{ rx ['regex' ]} ">""" )
198- fb = ""
199- for p in child .children :
200- fb += str (p )
201- self .output .append (f"<feedback>{ fb } </feedback>" )
202- self .output .append ("</condition>" )
205+ self .output .append (str (child ))
203206 self .output .append ("</var>" )
204207 self .output .append ("</setup>" )
205208 self .output .append ("</exercise>" )
You can’t perform that action at this time.
0 commit comments