Here in France, a test can be a multichoice with differents points values for each question. Often, most difficult questions may give you 3 points if you know the correct answer :) Those kind of multichoices -where all questions are not equal value- are use in some "entrance exams" (high schools and very elective-n-selective exams like first-year-medecine-test)
Because of that, some engineer schools use "negative notation", i.e. false/incorrect choices retains points. The message is clear and well understand : if you don't know, you'd better not answer 'cause a poker can cost.. :)
Note that correct answer is always a positive integer, and incorrect answer is either zero (usual case) or negative...
Now guess what ? :) I think this module should implement that kind of functionality :)
For that, the DB need a little modification : quiz_question_answer.points don't have to be UNSIGNED, and should be TINYINT (same as TINYINT(4), better than TINYINT(3)..) After, multichoice.module need some rewrites.. I've started some job in that direction (see patch). but i have to track another error before (see issue here )
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | points_system_4_7.patch | 21.79 KB | gilcot |
| #9 | points_system_releasable.patch | 43.61 KB | gilcot |
| #8 | multichoice.patch_2.txt | 22.22 KB | gilcot |
| #7 | multichoice.patch | 21.79 KB | gilcot |
| #6 | multichoice.patch_1.txt | 21.42 KB | gilcot |
Comments
Comment #1
gilcot commenteda proper patch. tested and seems ok, exept that a little work need to be done on final score computation.
Comment #2
seanbfuller commentedHey gilcot. Sounds interesting. A few other minor issues I noticed while in there:
Looks like there are a few lines that deal with passing node by reference. Since that is already an open issue, it might make sense to do that as a different patch simply for legibility of this one.
The "##"'s are comments, right? You probably want to use "//" as this is the drupal coding standard. It also looks like there are a few places where the return statement is preceeded by ##, meaning this is probably non-working code?
This is a very minor point, but drupal coding standard for control structures is
Looks like you had just grabbed the if (count($tried) > 0) return 1; it from existing code, but I thought I'd point it out. :)
I'll try and apply it to see how it actually works when I get a chance.
Comment #3
gilcot commentedSorry about the passing node by reference.. i build the patch from my working draft and forget i was dealing with that :/
Yes, "##" are comments :) It's a diff-like trick i use with may students :
in fact, it was a draft whose purpose was to illustrate my writing/words (only the user interface was done). but now, the job is completely done (i hope) and here is a new patch (but comments in first column starting with "///" are for review help, not to be included in the final code). the score computing is now functional and is based on Sean's new code. but what does this patch break ? what is stored in result field has slightly changed..
comments and suggestions : welcome
Comment #4
gilcot commenteda minor error in the previous diff. sorry
Comment #5
seanbfuller commentedHey gilcot,
I was thinking about this, and started wondering if there was a way to make this an optional feature. In a perfect world, it would be great if you could have some quizzes that used the kind of weighted answer system like you've described and others that use a more basic correct or incorrect answers system. This introduces a sort of "scoring" option at the quiz level, meaning you could mix the two types on a site. This also helps keep the interface simple, and allows it to be more complex for users who want more options. I guess I'm just worried that locking us in on this scoring system will turn some people off. What do you think?
Comment #6
gilcot commentedI was asking myself how to design the interface in order to have both..
one of my attempt was having both a drop-menu (like my suggest) and a check box... when the box is checked the score is set to the same value as in the menu (if positive of course) or 1 (previous/default behavior). the test around me was succesfull (it means the trick is intuitive for my beta-tester), but the interface became havy and a bit ugly imho.
Sean, you are right: it will be fine if it can be decided at a quiz level ! but, my second try was to have a global (site wide then) configuration (see attachment). i'll work on your idea starting from tomorrow. thanks for the hint.
Comment #7
gilcot commentedthere was a little error in the previous file (it's because of a last minute change).
ok Sean & al, my scoring system is configuration dependant now and disabled by default.. :)
Comment #8
gilcot commentednotice some missing check_plain() :[
correct some typos
Comment #9
gilcot commentedas code is being released (http://drupal.org/node/93855) i asked my colleugua help me doing some tests, and it's ok. there are some changes within
quiz.modulei didn't post: corrected now.Please Sean, let me know about
calculate_result: must it be kept ascalculate_resultsdo the same job and more?Last thing: can someone correct/rephrase my texts?
Comment #10
kthagen commentedI'm just starting to take a look at the quiz module, and it looks very promising. I have one thought about this patch related to the overall architecture:
The current scoring system for multiple-choice questions amounts to what psychometricians call a "dichotomously scored item"--in other words, you get a 1 for the correct answer, and a 0 for an incorrect answer.
Choices with different weights to the various answers are known as "polytomous". A different set of statistical methods have to be used when working with such questions.
My suggestion would be to keep these as two separate question types. In other words, leave the current multichoice module as it is, and have a second question type for polytomous items. That will obviate the problem of defaults and optional overrides, and should someone choose to write statistical modules down the line, it will be easier to keep these two kinds of questions distinct.
Comment #11
gilcot commentedhi kthagen.
It's a nice idea to have 2 distinct modules. but, as only lines related to the interface are changed (result calculation too, but the same code can be used for both), we'll have to maintain two duplicated code lines :(
Comment #12
kthagen commentedThe multiple-code-base thing had occurred to me. But here's my situation:
I'm in the midst of debugging an extended version of the multichoice module. I actually have three varieties of questions (kept in a property I'm calling 'scoring_type'):
It's no real problem unifying all three for scoring, but getting an interface that works well for all three is giving me headaches.
Ideally, we would format the field for quiz_question_answer.points as a checkbox for dichotomous questions, a textfield for polytonomous questions, and hide it for unscored questions.
But because I need to mix these question types within a single test, I can't set a default value ahead of time. That means that when the form is rendered, we don't yet know the value of scoring_type. So I'm forced to use textfield for all three types, which is a poor interface design, since it lets the user enter junk data.
This seems a situation for which polymorphism was meant, and I would know exactly how to deal with this in C++ or Java. If there's an elegant solution for Drupal, I'd love to know about it.
Comment #13
kthagen commentedIgnore my previous grousing. I just discovered the lovely tutorial on multipage forms, which should solve my problem nicely, and I'm back on track.
Comment #14
gilcot commentedi'm using a property called
extend_scoringwich acts like a boolean. of course, you are right, that name should be changed to something likescoring_typeif we have to manage more than two scoring types :)unscored can be done by removing correct answer check... but then, how will the node displaying look like ? radios or checkboxes ?
the questions score count is done by
quiz.moduleand shouldn't be changed because it's a quizzes module :) but Sean plan something in that direction for the next release (exept if the project is kept under developpement still for a while) : the ability to show or not the feedbacks and/or the score for each question. also remember that you may not use the fail/pass for each set of questions ; it may be usefull in your case...:) i let checkboxes for dichotomous questions, and i used options-list instead of textfield for polytonomous questions for simplicity and consistancy... and i agree for hidding that field/column for unscored questions.
Comment #15
gilcot commentedoops. misformating: i forget the slash in my closing tag; that's why my repy is show like a quoting inside another quote... sorry.
Comment #16
kthagen commentedThe radio vs. checkbox doesn't depend on the question subtype but on whether or not multiple answers are allowed, so formatting that remains the same.
Using a select box for polytonomous scoring is convenient, but that does limit you to a small range of scores, whereas in real polytonomous items, the scores are often non-integer amounts. So I've gone with a textfield (and changed the type of the underlying table column).
As for multiform formatting, I spent a day trying to get it to work, banging my head repeatedly against my keyboard. There were so many problems that I eventually gave up and reverted to the preview method that you suggest. I understand that this will be much easier to do with the 2.0 API, but it wasn't worth my time for the moment.
You're right, of course about the quiz module doing the counting, and in general, that's the right place to put it, but the current code is a little too tightly bound to multiple-choice questions. All that is necessary is for each question to score itself and to report two values: actual score, and maximum score. (I believe your patch already does this). Then, the quiz module simply sums actual score vs. max score (rather than vs. number of questions). Unscored questions simply report 0 for both fields, and hence don't disturb anything when doing the overall results. This scheme also makes partial-credit scoring easy.
Comment #17
gilcot commentedstill testing. patch comming soon :)
Comment #18
mcarbone commentedI tried running the latest patch from the November 15 comment on the latest quiz.module release from 11/29 and it failed. gilcot, do you have a patch that works with the latest release? I'd like to test out this functionality.
Comment #19
jgodfrey commentedI am interested in the status of this patch. It looks very useful and like something that I could use. Please advise regarding the status of this. Thank you in advance and have a great day!!!
Comment #20
add1sun commentedwell, at this point we are trying to get a 5.x-1.0 release of quiz out that is hopefully, basically bug-free. :) once we get that sorted out we will start looking at getting the new features in. so, basically, it's probably not going to happen right now but will probably be on radar in the coming months.
Comment #21
gilcot commentedHey jgodfrey & add1sun.
The patch is for an old CVS revision... As it has been written for drupal-4.7.x i'm not sure it can work with drupal-5.x (i repost a patch for 4.7 serie)
I did not yet upgrade to drupal-5. so i cannot test this feature (but can write the code) for 5.x-1.0 release. In another hand, it will be for a next release (5.x-2.0 ?)
Comment #22
falcon commentedThere is a brand new scoring system in Quiz 4. I think it handles most of this. I have to admit that I haven't read through this entire issue though... (I'm cleaning up the issue list)