I'm running Moodle 4.2 (Build: 20230424). When I edit a question and press the "Save changes" button, the changes are not saved.
Is this issue known?
If you set a question to a previous version, that version is displayed in the preview and the editor, no matter what.
On the other hand, if you set it to "Always latest", this version is not displayed in the preview nor in the editor (unless you press "Start a new preview" which you shouldn't have to).
If you set a question to "Always latest", the latest version should be displayed by default whenever the question has been saved.
I hope I don't offend anyone by saying that things look confusing to me as they are, and that in my opinion there is no advantage in not showing the latest version of a question by default if it is set as such.
@TimHunt or a developer of the question bank,
Thanks to Andrew for bringing up the random question topic.
The situation is even worse with random questions. A given question is updated only when you press the "Start a new preview" button, but since the questions are random, the question may disappear in the new preview without you being able to see the result of the change to the question.
I would prefer not to argue with Andrew here, but simply draw a developer's attention to the lack of logic in how the "Always latest" setting is applied to the question editor and preview, i.e. the fact that it would be much better to just show the latest version of a question when it's set that way.
As more people upgrade to Moodle 4.x, and start interacting with the question versionning featue, we are learning more about where the unsability problems are. (Thanks to everyone who has shared their experiences here.)
And, as we identify problems, we are gradually working on improving things. For example MDL-75301 was an improvement related to question preview. This is what you see in question preview now.
MDL-75301.png" alt="New question preview UI." class="img-fluid atto_image_button_text-bottom" width="448" height="370">
In the case of quiz preview, which is what we are discussing here, Andrew and Matthias have analysed the problem, and the 'answer' is that you have to start a new preview. But, that is not obivous. MDL-77745 is being worked on right now, which should help to make it clearer what is going on. Here is the mock-up of what that might look like when it is done:
I am not saying that is a total solution. Just a step in the right direction.
So, please keep reporting what is not yet easy enough to work with, and we will keep listening, and improving things as we can.
Thank you for considering user feedback.
In Moodle 3.x, it was already a bit not obvious to have to click "Start a new preview" after editing a question. Indeed, if we edited a question, why would we have wanted to preview the unedited version? But at least when saving the question, the latest version (since there was only one) was displayed in the editor.
Now with version 4.x, it is still not obvious, I would even say a little awkward, to have to click "Start a new preview" after having edited a question. The reason is the same, why would one want to preview the unedited version of a question? But worse, if you don't click "Start a new preview", the editor doesn't display the latest version of the question. This is really not obvious.
I think it would be good to update the preview as soon as you press the "Save changes" or "Save changes and continue editing" buttons in the editor. In fact, this is what is done when editing a question via "Questions" in the main menu of a quiz.
May I suggest that the following behaviour should be added to the random question algorithm, i.e. provide the same questions. Call it "fixed random behaviour". When "Save changes" is clicked in the editor, the "fixed random behaviour" would be triggered. If you then press "Start a new preview", the regular algorithm would be triggered.
I like to go through "Quiz / Preview quiz" (or "Quiz / Continue the last preview" to edit one or the other of the quiz questions because I have, in the preview, an overview of the questions as they appear in the quiz.
Assuming we're talking about the same thing, I think it would be handy to ... [automatically] update the preview when the question is edited.... I am convinced that this could be technically difficult to do.
However, a temporary workaround, which can be easily implemented even by teachers, is to add a little client-side JavaScript code. The logic is simple:
This code only contains about 10 lines. It can be placed for example by a teacher at the level of a quiz, or at the level of a course therefore for all the quizzes of the course, or by an administrator at the level of a site for all the quizzes in all the courses of the site.
The code uses jQuery. Since this is a temporary patch, it shouldn't be too much of a problem. In my opinion, the code is generally safe. But if you're not comfortable with jQuery, at worst just don't use this workaround.
// WHILE ON THE QUESTION EDIT PAGE: if ( window.location.href.indexOf("question/bank/editquestion/question.php") > -1 && window.location.href.indexOf("attempt.php") > -1) { // ON CLICKING THE SAVE BUTTON, // SET A SESSION STORAGE KEY, questionsaved, TO "yes". $("input#id_submitbutton").on("click", function(){ sessionStorage.setItem("questionsaved", "yes"); }); } // WHILE ON THE PREVIEW PAGE: if ( window.location.href.indexOf("mod/quiz/attempt.php") > -1 ) { // RETREIVE THE VALUE OF THE questionsaved SESSION STORAGE KEY. var dcquestionsaved = sessionStorage.getItem("questionsaved"); // IF THE VALUE OF THE questionsaved SESSION STORAGE KEY IS EQUAL TO "yes", // TRIGGER THE "Start a new preview" BUTTON AND RESET THE VALUE OF THE questionsaved KEY. if( dcquestionsaved == "yes" ){ $("#mod_quiz_navblock button[type=submit]").trigger("click"); sessionStorage.setItem("questionsaved", "reset"); } }
Tracker MDL-78547➚: You can log in and vote for this issue: