Donovan
Client

Joined: Oct 07, 2003
Posts: 735
Location: Ohio
|
Posted:
Mon Oct 13, 2008 11:49 am |
|
What I have is a medical student peer evaluation form for team based learning that each team mate fills out on each other.
They are asked a series of questions to "rate" their team mates on.
Never - Sometimes - Often - Always
The first series are Cooperative Learning Skills.
Arrives on time and remains with team during activites.
Demonstrates a good balance of active listening and participation.
Asks useful or probing questions.
Shares information and personal understanding.
Each team mate will fill out the form and select a value by choosing one of the radio buttons for Never - Sometimes - Often - Always.
So 3 series with 4 questions each for 12 overall.
What I need is a way to display the results of this evaluation to each student. I wanted something like this which is hard coded as an example. I'm using an image such as "<img src='modules/$module_name/images/3stars.gif'>";
to represent how many scores for that question.
Here is what the table looks like hard coded..
Code:
OpenTable();
echo "<table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n";
echo "<tr><td colspan='5' width='100%' align='center'>Term $Term</td></tr>\n";
echo"<tr><td align=\"center\"><b>Cooperative Learning Skills</b></td><td align=\"center\"><b>Never</b></td><td align=\"center\"><b>Sometimes</b></td><td align=\"center\"><b>Often</b></td><td align=\"center\"><b>Always</b></td></tr>"
."<tr><td width = '50%'>Arrives on time and remains with team during activites.</td><td align=\"center\">$nostar</td><td align=\"center\">$nostar</td><td align=\"center\">$onestar</td><td align=\"center\">$fourstars</td></tr>"
."<tr><td width = '50%'>Demonstrates a good balance of active listening and participation.</td><td align=\"center\">$nostar</td><td align=\"center\">$nostar</td><td align=\"center\">$twostars</td><td align=\"center\">$threestars</td></tr>"
."<tr><td width = '50%'>Asks useful or probing questions.</td><td align=\"center\">$nostar</td><td align=\"center\">$nostar</td><td align=\"center\">$twostars</td><td align=\"center\">$threestars</td></tr>"
."<tr><td width = '50%'>Shares information and personal understanding.</td><td align=\"center\">$nostar</td><td align=\"center\">$nostar</td><td align=\"center\">$onestar</td><td align=\"center\">$fourstars</td></tr>";
echo"</table>";
echo"<table width=\"100%\" border=\"1\" cellpadding=\"2\">"
." <tr><td align=\"center\"><b>Self-Directed Learning</b></td><td align=\"center\"><b>Never</b></td><td align=\"center\"><b>Sometimes</b></td><td align=\"center\"><b>Often</b></td><td align=\"center\"><b>Always</b></td></tr>"
."<tr><td width = '50%'>Is well prepared for team activities.</td><td align=\"center\">$nostar</td><td align=\"center\">$nostar</td><td align=\"center\">$onestar</td><td align=\"center\">$fourstars</td></tr>"
."<tr><td width = '50%'>Shows appropriate depth of knowledge.</td><td align=\"center\">$nostar</td><td align=\"center\">$nostar</td><td align=\"center\">$onestar</td><td align=\"center\">$fourstars</td></tr>"
."<tr><td width = '50%'>Identifies limits of personal knowledge.</td><td align=\"center\">$nostar</td><td align=\"center\">$nostar</td><td align=\"center\">$onestar</td><td align=\"center\">$fourstars</td></tr>"
."<tr><td width = '50%'>Is clear when explaining things to others.</td><td align=\"center\">$nostar</td><td align=\"center\">$nostar</td><td align=\"center\">$nostar</td><td align=\"center\">$fivestars</td></tr>";
echo"</table>";
echo"<table width=\"100%\" border=\"1\" cellspacing='0' cellpadding=\"2\">"
." <tr><td align=\"center\"><b>Interpersonal Skills</b></td><td align=\"center\"><b>Never</b></td><td align=\"center\"><b>Sometimes</b></td><td align=\"center\"><b>Often</b></td><td align=\"center\"><b>Always</b></td></tr>"
."<tr><td width = '50%'>Gives useful feedback to others.</td><td align=\"center\">$nostar</td><td align=\"center\">$nostar</td><td align=\"center\">$nostar</td><td align=\"center\">$fivestars</td></tr>"
."<tr><td width = '50%'>Accepts useful feedback from others.</td><td align=\"center\">$nostar</td><td align=\"center\">$nostar</td><td align=\"center\">$nostar</td><td align=\"center\">$fivestars</td></tr>"
."<tr><td width = '50%'>Is able to listen and understand what others are saying.</td><td align=\"center\">$nostar</td><td align=\"center\">$nostar</td><td align=\"center\">$onestar</td><td align=\"center\">$fourstars</td></tr>"
."<tr><td width = '50%'>Shows respect to the opinion and feelings of others.</td><td align=\"center\">$nostar</td><td align=\"center\">$nostar</td><td align=\"center\">$nostar</td><td align=\"center\">$fivestars</td></tr>";
echo"</table>";
CloseTable();
|
My table looks like this:
Code:
`UID` varchar(9) NOT NULL,
`clskill_1` set('0','1','2','3') NOT NULL,
`clskill_2` set('0','1','2','3') NOT NULL,
`clskill_3` set('0','1','2','3') NOT NULL,
`clskill_4` set('0','1','2','3') NOT NULL,
`sdskill_1` set('0','1','2','3') NOT NULL,
`sdskill_2` set('0','1','2','3') NOT NULL,
`sdskill_3` set('0','1','2','3') NOT NULL,
`sdskill_4` set('0','1','2','3') NOT NULL,
`ipskill_1` set('0','1','2','3') NOT NULL,
`ipskill_2` set('0','1','2','3') NOT NULL,
`ipskill_3` set('0','1','2','3') NOT NULL,
`ipskill_4` set('0','1','2','3') NOT NULL,
`qa_1_text` text NOT NULL,
`qa_2_text` text NOT NULL,
`rater` varchar(10) NOT NULL,
`qa_1_rating` tinyint(1) unsigned NOT NULL,
`qa_2_rating` tinyint(1) unsigned NOT NULL,
`datesubmit` date NOT NULL,
`Academic_Year` varchar(5) NOT NULL
|
and a dump of the data looks like this..
Code:
INSERT INTO `atlas_tl_M2peereval` (`UID`, `clskill_1`, `clskill_2`, `clskill_3`, `clskill_4`, `sdskill_1`, `sdskill_2`, `sdskill_3`, `sdskill_4`, `ipskill_1`, `ipskill_2`, `ipskill_3`, `ipskill_4`, `qa_1_text`, `qa_2_text`, `rater`, `qa_1_rating`, `qa_2_rating`, `datesubmit`, `Academic_Year`) VALUES
('U00583382', '0', '0', '0', '0', '1', '1', '1', '1', '0', '0', '0', '0', 'Shows respect to the opinion and feelings of others.', 'Gives useful feedback to others.', 'w002sfd', 0, 0, '2008-10-10', '0809'),
('U00583382', '0', '0', '0', '0', '2', '0', '0', '0', '0', '0', '1', '0', 'Shows appropriate depth of knowledge. Shows appropriate depth of knowledge. Shows appropriate depth of knowledge.', 'Demonstrates a good balance of active listening and participation. Demonstrates a good balance of active listening and participation. Demonstrates a good balance of active listening and participation.', 'w01asd', 0, 0, '2008-10-10', '0809'),
('U00583382', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '1', 'Shows respect to the opinion and feelings of others. Shows respect to the opinion and feelings of others.', 'Is able to listen and understand what others are saying. Is able to listen and understand what others are saying.Is able to listen and understand what others are saying.', 'w002dfg', 0, 0, '2008-10-10', '0809'),
('U00583382', '0', '0', '0', '0', '0', '0', '1', '2', '0', '0', '1', '0', 'blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah ', 'blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah ', 'w003ttt', 0, 0, '2008-10-12', '0809'),
('U00583382', '1', '1', '0', '0', '1', '0', '0', '0', '0', '1', '0', '0', 'test test test test test test test test test test test test test test test test test test test test test test test test test test ', 'test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test ', 'w003uuu', 0, 0, '2008-10-13', '0809');
|
How do I count the values in each field to determine how many stars should display in the result?
How do I set up the loop to break on each of the skills?
Cooperative Learning Skills
Self-Directed Learning
Interpersonal Skills
Off the top of my head, but I'm not 100% on this.
Code:
//All the radio buttons
$skills = array("clskill_1", "clskill_2", "clskill_3", "clskill_4", "sdskill_1", "sdskill_2", "sdskill_3", "sdskill_4", "ipskill_1", "ipskill_2", "ipskill_3", "ipskill_4");
for($i=0;$i<count($skills);$i++) {
// values for Always, Often, Sometimes and Never.
$scores = array("0", "1", "2", "3");
foreach($scores as $value) {
$getstarcount = $db->sql_query("SELECT COUNT($skills[i]) AS starcount FROM ".$prefix."_tl_M2peereval
WHERE UID ='$UID'
AND scores[] = $value
AND Academic_Year = '$Academic_Year'
GROUP BY UID");
}
}
|
If I could just get the counts working for each question then I could try and display the table.
One loop for each input (radio button) and another for each value (0,1,2,3) Sum all these values per input and assign it a graphical representation to display:
Code:
$nostar = "<img src='modules/$module_name/images/pixel.gif'>";
$onestar = "<img src='modules/$module_name/images/1star.gif'>";
$twostars = "<img src='modules/$module_name/images/2stars.gif'>";
$threestars = "<img src='modules/$module_name/images/3stars.gif'>";
$fourstars = "<img src='modules/$module_name/images/4stars.gif'>";
$fivestars = "<img src='modules/$module_name/images/5stars.gif'>";
$sixstars = "<img src='modules/$module_name/images/6stars.gif'>";
|
|
|
|