Is there any way that the scale on the type of question 1 to N, is changed by 0 to N?
Best Regards.
Hi Joseph.
What I need is change like that:
Thanks in advance.
I have the same problem as in the survey module.
The scale moves from 1 to 11 instead of 0 to 10.
In the survey module to download this occurred in xls or ods format results (See Fig 2 and Fig 3); in this module is moved after answering questionnaire as shown in the image below (see Fig 1).
Can you help me? Thank you very much.
Fig 1 - Questionnaire Module
Fig 2 Survey Module
Fig 3 Survey Module
Teachers should be evaluated by students anonymously on a scale of 0 to 10. A quality audit required it. I wish someone could help me.
Thank you in advance.
Often inspectors evaluate little knowledge of the area, and not leave their standards: "from 0 to 10", that says their rules.
Just need to subtract one to all values in the downloadable xls (now we do the survey module and manually subtract). How could this "transformation" from the template / code? Thanks.
Hi Itamar
I believe that at the end of the source code of the attachment (download.php) where the lines are printed in the xls data.
Could you help me to subtract 1 from all these values? Thank you very much.
// Print all the lines of data.
foreach ($results as $user => $rest) {
if (! $u = get_record("user", "id", $user)) {
error("Error finding student # $user");
}
echo $survey->id."\t";
echo strip_tags(format_string($survey->name,true))."\t";
echo $user."\t";
echo $u->firstname."\t";
echo $u->lastname."\t";
echo $u->email."\t";
echo $u->idnumber."\t";
echo userdate($results["$user"]["time"], "%d-%b-%Y %I:%M:%S %p")."\t";
foreach ($order as $key => $qid) {
$question = $questions["$qid"];
if ($question->type == "0" || $question->type == "1" || $question->type == "3" || $question->type == "-1") {
echo $results["$user"]["$qid"]["answer1"]." ";
}
if ($question->type == "2" || $question->type == "3") {
echo $results["$user"]["$qid"]["answer2"]." ";
}
}
echo "\n";
}
exit;
Sorry, José, but the download.php file you attached belongs to the survey module, not the questionnaire module.
If it's OK for you to hack your Questionnaire files, here is how you can get the ratings to start at zero. In file questionnaire/locallib.php, version $Id: locallib.php,v 1.49.2.66 2009/12/26 10:29:30 joseph_rezeau Exp $
line 1371
change
if (is_numeric($q4)) {Joseph, thank you for your invaluable help.
The downloadable ods now has the scale as we have demanded them (Fig. 2).
Could it happen the same way in the results column of the questionnaire (Fig 1)?.
Thanks for everything.
Fig.2: downloadable ods
Hello José,
1- In my previous message, the hack should really be (just comment out that line):
In file questionnaire/locallib.php, version $Id: locallib.php,v 1.49.2.66 2009/12/26 10:29:30 joseph_rezeau Exp $
line 1371
change
if (is_numeric($q4)) {In file questionnaire/questiontypes/questiontypes.class.php
$Id: questiontypes.class.php,v 1.31.2.44 2009/12/26 10:29:29 joseph_rezeau Exp $
line 542 change
$sql = 'SELECT C.content, AVG(A.rank+1) AS average '.
to
$sql = 'SELECT C.content, AVG(A.rank) AS average '.
lines 1920-1924 change
if (($j = $avg * $width) > 0) {
$interval = 50 / $length;
$out .= sprintf('<img alt="" src="'.$image_url.$currhbar.
'rhbar.gif" height="0" width="%d%%" style="visibility:hidden" />', $j - $interval - 0.3);
}
to
if (($j = $avg * $width) >= 0) {
$interval = 50 / $
$out .= sprintf('<img alt="" src="'.$image_url.$currhbar.
'rhbar.gif" height="0" width="%d%%" style="visibility:hidden" />', $j + $interval - 0.3);
}
Example
question's possible answers:
objetivos=1. Existe correspondencia entre objetivos y contenidos de la accion formativa
documentacion=2. La documentacion y materiales ... son comprensibles y adecuados.
medios=3. Los medios y soportes digitales son adecuados.
1=0
2=1
3=2
4=3
5=4
6=5
7=6
8=7
9=8
10=9
11=10
See attached Result display (for one response only) and export to Excel
Please test my hacks carefully on a test installation before going live! I will try to find a better solution and commit it as an option for 0 -> n / 1 -> n ratings in the Rate question Edit screen.
Joseph
Joseph, after hacking as indicating to me everything seems ok: the results column shows the value of the marked response, and downloadable ods respects. You've helped me to change the scale 1 .. N to 0 .. N
Thank you very much for everything. Best Regards.