File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -157,9 +157,18 @@ public function save_question_options($fromform) {
157157 }
158158 }
159159 break ;
160- // Ideally importasversion would handle notice/errors messages.
161- // That would allow us to show validation messages in Gitsync
162- // and when importing as new.
160+ case 'question-bank-importasversion-import ' :
161+ $ throwexceptions = false ;
162+ $ result = new \StdClass ();
163+ if (!empty ($ fromform ->validationerrors )) {
164+ $ result ->notice = $ fromform ->validationerrors ;
165+ $ dashboardlink = new moodle_url ('/question/type/stack/questiontestrun.php ' , ['questionid ' => $ fromform ->id ]);
166+ $ result ->notice = html_writer::link (
167+ $ dashboardlink ,
168+ $ fromform ->name
169+ ) . '<br> ' . $ result ->notice ;
170+ }
171+ break ;
163172 default :
164173 // Edit page and everything else should behave as before.
165174 $ result = null ;
You can’t perform that action at this time.
0 commit comments