ndunand / moodle-qtype_matrix

Source code of https://moodle.org/plugins/qtype_matrix
2 stars 10 forks source link

copying a kprime question the answer statements are lost in the original question #22

Closed isacsonk closed 9 years ago

isacsonk commented 10 years ago

how to reproduce

1) create kprime question 2) after creating it click the edit symbol and instead of save, click the copy button 3) in the copy of the original question the content of the answer statements is gone.

requirement

when copying a question the question but also the answer statements should be copied

isacsonk commented 10 years ago

actually I'm not quite sure if the answer statements are lost in the copy or in the original. If I creat a question called kprimquestion and save it. Then I click the edit symbol and I add copy to the title --> kprimquestioncopy and click on the copy button. I now have two questions kprimquestioncopy and kprimquestion. The answer statements are gone in the question kprimquestion

isacsonk commented 10 years ago

I couldn't reproduce this bug on our live installation, maybe it was introduced with #18

ghost commented 10 years ago

Very possible that it was introduced with the solution for #18...

ghost commented 10 years ago

Perhaps I'm doing it wrong but I don't see a copy button: screen shot 2014-09-11 at 1 22 28 am

isacsonk commented 10 years ago

Maybe Moodle 2.7 doesn't have the copy button? See screenshot Moodle 2.6.4:

copy

ghost commented 10 years ago

Actually I'm on 2.8 beta. But I wonder if there are certain settings or circumstances in which this button appears / disappears. I couldn't find any info on that in google from my preliminary searches.

tkorner commented 10 years ago

In fact Tim Hunt changed the way copying works in 2.7: You now have to duplicate the question (duplicate button). bildschirmfoto 2014-09-11 um 11 28 03

see also: https://moodle.org/mod/forum/discuss.php?d=267406

ghost commented 10 years ago

This should do the trick.

isacsonk commented 10 years ago

hmm. What trick did you do? One that works with 2.8? on 2.6.4 the content of the answer statements in the original question still disappear and the question looks quite ugly in the test run view. You now can insert new answer statements but one would want the original to stay.

ghost commented 10 years ago

I didn't do any trick:) It's merely a figure of speech meaning "this should work now". Weird that it doesn't work for you... let's think why. I indeed tested with 2.8beta the way that Thomas showed how (the only way I knew, via the course question bank duplicate button) and fixed the problem that I found. The thing is, what I fixed shouldn't (I think) depend on 2.6 or 2.8 or whatever. It was a problem in matrix, not in moodle: https://github.com/ETHZLET/moodle-qtype_matrix/commit/845fe6cf9cd7841589dad8c88b96433c390e0d65

isacsonk commented 10 years ago

I know, I know ;-), I was just joking because it didn't work for me, and from the checkins and your comment I didn't know what you had changed and what exactely should work now. So what do I do differently? The testserver should be up to date because I asked Kai to update it, and he confirmed he had done so. Here is how I do it: 1) I create a matrix question (starting from within the question bank) 2) I go into that question again as if I would want to edit it. 3) Add copy to the title and then click on the button "copy" 4) then a have the original question and the copy, in the original question the content of the answer statements are gone and when I look at the preview it looks like this:

noanswerstatementincopy

ghost commented 10 years ago

Since in 2.8 there is no such "copy" button I cannot test this, but maybe you can check if using the method Thomas showed the problem is fixed or not. Go to the course homepage, on the left sidebar pick "question bank" and then "questions". You will get to a page with a URL that should resemble (in the end of the URL) /question/edit.php?courseid=3 where instead of 3 you will have your actual course ID. Then click on the two-files button corresponding to your question and see if the problem persists.

laurentopprecht commented 9 years ago

can copy in the question bank