$fstring->of = get_string('of', 'feedback');
$fstring->modulenameplural = get_string('modulenameplural', 'feedback');
$fstring->questions = get_string('questions', 'feedback');
+ $fstring->itemlabel = get_string('item_label', 'feedback');
$fstring->question = get_string('question', 'feedback');
$fstring->responses = get_string('responses', 'feedback');
$fstring->idnumber = get_string('idnumber');
$worksheet1->hideGridlines();
$worksheet1->setHeader("&\"Arial," . $fstring->bold . "\"&14".$feedback->name);
$worksheet1->setFooter($fstring->page." &P " . $fstring->of . " &N");
- $worksheet1->setColumn(0, 0, 30);
- $worksheet1->setColumn(1, 20, 15);
+ $worksheet1->setColumn(0, 0, 10);
+ $worksheet1->setColumn(1, 1, 30);
+ $worksheet1->setColumn(2, 20, 15);
$worksheet1->setMargins_LR(0.10);
$worksheet2->setLandscape();
}
$rowOffset1 += 2;
- $worksheet1->write_string($rowOffset1, 0, $fstring->question);
- $worksheet1->write_string($rowOffset1, 1, $fstring->responses);
+ $worksheet1->write_string($rowOffset1, 0, $fstring->itemlabel);
+ $worksheet1->write_string($rowOffset1, 1, $fstring->question);
+ $worksheet1->write_string($rowOffset1, 2, $fstring->responses);
$rowOffset1++ ;
if (empty($items)) {
$worksheet->setFormat('<l><f><ru2>');
- $worksheet->write_string($rowOffset, $colOffset, $fstring->idnumber);
+ $worksheet->write_string($rowOffset + 1, $colOffset, $fstring->idnumber);
$colOffset++;
- $worksheet->write_string($rowOffset, $colOffset, $fstring->username);
+ $worksheet->write_string($rowOffset + 1, $colOffset, $fstring->username);
$colOffset++;
- $worksheet->write_string($rowOffset, $colOffset, $fstring->fullname);
+ $worksheet->write_string($rowOffset + 1, $colOffset, $fstring->fullname);
$colOffset++;
foreach($items as $item) {
$worksheet->setFormat('<l><f><ru2>');
$worksheet->write_string($rowOffset, $colOffset, $item->name);
+ $worksheet->write_string($rowOffset + 1, $colOffset, $item->label);
$colOffset++;
}
$worksheet->setFormat('<l><f><ru2>');
- $worksheet->write_string($rowOffset, $colOffset, $fstring->courseid);
+ $worksheet->write_string($rowOffset + 1, $colOffset, $fstring->courseid);
$colOffset++;
$worksheet->setFormat('<l><f><ru2>');
- $worksheet->write_string($rowOffset, $colOffset, $fstring->course);
+ $worksheet->write_string($rowOffset + 1, $colOffset, $fstring->course);
$colOffset++;
- return $rowOffset + 1;
+ return $rowOffset + 2;
}
function feedback_excelprint_detailed_items(&$worksheet, $completed, $items, $rowOffset) {
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="feedback"/>
<FIELD NAME="feedback" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="template"/>
<FIELD NAME="template" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="feedback" NEXT="name"/>
- <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="template" NEXT="presentation"/>
- <FIELD NAME="presentation" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="typ"/>
+ <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="template" NEXT="label"/>
+ <FIELD NAME="label" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="presentation"/>
+ <FIELD NAME="presentation" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="label" NEXT="typ"/>
<FIELD NAME="typ" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="presentation" NEXT="hasvalue"/>
<FIELD NAME="hasvalue" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="typ" NEXT="position"/>
<FIELD NAME="position" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="hasvalue" NEXT="required"/>
if ($result && $oldversion < 2008073002) {
$update_sql = "UPDATE {feedback_item} SET presentation = '-|-' WHERE presentation = '0|0' AND typ = 'numeric'";
$result = $result && $DB->execute($update_sql);
+
+ upgrade_mod_savepoint($result, 2008073002, 'feedback');
+ }
+
+ if ($result && $oldversion < 2009031301) {
+ /// Define field label to be added to feedback_item
+ $table = new xmldb_table('feedback_item');
+ $field = new xmldb_field('label', XMLDB_TYPE_CHAR, '255', null, null, false, null, null, '', 'name');
+ /// Launch add field2
+ $dbman->add_field($table, $field);
+
+ upgrade_mod_savepoint($result, 2009031301, 'feedback');
}
return $result;
$moveitem = optional_param('moveitem', false, PARAM_INT);
$movehere = optional_param('movehere', false, PARAM_INT);
$switchitemrequired = optional_param('switchitemrequired', false, PARAM_INT);
+
+ $ME = strip_querystring($FULLME);//sometimes it is not correct set
// $SESSION->feedback->current_tab = $do_show;
$current_tab = $do_show;
if($movehere && isset($SESSION->feedback->moving->movingitem)){
$item = $DB->get_record('feedback_item', array('id'=>$SESSION->feedback->moving->movingitem));
feedback_move_item($item, intval($movehere));
+ $moveitem = false;
}
if($moveitem){
$item = $DB->get_record('feedback_item', array('id'=>$moveitem));
var $type = "captcha";
var $requiredcheck;
var $itemname;
+ var $itemlabel;
var $select;
function definition() {
$this->requiredcheck = $mform->addElement('checkbox', 'required', get_string('required', 'feedback'));
$this->itemname = $mform->addElement('text', 'itemname', get_string('item_name', 'feedback'), array('size="'.FEEDBACK_ITEM_NAME_TEXTBOX_SIZE.'"','maxlength="255"'));
+ $this->itemlabel = $mform->addElement('text', 'itemlabel', get_string('item_label', 'feedback'), array('size="'.FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE.'"','maxlength="255"'));
$this->select = $mform->addElement('select',
'count_of_nums',
$item->presentation = empty($item->presentation) ? 3 : $item->presentation;
$item->name = empty($item->name) ? '' : $item->name;
+ $item->label = empty($item->label) ? '' : $item->label;
$item->required = isset($item->required) ? $item->required : 1;
if($item->required) {
}
$item_form->itemname->setValue($item->name);
+ $item_form->itemlabel->setValue($item->label);
$item_form->select->setValue($item->presentation);
return $item_form;
$requiredmark = ($item->required == 1)?'<span class="feedback_required_mark">*</span>':'';
?>
<td <?php echo $highlight;?> valign="top" align="<?php echo $align;?>">
- <?php echo format_text($item->name . $requiredmark, true, false, false);?>
+ <?php
+ if($edit OR $readonly) {
+ echo '('.$item->label.') ';
+ }
+ echo format_text($item->name . $requiredmark, true, false, false);
+ ?>
<img alt="<?php echo $this->type;?>" src="<?php echo $CFG->wwwroot.htmlspecialchars('/mod/feedback/item/captcha/print_captcha.php?id='.$cmid);?>" />
</td>
<td valign="top" align="<?php echo $align;?>">
if($readonly){
// print_simple_box_start($align);
print_box_start('generalbox boxalign'.$align);
- echo $value?$value:' ';
+ echo $value ? $value : ' ';
// print_simple_box_end();
print_box_end();
}else {
require_once $CFG->libdir.'/formslib.php';
define('FEEDBACK_ITEM_NAME_TEXTBOX_SIZE', 80);
+define('FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE', 20);
class feedback_item_form extends moodleform {
function get_item_form() {
var $type = "info";
var $requiredcheck;
var $itemname;
+ var $itemlabel;
var $infotype;
function definition() {
$this->requiredcheck = &$mform->addElement('hidden', 'required');
$this->itemname = &$mform->addElement('text', 'itemname', get_string('item_name', 'feedback'), array('size="'.FEEDBACK_ITEM_NAME_TEXTBOX_SIZE.'"','maxlength="255"'));
+ $this->itemlabel = $mform->addElement('text', 'itemlabel', get_string('item_label', 'feedback'), array('size="'.FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE.'"','maxlength="255"'));
$options=array();
$options[1] = get_string('responsetime', 'feedback');
$item->presentation = empty($item->presentation) ? '' : $item->presentation;
$item->name = empty($item->name) ? '' : htmlspecialchars($item->name);
+ $item->label = empty($item->label) ? '' : $item->label;
$item_form->requiredcheck->setValue(false);
$item_form->itemname->setValue($item->name);
+ $item_form->itemlabel->setValue($item->label);
$item_form->infotype->setValue($item->presentation);
$analysed_item = $this->get_analysed($item, $groupid, $courseid);
$data = $analysed_item->data;
if(is_array($data)) {
- echo '<tr><th colspan="2" align="left">'. $itemnr . ' ' . $item->name .'</th></tr>';
+ echo '<tr><th colspan="2" align="left">'. $itemnr . ' ('. $item->label .') ' . $item->name .'</th></tr>';
for($i = 0; $i < sizeof($data); $i++) {
echo '<tr><td colspan="2" valign="top" align="left">- ' . str_replace("\n", '<br />', $data[$i]->show) . '</td></tr>';
}
$analysed_item = $this->get_analysed($item, $groupid, $courseid);
$worksheet->setFormat("<l><f><ro2><vo><c:green>");
- $worksheet->write_string($rowOffset, 0, $item->name);
+ $worksheet->write_string($rowOffset, 0, $item->label);
+ $worksheet->write_string($rowOffset, 1, $item->name);
$data = $analysed_item->data;
if(is_array($data)) {
$worksheet->setFormat("<l><ro2><vo>");
- $worksheet->write_string($rowOffset, 1, $data[0]->show);
+ $worksheet->write_string($rowOffset, 2, $data[0]->show);
$rowOffset++;
for($i = 1; $i < sizeof($data); $i++) {
$worksheet->setFormat("<l><vo>");
- $worksheet->write_string($rowOffset, 1, $data[$i]->show);
+ $worksheet->write_string($rowOffset, 2, $data[$i]->show);
$rowOffset++;
}
}
}
$requiredmark = ($item->required == 1)?'<span class="feedback_required_mark">*</span>':'';
?>
- <td <?php echo $highlight;?> valign="top" align="<?php echo $align;?>"><?php echo format_text($item->name . $requiredmark, true, false, false);?></td>
+ <td <?php echo $highlight;?> valign="top" align="<?php echo $align;?>">
+ <?php
+ if($edit OR $readonly) {
+ echo '('.$item->label.') ';
+ }
+ echo format_text($item->name . $requiredmark, true, false, false);
+ ?>
+ </td>
<td valign="top" align="<?php echo $align;?>">
<?php
if($readonly){
$item->presentation = empty($item->presentation) ? '' : $item->presentation;
$item->name = empty($item->name) ? '' : $item->name;
+ $item->label = empty($item->label) ? '' : $item->label;
$info = $this->get_info($item);
}
$item_form->itemname->setValue($item->name);
+ $item_form->itemlabel->setValue($item->label);
$item_form->selectadjust->setValue($info->horizontal);
if($analysedItem) {
// $itemnr++;
$itemname = $analysedItem[1];
- echo '<tr><th colspan="2" align="left">'. $itemnr . ' ' . $itemname .'</th></tr>';
+ echo '<tr><th colspan="2" align="left">'. $itemnr . ' ('. $item->label .') ' . $itemname .'</th></tr>';
$analysedVals = $analysedItem[2];
$pixnr = 0;
foreach($analysedVals as $val) {
$worksheet->setFormat("<l><f><ro2><vo><c:green>");
//frage schreiben
- $worksheet->write_string($rowOffset, 0, $analysed_item[1]);
+ $worksheet->write_string($rowOffset, 0, $item->label);
+ $worksheet->write_string($rowOffset, 1, $analysed_item[1]);
if(is_array($data)) {
for($i = 0; $i < sizeof($data); $i++) {
$aData = $data[$i];
$worksheet->setFormat("<l><f><ro2><vo><c:blue>");
- $worksheet->write_string($rowOffset, $i + 1, trim($aData->answertext));
+ $worksheet->write_string($rowOffset, $i + 2, trim($aData->answertext));
$worksheet->setFormat("<l><vo>");
- $worksheet->write_number($rowOffset + 1, $i + 1, $aData->answercount);
+ $worksheet->write_number($rowOffset + 1, $i + 2, $aData->answercount);
$worksheet->setFormat("<l><f><vo><pr>");
- $worksheet->write_number($rowOffset + 2, $i + 1, $aData->quotient);
+ $worksheet->write_number($rowOffset + 2, $i + 2, $aData->quotient);
}
}
$rowOffset +=3 ;
}
$requiredmark = ($item->required == 1)?'<span class="feedback_required_mark">*</span>':'';
- echo '<td '.$highlight.' valign="top" align="'.$align.'">'.format_text($item->name.$requiredmark, true, false, false).'</td>';
+ echo '<td '.$highlight.' valign="top" align="'.$align.'">';
+ if($edit OR $readonly) {
+ echo '('.$item->label.') ';
+ }
+ echo format_text($item->name.$requiredmark, true, false, false).'</td>';
echo '<td valign="top" align="'.$align.'">';
}else {
if($highlightrequire AND $item->required AND intval($value) <= 0) {
}
$requiredmark = ($item->required == 1)?'<span class="feedback_required_mark">*</span>':'';
?>
- <td <?php echo $highlight;?> valign="top" align="<?php echo $align;?>"><?php echo format_text($item->name . $requiredmark, true, false, false);?></td>
+ <td <?php echo $highlight;?> valign="top" align="<?php echo $align;?>">
+ <?php
+ if($edit OR $readonly) {
+ echo '('.$item->label.') ';
+ }
+ echo format_text($item->name . $requiredmark, true, false, false);
+ ?>
+ </td>
<td valign="top" align="<?php echo $align;?>">
<?php
}
var $type = "multichoice";
var $requiredcheck;
var $itemname;
+ var $itemlabel;
var $selectadjust;
var $selecttype;
var $values;
$this->requiredcheck = $mform->addElement('checkbox', 'required', get_string('required', 'feedback'));
$this->itemname = $mform->addElement('text', 'itemname', get_string('item_name', 'feedback'), array('size="'.FEEDBACK_ITEM_NAME_TEXTBOX_SIZE.'"','maxlength="255"'));
+ $this->itemlabel = $mform->addElement('text', 'itemlabel', get_string('item_label', 'feedback'), array('size="'.FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE.'"','maxlength="255"'));
$this->selectadjust = $mform->addElement('select',
'horizontal',
$item->presentation = empty($item->presentation) ? '' : $item->presentation;
$item->name = empty($item->name) ? '' : $item->name;
+ $item->label = empty($item->label) ? '' : $item->label;
$info = $this->get_info($item);
}
$item_form->itemname->setValue($item->name);
+ $item_form->itemlabel->setValue($item->label);
$item_form->selectadjust->setValue($info->horizontal);
if($analysedItem) {
//echo '<table>';
// $itemnr++;
- echo '<tr><th colspan="2" align="left">'. $itemnr . ' ' . $analysedItem[1] .'</th></tr>';
+ echo '<tr><th colspan="2" align="left">'. $itemnr . ' ('. $item->label .') ' . $analysedItem[1] .'</th></tr>';
$analysedVals = $analysedItem[2];
$pixnr = 0;
$avg = 0.0;
$worksheet->setFormat("<l><f><ro2><vo><c:green>");
//frage schreiben
- $worksheet->write_string($rowOffset, 0, $analysed_item[1]);
+ $worksheet->write_string($rowOffset, 0, $item->label);
+ $worksheet->write_string($rowOffset, 1, $analysed_item[1]);
if(is_array($data)) {
$avg = 0.0;
for($i = 0; $i < sizeof($data); $i++) {
$aData = $data[$i];
$worksheet->setFormat("<l><f><ro2><vo><c:blue>");
- $worksheet->write_string($rowOffset, $i + 1, trim($aData->answertext).' ('.$aData->value.')');
+ $worksheet->write_string($rowOffset, $i + 2, trim($aData->answertext).' ('.$aData->value.')');
$worksheet->setFormat("<l><vo>");
- $worksheet->write_number($rowOffset + 1, $i + 1, $aData->answercount);
+ $worksheet->write_number($rowOffset + 1, $i + 2, $aData->answercount);
//$worksheet->setFormat("<l><f><vo>");
//$worksheet->write_number($rowOffset + 2, $i + 1, $aData->avg);
$avg += $aData->avg;
}
//mittelwert anzeigen
$worksheet->setFormat("<l><f><ro2><vo><c:red>");
- $worksheet->write_string($rowOffset, sizeof($data) + 1, get_string('average', 'feedback'));
+ $worksheet->write_string($rowOffset, sizeof($data) + 2, get_string('average', 'feedback'));
$worksheet->setFormat("<l><f><vo>");
- $worksheet->write_number($rowOffset + 1, sizeof($data) + 1, $avg);
+ $worksheet->write_number($rowOffset + 1, sizeof($data) + 2, $avg);
}
$rowOffset +=2 ;
return $rowOffset;
$highlight = '';
}
?>
- <td <?php echo $highlight;?> valign="top" align="<?php echo $align;?>"><?php echo format_text($item->name . $requiredmark, true, false, false);?></td>
+ <td <?php echo $highlight;?> valign="top" align="<?php echo $align;?>">
+ <?php
+ if($edit OR $readonly) {
+ echo '('.$item->label.') ';
+ }
+ echo format_text($item->name . $requiredmark, true, false, false);
+ ?>
+ </td>
<td valign="top" align="<?php echo $align;?>">
<?php
$index = 1;
var $type = "multichoicerated";
var $requiredcheck;
var $itemname;
+ var $itemlabel;
var $selectadjust;
var $selecttype;
var $values;
$this->requiredcheck = $mform->addElement('checkbox', 'required', get_string('required', 'feedback'));
$this->itemname = $mform->addElement('text', 'itemname', get_string('item_name', 'feedback'), array('size="'.FEEDBACK_ITEM_NAME_TEXTBOX_SIZE.'"','maxlength="255"'));
+ $this->itemlabel = $mform->addElement('text', 'itemlabel', get_string('item_label', 'feedback'), array('size="'.FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE.'"','maxlength="255"'));
$this->selectadjust = $mform->addElement('select',
'horizontal',
$item->presentation = empty($item->presentation) ? '' : $item->presentation;
$item->name = empty($item->name) ? '' : $item->name;
+ $item->label = empty($item->label) ? '' : $item->label;
$item->required = isset($item->required) ? $item->required : 0;
if($item->required) {
}
$item_form->itemname->setValue($item->name);
+ $item_form->itemlabel->setValue($item->label);
$range_from_to = explode('|',$item->presentation);
if(isset($values->data) AND is_array($values->data)) {
//echo '<table>';2
// $itemnr++;
- echo '<tr><th colspan="2" align="left">'. $itemnr . ' ' . $item->name .'</th></tr>';
+ echo '<tr><th colspan="2" align="left">'. $itemnr . ' ('. $item->label .') ' . $item->name .'</th></tr>';
foreach($values->data as $value) {
echo '<tr><td colspan="2" valign="top" align="left">- ' . number_format($value, 2, $this->sep_dec, $this->sep_thous) . '</td></tr>';
}
$analysed_item = $this->get_analysed($item, $groupid, $courseid);
$worksheet->setFormat("<l><f><ro2><vo><c:green>");
- $worksheet->write_string($rowOffset, 0, $item->name);
+ $worksheet->write_string($rowOffset, 0, $item->label);
+ $worksheet->write_string($rowOffset, 1, $item->name);
$data = $analysed_item->data;
if(is_array($data)) {
// $worksheet->setFormat("<l><ro2><vo>");
//mittelwert anzeigen
$worksheet->setFormat("<l><f><ro2><vo><c:red>");
- $worksheet->write_string($rowOffset, 1, get_string('average', 'feedback'));
+ $worksheet->write_string($rowOffset, 2, get_string('average', 'feedback'));
$worksheet->setFormat("<l><f><vo>");
- $worksheet->write_number($rowOffset + 1, 1, $analysed_item->avg);
+ $worksheet->write_number($rowOffset + 1, 2, $analysed_item->avg);
$rowOffset++;
}
$rowOffset++;
?>
<td <?php echo $highlight;?> valign="top" align="<?php echo $align;?>">
<?php
+ if($edit OR $readonly) {
+ echo '('.$item->label.') ';
+ }
echo format_text($item->name . $requiredmark, true, false, false);
switch(true) {
case ($range_from === '-' AND is_numeric($range_to)):
var $type = "numeric";
var $requiredcheck;
var $itemname;
+ var $itemlabel;
var $selectfrom;
var $selectto;
$this->requiredcheck = $mform->addElement('checkbox', 'required', get_string('required', 'feedback'));
$this->itemname = $mform->addElement('text', 'itemname', get_string('item_name', 'feedback'), array('size="'.FEEDBACK_ITEM_NAME_TEXTBOX_SIZE.'"','maxlength="255"'));
+ $this->itemlabel = $mform->addElement('text', 'itemlabel', get_string('item_label', 'feedback'), array('size="'.FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE.'"','maxlength="255"'));
$this->selectfrom = $mform->addElement('text', 'numericrangefrom', get_string('numeric_range_from', 'feedback'), array('size="10"','maxlength="10"'));
$item->presentation = empty($item->presentation) ? '' : $item->presentation;
$item->name = empty($item->name) ? '' : $item->name;
+ $item->label = empty($item->label) ? '' : $item->label;
$item->required = isset($item->required) ? $item->required : 0;
if($item->required) {
}
$item_form->itemname->setValue($item->name);
+ $item_form->itemlabel->setValue($item->label);
$widthAndHeight = explode('|',$item->presentation);
$itemwidth = isset($widthAndHeight[0]) ? $widthAndHeight[0] : 30;
if($values) {
//echo '<table>';2
// $itemnr++;
- echo '<tr><th colspan="2" align="left">'. $itemnr . ' ' . $item->name .'</th></tr>';
+ echo '<tr><th colspan="2" align="left">'. $itemnr . ' ('. $item->label .') ' . $item->name .'</th></tr>';
foreach($values as $value) {
echo '<tr><td valign="top" align="left">- </td><td align="left" valign="top">' . str_replace("\n", '<br />', $value->value) . '</td></tr>';
}
$analysed_item = $this->get_analysed($item, $groupid, $courseid);
$worksheet->setFormat("<l><f><ro2><vo><c:green>");
- $worksheet->write_string($rowOffset, 0, $item->name);
+ $worksheet->write_string($rowOffset, 0, $item->label);
+ $worksheet->write_string($rowOffset, 1, $item->name);
$data = $analysed_item->data;
if(is_array($data)) {
$worksheet->setFormat("<l><ro2><vo>");
if(isset($data[0])) {
- $worksheet->write_string($rowOffset, 1, $data[0]);
+ $worksheet->write_string($rowOffset, 2, $data[0]);
}
$rowOffset++;
for($i = 1; $i < sizeof($data); $i++) {
$worksheet->setFormat("<l><vo>");
- $worksheet->write_string($rowOffset, 1, $data[$i]);
+ $worksheet->write_string($rowOffset, 2, $data[$i]);
$rowOffset++;
}
}
}
$requiredmark = ($item->required == 1)?'<span class="feedback_required_mark">*</span>':'';
?>
- <td <?php echo $highlight;?> valign="top" align="<?php echo $align;?>"><?php echo format_text($item->name . $requiredmark, true, false, false);?></td>
+ <td <?php echo $highlight;?> valign="top" align="<?php echo $align;?>">
+ <?php
+ if($edit OR $readonly) {
+ echo '('.$item->label.') ';
+ }
+ echo format_text($item->name . $requiredmark, true, false, false);
+ ?>
+ </td>
<td valign="top" align="<?php echo $align;?>">
<?php
if($readonly){
var $type = "textarea";
var $requiredcheck;
var $itemname;
+ var $itemlabel;
var $selectwith;
var $selectheight;
$this->requiredcheck = $mform->addElement('checkbox', 'required', get_string('required', 'feedback'));
$this->itemname = $mform->addElement('text', 'itemname', get_string('item_name', 'feedback'), array('size="'.FEEDBACK_ITEM_NAME_TEXTBOX_SIZE.'"','maxlength="255"'));
+ $this->itemlabel = $mform->addElement('text', 'itemlabel', get_string('item_label', 'feedback'), array('size="'.FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE.'"','maxlength="255"'));
$this->selectwith = $mform->addElement('select',
'itemwidth',
$item->presentation = empty($item->presentation) ? '' : $item->presentation;
$item->name = empty($item->name) ? '' : $item->name;
+ $item->label = empty($item->label) ? '' : $item->label;
$item->required = isset($item->required) ? $item->required : 0;
if($item->required) {
}
$item_form->itemname->setValue($item->name);
+ $item_form->itemlabel->setValue($item->label);
$sizeAndLength = explode('|',$item->presentation);
$itemsize = isset($sizeAndLength[0]) ? $sizeAndLength[0] : 30;
if($values) {
//echo '<table>';2
// $itemnr++;
- echo '<tr><th colspan="2" align="left">'. $itemnr . ' ' . $item->name .'</th></tr>';
+ echo '<tr><th colspan="2" align="left">'. $itemnr . ' ('. $item->label .') ' . $item->name .'</th></tr>';
foreach($values as $value) {
echo '<tr><td colspan="2" valign="top" align="left">- ' . str_replace("\n", '<br />', $value->value) . '</td></tr>';
}
$analysed_item = $this->get_analysed($item, $groupid, $courseid);
$worksheet->setFormat("<l><f><ro2><vo><c:green>");
- $worksheet->write_string($rowOffset, 0, $item->name);
+ $worksheet->write_string($rowOffset, 0, $item->label);
+ $worksheet->write_string($rowOffset, 1, $item->name);
$data = $analysed_item->data;
if(is_array($data)) {
$worksheet->setFormat("<l><ro2><vo>");
- $worksheet->write_string($rowOffset, 1, $data[0]);
+ $worksheet->write_string($rowOffset, 2, $data[0]);
$rowOffset++;
for($i = 1; $i < sizeof($data); $i++) {
$worksheet->setFormat("<l><vo>");
- $worksheet->write_string($rowOffset, 1, $data[$i]);
+ $worksheet->write_string($rowOffset, 2, $data[$i]);
$rowOffset++;
}
}
}
$requiredmark = ($item->required == 1)?'<span class="feedback_required_mark">*</span>':'';
?>
- <td <?php echo $highlight;?> valign="top" align="<?php echo $align;?>"><?php echo format_text($item->name . $requiredmark, true, false, false);?></td>
+ <td <?php echo $highlight;?> valign="top" align="<?php echo $align;?>">
+ <?php
+ if($edit OR $readonly) {
+ echo '('.$item->label.') ';
+ }
+ echo format_text($item->name . $requiredmark, true, false, false);
+ ?>
+ </td>
<td valign="top" align="<?php echo $align;?>">
<?php
if($readonly){
var $type = "textfield";
var $requiredcheck;
var $itemname;
+ var $itemlabel;
var $selectwith;
var $selectheight;
$this->requiredcheck = $mform->addElement('checkbox', 'required', get_string('required', 'feedback'));
$this->itemname = $mform->addElement('text', 'itemname', get_string('item_name', 'feedback'), array('size="'.FEEDBACK_ITEM_NAME_TEXTBOX_SIZE.'"','maxlength="255"'));
+ $this->itemlabel = $mform->addElement('text', 'itemlabel', get_string('item_label', 'feedback'), array('size="'.FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE.'"','maxlength="255"'));
$this->selectwith = $mform->addElement('select',
'itemsize',
$itemname = trim($data->itemname);
$item->name = ($itemname ? $data->itemname : get_string('no_itemname', 'feedback'));
+ $itemlabel = trim($data->itemlabel);
+ $item->label = ($itemlabel ? $data->itemlabel : get_string('no_itemlabel', 'feedback'));
+
//get the used class from item-typ
$itemclass = 'feedback_item_'.$data->typ;
//get the instance of the item class
$itemname = trim($data->itemname);
$item->name = ($itemname ? $data->itemname : get_string('no_itemname', 'feedback'));
+ $itemlabel = trim($data->itemlabel);
+ $item->label = ($itemlabel ? $data->itemlabel : get_string('no_itemlabel', 'feedback'));
+
//get the used class from item-typ
$itemclass = 'feedback_item_'.$data->typ;
//get the instance of the item class
*/
- $module->version = 2009031201; // The current module version (Date: YYYYMMDDXX)
+ $module->version = 2009031301; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2008072401; // Requires this Moodle version
$feedback_version_intern = 1; //this version is used for restore older backups
$module->cron = 0; // Period for cron to check this module (secs)