File tree Expand file tree Collapse file tree
resources/js/pages/instructors/assignment_information Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -151,16 +151,16 @@ public function refreshProperties(Question $question): array
151151
152152 try {
153153
154- $ response ['type ' ] = 'error ' ;
155- $ authorized = Gate::inspect ('refreshProperties ' , [$ question ]);
156- if (!$ authorized ->allowed ()) {
157- $ response ['message ' ] = $ authorized ->message ();
158- return $ response ;
159- }
154+ $ response ['type ' ] = 'error ' ;
155+ $ authorized = Gate::inspect ('refreshProperties ' , [$ question ]);
156+ if (!$ authorized ->allowed ()) {
157+ $ response ['message ' ] = $ authorized ->message ();
158+ return $ response ;
159+ }
160160
161161 $ response ['type ' ] = 'error ' ;
162162 $ question ->refreshProperties ();
163-
163+ $ response [ ' solution_html ' ] = $ question -> solution_html ?: null ;
164164 $ response ['type ' ] = 'success ' ;
165165 } catch (Exception $ e ) {
166166 $ h = new Handler (app ());
Original file line number Diff line number Diff line change 262262 {{ item.submission }}
263263 </td >
264264 <td >{{ item.points }}</td >
265- <td ><SolutionFileHtml :key =" item .question_id " :questions =" items " :current-page =" item .order "
266- :format-filename =" false "
267- />
265+ <td >
266+ <SolutionFileHtml :key =" item .question_id " :questions =" items " :current-page =" item .order "
267+ :format-filename =" false "
268+ />
268269 <td v-if =" user.role === 2" >
269270 <b-tooltip :target =" getTooltipTarget('edit',item.question_id)"
270271 delay =" 500"
@@ -335,6 +336,7 @@ import {
335336 updateNonLearningTreeInLearningTreeMessage
336337} from ' ~/helpers/AssessmentTypeWarnings'
337338import SolutionFileHtml from ' ~/components/SolutionFileHtml'
339+
338340export default {
339341 middleware: ' auth' ,
340342 components: {
@@ -405,12 +407,15 @@ export default {
405407 this .items [i].refresh_status = data .type === ' success'
406408 ? ' <span class="text-success">Success</span>'
407409 : ' <span class="text-danger">Error</span>'
410+ if (data .type === ' success' && data .solution_html ) {
411+ this .items [i].solution_html = data .solution_html
412+ this .items [i].type = ' html'
413+ }
408414 } catch (error) {
409415 this .items [i].refresh_status = ' <span class="text-danger">Error</span>'
410416 }
411417 this .$forceUpdate ()
412418 }
413-
414419 },
415420 viewQuestionInModal (question , action ) {
416421 this .alphaAssignmentQuestion = question
You can’t perform that action at this time.
0 commit comments