Button for remove of test trials from teacher(s)?

Button for remove of test trials from teacher(s)?

Ger Tielemans -
回帖数:43
When a teacher creates a test/quiz, he and other teachers do several trials.

How can we remove these trials from the question-analysis-data-set?

  • preferred solution: a button on the analysis page with the label: remove teacher trials

In the meantime... Is there a workaround?

(unenroll does not work..)

回复Ger Tielemans

perhaps a Preview Quiz button?

Siegwart Mayr -

I think a better solution would be to have a "Quiz Preview" button instead, located inside while editing the quiz. 

I find it a requirement to always preview each quiz I create, and it is cumbersome to save the quiz with a different date/time to allow me to go in an try it, then have to go back and reset the date/time to the actual quiz time.  And, as Ger is pointing out, the data gets stored so that the analysis data does not reflect the true results.

My current solution has been to just go open the quiz, view it, but then never actually save it.  However, for some teachers this is not a good solution since they actually want to test whether the quiz questions perform as they should (and give all the right feedback, etc.).

回复Siegwart Mayr

Re: perhaps a Preview Quiz button?

Frederic Triquet -
Hi,
maybe my post is coming too late, but some time ago I posted (http://moodle.org/mod/forum/discuss.php?d=2983) a "Quiz Preview" functionality.

One thing to notice about it is you have to save the quiz before previewing it (not very cool because saving the quiz leads you back to the course view, thus you have to edit again the saved quiz to be able to preview it mixed )

Maybe things would be easier if "save quiz" button only saved the quiz smile and stay on the same page...

Or maybe my "Quiz preview" is now totally obsolete (I did not test the new stuff presented in the thread...)

Fred.
回复Frederic Triquet

Re: perhaps a Preview Quiz button?

Siegwart Mayr -

Oh, thanks for posting that information and code.  I will try it. 

Yes, I agree with you about the importance of the "Quiz Preview" button while editing the quiz.   If  the "Save Quiz" button would only save the data, then an extra "Save & Exit" button could have the functionality of the current button.

回复Ger Tielemans

Re: Button for remove of test trials from teacher(s)?

Thomas Robb -
I agree that there should be a way for not only deleting trial attempts, but also to allow an erroneous student attempt to be deleted.

I have now implemented a "delete" feature in the "Details Statistics" plug-in, fullstat.php so that underneath each student's name, (Delete) now appears. The screen is then redrawn with that instance removed. I have committed it to CVS so I would appreciate it if someone with deletable data would try it out.

Note that this is an 'instant delete'. I tried to implement a "confirm" feature, but it just got too complex, so use it with care!
回复Thomas Robb

Re: Button for remove of test trials from teacher(s)?

Thomas Robb -
Sorry, I erred in the file name of the revised Detailed Statistics file which includes an attempt delete function: It is: /mod/quiz/report/fullstat/report.php -- Tom
回复Thomas Robb

Re: Button for remove of test trials from teacher(s)?

Martin Dougiamas -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像
Thanks, Thom - although I'm not sure the detailed statistics page is the best place for this ... probably this should be on the Overview page.
回复Martin Dougiamas

Re: Button for remove of test trials from teacher(s)?

Thomas Robb -
>probably this should be on the Overview page.

Yes, but the overview page currently lists multiple attempts on a single line which makes it unsuitable. It could go in the simplestat plug-in (or perhaps in both simple & full?)

Orders, please, dear Commander!

回复Thomas Robb

Re: Button for remove of test trials from teacher(s)?

Przemyslaw Stencel -
> but the overview page currently lists multiple attempts on a single line which makes it unsuitable

Maybe the attempts should be put on separate lines? This would not only allow for the "delete" button to be inserted next to each attempt, but more info could be displayed about attempts, e.g. date, time spent. See attached screenshot.
附件 quiz_attempts.gif
回复Przemyslaw Stencel

Re: Button for remove of test trials from teacher(s)?

Thomas Robb -
Putting each attempt on a new line would make sense. I'd like to hear from Martin before messing with the code, particularly since this accesses a lib.php function which would have to be modified, or a similar one created.
回复Thomas Robb

Re: Button for remove of test trials from teacher(s)?

Martin Dougiamas -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像
I like Prem's idea there, and adding date and duration sounds good too. Go for it!
回复Martin Dougiamas

Re: Button for remove of test trials from teacher(s)?

Przemyslaw Stencel -
Sometimes you may have been looking at something for a long time and not notice that there is something wrong. This happened to me with this "attempts" table. I've seen it hundreds of times and I haven't noticed that the last column says "Best Grade", whatever the grading method has been chosen. Thus, if the grading method is "First attempt" and the attempts are e.g. 20pts (first) and 50pts (second), the last column will have 20pts as the "best grade". Maybe the column heading should just say "Final Grade"?

A small thing, but may be confusing for the students. I'll file a bug on this.

Edit: I'll file an issue on this. wink
回复Martin Dougiamas

Quiz Overview Module - delete attempts + augmented display

Thomas Robb -
Here it is. It looks somewhat like Przemek's graphic but with the date and time added. A single entry looks like this: score-date-time-duration-deleteButton

100 14Dec03 13:45 (3:44) X

The date and time are hard-wired in, so Martin might want to allow moodle to localize the format. There is a warning before deletion via a Javascript "Confirm" pop-up. The string it uses is looked up in the lang/en/quiz.php file.

None of this has been committed to CVS since I don't think I have the necessary "kharma" for the quiz/lib.php file.

回复Thomas Robb

Re: Quiz Overview Module - delete attempts + augmented display

Ger Tielemans -

Fantastic smile big grin tongueout 

I killed the trials one by one

....only end up with a last trial score, if that is NOT in the results, it is OK for me.

Great, great , great: By the way Koen,is that report.php from you working or just a Mockup. (I had no trials left to test it..)

回复Ger Tielemans

Re: Quiz Overview Module - delete attempts + augmented display

koen roggemans -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Translators的头像
Adding some checkboxes in HTML.. ok for me. But the real programmersstuff is not (hopefully yet) my thing. It was just a dummy.
回复Thomas Robb

Re: Quiz Overview Module - delete attempts + augmented display

koen roggemans -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Translators的头像

Great feature Thomas. I was hoping for this a long time.

As you can see in the added real-life example of a (short) quiz, the maximum grade and the name of a student (teacher in this case) is left behind after deleting all the attempts. Are you planning to delete this last data too since they are not usefull anymore if all the attempts are whiped out.

回复Thomas Robb

Re: Quiz Overview Module - delete attempts + augmented display

Joseph Vargas -

Just tested your quiz delete function. Thought you'd like to know what I found.

It seems to delete the entries from the mdl_quiz_attempts database, but it doesn't delete the appropriate entries from the mdl_quiz_grades and mdl_quiz_qustion_grades databases. Can you do this as well?

Also, when I first tested your upgrade, I had 5 test takers in my demo moodle installation.  When I tried to delete the 3 times that I took the test, it deleted the first and second fine, except for the high grade. When I deleted the third, it also deleted entries for the other test takers.

Thanks for your work on this very usefull feature

回复Joseph Vargas

Re: Quiz Overview Module - delete attempts + augmented display

Thomas Robb -
Thanks for testing the function out. I just programmed it to delete a single instance from the mdl_quiz_instances table. Obviously there are other elements that need to be adjusted.

Actually, it's a bit un-moodle-like for the same datum to exist in two separate locations, but that is the way the quiz grades have been implemented. Otherwise, the highest grades would have to be computed every time a report was requested.

I'll try to get this worked out today.
回复Thomas Robb

Re: Quiz Overview Module - delete attempts + augmented display

Martin Dougiamas -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像
Yes, for performance reasons there's some "caching" of data in the places that Joe kindly listed.  I mentioned a quick database hack earlier which was misleading, sorry.

A quiz_delete_attempt($attempt) function should:
  1. delete the record from quiz_attempts
  2. delete matching responses (based on $attempt->id) from quiz_responses and
  3. check for remaining attempts, if none then delete the record from quiz_grades, otherwise call quiz_save_best_grade($quiz, $userid) to recalculate the final grade
回复Martin Dougiamas

Re: Quiz Overview Module - delete attempts + augmented display

Thomas Robb -
Hey, Martin, being too explicit takes all the fun out it! 微笑

Fortunately, I've done exactly what you listed (in the new, improved version). There's just one little glitch to work out -- deleting the very last attempt causes an error, and I haven't figured out quite what I have to do to prevent it. I expect to post the new version shortly, however.
回复Thomas Robb

Re: Quiz Overview Module - delete attempts + augmented display

Martin Dougiamas -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像
Can I lob a grenade in to your pocket and ask for checkboxes on each line (like Koen's example) instead of X links?  tongueout  wide eyes  

Then we could have a "Select All" button down the bottom and the whole chunks could be cleared rather simply.   Next version, maybe.   大笑
回复Martin Dougiamas

Re: Quiz Overview Module - delete attempts + augmented display

Thomas Robb -
Hmm, okay. I'll hold off in submitting this until I'll got that done. It isn't that simple though, because if you have check boxes, and a "select all" then you need a "deselect all" button as well, but it's quite doable. I'll give it a think.

Just don't ask for a button that reverses the currently checked selections! 微笑
回复Thomas Robb

Re: Quiz Overview Module - delete attempts + augmented display

Martin Dougiamas -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像
"select all" is definitely a nicety so you can leave that, but even just being able to select a few manually would be a huge improvement!  微笑
回复Thomas Robb

Re: Quiz Overview Module - delete attempts + augmented display

koen roggemans -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Translators的头像

Sorry for that, now you mention the reverse-function... grijns

For the select all-button you can look at the quiz-code: there is a select-all function with checkboxes (selecting the questions to add to the quiz)

回复Martin Dougiamas

Re: Quiz Overview Module - delete attempts + augmented display

Thomas Robb -
Here is the revised version.  There is no "Select All" button.  Rather there is a button that says "Delete All", one that says "Delete" which acts along with whatever has been checked, and a "Clear All" button that removes all check marks.  This way no javascript was required to iterate through the form checkbox objects.

The text for the three buttons is currently "hard-wired" but I'll fix that later -- unless Martin would like to do it...

I'm not too happy with the way the buttons are positioned under the table.  I've just used the standard <center> tag to do it.  Please feel free to improve/suggest improvements for this or any other part of the code.
回复Thomas Robb

Re: Quiz Overview Module - delete attempts + augmented display

Ger Tielemans -

Wait for me, I was only one day away!

(Very very last thing: heads of the banished people stay visible in the list, my head too clown )

(I am not shure if that is real or artefact:I will do a clean tryout-test tomorrow with a group of teachers.)

回复Ger Tielemans

Re: Quiz Overview Module - delete attempts + augmented display

Thomas Robb -
If everything is deleted, there is a "ghost" of one smiley and a score of 0, but in fact, everything has been deleted. I'm having difficulty doing more, for example, displaying a simple message that says "This quiz has no attempts".

If you pull up the screen again, you will also get an error message saying "Error occurred during pre-processing!". I think I'll have to rely on Martin to get this part of the code right. He understands what is going on better than I do (of course....).
回复Przemyslaw Stencel

Re: Button for remove of test trials from teacher(s)?

koen roggemans -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Translators的头像
This is may be also a possibility with the advantage of being better readable with a long list of students with lots of attempts. (eg 50 studenst with 5 attempts give 250 lines if you put one attempt/line)
回复koen roggemans

Re: Button for remove of test trials from teacher(s)?

Martin Dougiamas -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像
I liked this too, Koen - let's see how the other one goes first ... perhaps we can add a switch, or use it for long classes.  Perhaps paging on the long report would make sense too.
回复Ger Tielemans

Quiz Overview Module - delete attempts v. 1.3

Thomas Robb -
The indentation of this forum is going WAY to far to the right, so I'll start again by replying to Ger's first message.

Here is perhaps my final version of this module. The display now elegantly says "No attempts have been made on this quiz" once the final attempt has been deleted.
回复Thomas Robb

Re: Quiz Overview Module - delete attempts v. 1.3

Martin Dougiamas -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像
Thanks, Thomas.  大笑

I've checked this functionality into CVS.  During my review I actually made a lot of changes to the code but it's a lot easier starting with a working product so thank you.
回复Thomas Robb

Re: Quiz Overview Module - delete attempts v. 1.3

Ger Tielemans -

In line 101 of report.php it shows $clearalll  instead of $clearall...

(Button label does not show)

Small suggestion for button names:

- delete selection

- clear selection

- delete all

回复Ger Tielemans

Re: Quiz Overview Module - delete attempts v. 1.3

Thomas Robb -
Martin now has control of this module, not me. It seems that he has already implemented Ger's wording for "delete selection" and "delete all" but, at least on this Moodle in the sandbox area, a "Reset" or "Clear selection" button still doesn't appear.
回复Thomas Robb

Re: Quiz Overview Module - delete attempts v. 1.3

Martin Dougiamas -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像
Yes, I took the reset button out, since it's an optional form in the first place and just added clutter (to my eye).  If anyone really really wants it I'll put it back.  微笑
回复Martin Dougiamas

Re: Quiz Overview Module - delete attempts v. 1.3

Ger Tielemans -

Not for me, I will use the refresh button but I was wondering about our 700 normal schoolteachers starting using computers with Moodle on it for the first time in their life: 

"Hey this machine goes black and I did not even touch it." wink

回复Ger Tielemans

Re: Quiz Overview Module - delete attempts v. 1.3

Ger Tielemans -

A little story:

In1982 there was one school in the Netherlands far ahead of the rest: Odulphus college in Tilburg. On personal computers (Commodore PET?) students did tests and at the end the results came out the printer on chainpaper. As a kind of service one page was filled with statistical items like average, standard deviation etc..

Asking teachers how they liked that they all said: GREAT!!

... until one teacher added: "Yes, we like it because that is the only place where we can tear off the paper without losing the answers of our students."
                                 (citation: Jan Schoenmaker, a Dutch educational computer pioneer.)


Looking in this spirit to quiz-results I am a happy man:

  • In a glance a teacher can see in simple statistics: are my questions (to) difficult?
  • In detailted statistics I jump to the yellow pastille and see: are my questions good?

I only miss now the third one: multipercentages, where I can see in a glance:
are my m.c.-alternatives good?

In my Dutch translation I call the headers this way, so...

Please, can I have this yellow one back?

回复Ger Tielemans

Re: Quiz Overview Module - delete attempts v. 1.3

Thomas Robb -
To find out if your m/c choices are any good, you only need to scan the second table in the Detailed Statistics plug-in. This reports how many students selected each of the M/C choices. If there are any choices that only a few people selected, you should consider ways to make it more "attractive" as a distractor.

It would be a simple matter to modify (improve?) the script so that any M/C choice with fewer than 10% -15% selecting it would appear with a yellow background. Is this what you want?
回复Thomas Robb

Re: Quiz Overview Module - delete attempts v. 1.3

Ger Tielemans -

Yes you are right it is there, I missed it, attracked as I was by that discrim.index.
(without reading it, I thought that it was some Japanese calculation explanation of the discrim. index blush)

I would prefer % in the M/C rows above the discrim. index, not the counting numbers

Also in the line just above discrim. index, the label says it gives percent correct, but it shows up as a fraction with a percent-sign. 0.4% instead of 40%

回复Ger Tielemans

Detailed Stats and percentages

Thomas Robb -
Some how this has gotten into the wrong thread since it is about "Detailed Statistics" (fullstat) rather than the Overview module, but anyhow...

I have fixed the problem with the maths on the "Percent Correct" line but haven't committed it yet because I just got a new computer and CVS didn't come pre-installed. Hopefully, I can do this tomorrow.

The reason for the error was due to the changes made to the Excel output recently. They both draw on the same data, but Excel needs the numbers already pre-divided by 100.

I agree that percentages would be better, but to implement percentages in the M/C rows will not be so easy because the data is stored as a string with the response and the number together. Obviously this is/was poor programming style since I would now have to parse the string to get the number in order to calculate the percentage.

I think i'd better "go back to the drawing board" on this lest the code get too complex and difficult for future programmers to figure out or modify, so please be patient. I'll get to it eventually!
回复Thomas Robb

Re: Detailed Stats and percentages

Ger Tielemans -
Now we have the delete button it would be nice to see the teacher trials in the simple statistics. (We can kill them before we do a difficulty analysis.)