@@ -86,7 +86,7 @@ <h3 class="original-size suggestion">Editing Question</h3>
86
86
</ div >
87
87
< div id ="all-question-blocks ">
88
88
89
- {% for index , question_dict in questions_dict.items %}
89
+ {% for qnum , question_dict in questions_dict.items %}
90
90
< div class ="question-block ">
91
91
< input type ="hidden " value ="{{question_dict.question.pk}} " name ="{{forloop.counter}}_question_pk "/>
92
92
< input type ="hidden " value ="{{forloop.counter}} " class ="question-number-value "/>
@@ -174,7 +174,17 @@ <h3 class="original-size suggestion">Editing Question</h3>
174
174
{{answer.content}}</ div >
175
175
{% endif %}
176
176
177
- < input type ="hidden " name ="{{answer.pk}} " value ="{{answer.get_pk_ac}}_mcq "/>
177
+ < input type ="hidden " value ="{{answer.pk}} " name ="{{answer.get_pk_ac}}_mcq "/>
178
+ <!--Important not to have an _answer_value input field here because the backend
179
+ does not expect that for an mcq edit.
180
+ -->
181
+ {% if answer.is_answer %}
182
+ < input class ="answer_info " type ="hidden " value ="1 " name ="{{answer.get_pk_ac}}_mcq "/>
183
+ {% else %}
184
+ < input class ="answer_info " type ="hidden " value ="0 " name ="{{answer.get_pk_ac}}_mcq "/>
185
+ {% endif %}
186
+
187
+
178
188
< div class ="add-delete-btns ">
179
189
< button type ="button " class ="btn btn-danger mcq-delete exempt "> delete</ button >
180
190
</ div >
@@ -210,7 +220,7 @@ <h3 class="original-size suggestion">Editing Question</h3>
210
220
< div class ="formatted-answer ">
211
221
{{answer.part_b}}
212
222
</ div >
213
- < input type ="hidden " name ="{{answer.pk}} " value ="{{answer.pk}}_matching_pairs "/>
223
+ < input type ="hidden " value ="{{answer.pk}} " name ="{{answer.pk}}_matching_pairs "/>
214
224
< button type ="button " class ="btn btn-danger mp-delete exempt "> delete</ button > < br />
215
225
</ div >
216
226
@@ -233,17 +243,23 @@ <h3 class="original-size suggestion">Editing Question</h3>
233
243
< div class ="answer-fields ">
234
244
235
245
</ div >
246
+ {% if question_dict.qtype == "struct"%}
247
+ < div class ="formatted-answer-option unexpand structural-formatted-answer ">
248
+
249
+ {% if question_dict.answer.get_answer_code == 2%}<!--if latex-->
250
+ < input type ="hidden " class ="hidden_answer latex " value ="{{question_dict.answer.content}} "/>
251
+ {% else %}<!-- if expression or float -->
252
+ < input type ="hidden " class ="hidden_answer expression " value ="{{question_dict.answer.content}} "/>
253
+ {% endif %}
254
+
255
+ </ div >
256
+ < br />
257
+ {% else %}
258
+ < div class ="formatted-answer-option unexpand structural-formatted-answer " style ="display:none; ">
236
259
237
- < div class ="formatted-answer-option unexpand structural-formatted-answer ">
238
- {% if question_dict.qtype == "struct"%}
239
- {% if question_dict.answer.get_answer_code == 2%}<!--if latex-->
240
- < input type ="hidden " class ="hidden_answer latex " value ="{{question_dict.answer.content}} "/>
241
- {% else %}<!-- if expression or float -->
242
- < input type ="hidden " class ="hidden_answer expression " value ="{{question_dict.answer.content}} "/>
243
- {% endif %}
244
- {% endif %}
245
- </ div >
246
- < br />
260
+ </ div >
261
+ {% endif %}
262
+
247
263
248
264
< div class ="calculator-area-div "> </ div > < br />
249
265
@@ -270,7 +286,7 @@ <h3 class="original-size suggestion">Editing Question</h3>
270
286
</ div >
271
287
272
288
< hr />
273
- < button class ="btn btn-outline-success check-question-btn "> Add Part</ button >
289
+ < button class ="btn btn-outline-success check-question-btn " style =" display:none; " > Add Part</ button >
274
290
< br /> < br />
275
291
< div class ="hidden-settings ">
276
292
{% if question_dict.qtype == 'struct' %}
@@ -327,7 +343,7 @@ <h3 class="original-size suggestion">Editing Question</h3>
327
343
< h4 class ="suggestion original-size "> Settings</ h4 >
328
344
< hr />
329
345
< select title ="Part " name ="settings-select " class ="settings-select field-style ">
330
- {% for index , question_dict in questions_dict.items %}
346
+ {% for qnum , question_dict in questions_dict.items %}
331
347
< option class ="settings-option-{{forloop.counter}} " value ="{{forloop.counter}} "> Part {{question_dict.question.number}}</ option >
332
348
{% endfor %}
333
349
</ select >
0 commit comments