Esempio n. 1
0
     if (isset($savereturn)) {
         $value = isset($formdata->{$frmvaluename}) ? $formdata->{$frmvaluename} : NULL;
     } else {
         if (isset($feedbackcompletedtmp->id)) {
             $value = feedback_get_item_value($feedbackcompletedtmp->id, $feedbackitem->id, true);
         }
     }
     echo '<tr>';
     if ($feedbackitem->hasvalue == 1 and $feedback->autonumbering) {
         $itemnr++;
         echo '<td valign="top">' . $itemnr . '.&nbsp;</td>';
     } else {
         echo '<td>&nbsp;</td>';
     }
     if ($feedbackitem->typ != 'pagebreak') {
         feedback_print_item($feedbackitem, $value, false, false, $highlightrequired);
     }
     echo '</tr>';
     echo '<tr><td>&nbsp;</td></tr>';
     $lastbreakposition = $feedbackitem->position;
     //last item-pos (item or pagebreak)
     if ($feedbackitem->typ == 'pagebreak') {
         break;
     } else {
         $lastitem = $feedbackitem;
     }
 }
 echo '</table>';
 echo '<input type="hidden" name="id" value="' . $id . '" />';
 echo '<input type="hidden" name="feedbackid" value="' . $feedback->id . '" />';
 echo '<input type="hidden" name="lastpage" value="' . $gopage . '" />';
Esempio n. 2
0
 foreach ($feedbackitems as $feedbackitem) {
     $itempos++;
     if (isset($SESSION->feedback->moving) and $SESSION->feedback->moving->movingitem == $feedbackitem->id) {
         //hiding the item to move
         continue;
     }
     echo '<tr>';
     //items without value only are labels
     if ($feedbackitem->hasvalue == 1 and $feedback->autonumbering) {
         $itemnr++;
         echo '<td valign="top">' . $itemnr . '.&nbsp;</td>';
     } else {
         echo '<td>&nbsp;</td>';
     }
     if ($feedbackitem->typ != 'pagebreak') {
         feedback_print_item($feedbackitem, false, false, true);
     } else {
         echo '<td class="feedback_pagebreak"><b>' . get_string('pagebreak', 'feedback') . '</b></td><td><hr width="100%" size="8px" noshade="noshade" /></td>';
     }
     echo '<td>(' . get_string('position', 'feedback') . ':' . $itempos . ')</td>';
     echo '<td>';
     if ($feedbackitem->position > 1) {
         $buttonlink = $ME . '?' . htmlspecialchars(feedback_edit_get_default_query($id, $do_show) . '&moveupitem=' . $feedbackitem->id);
         echo '<a class="icon up" title="' . get_string('moveup_item', 'feedback') . '" href="' . $buttonlink . '">
                     <img alt="' . get_string('moveup_item', 'feedback') . '" src="' . $CFG->pixpath . '/t/up.gif" />
                   </a>';
         //print the button to move-up the item
         // echo '<form action="'.$ME.'" method="post"><fieldset>';
         // ///////echo '<input title="'.get_string('moveup_item','feedback').'" type="image" src="'.$CFG->pixpath .'/t/up.gif" hspace="1" height="11" width="11" border="0" />';
         // echo '<input class="feedback_moveup_button" title="'.get_string('moveup_item','feedback').'" type="image" src="'.$CFG->pixpath .'/t/up.gif" />';
         // echo '<input type="hidden" name="moveupitem" value="'.$feedbackitem->id.'" />';
Esempio n. 3
0
        echo '<input type="hidden" name="sesskey" value="' . $USER->sesskey . '" />';
        echo '<table width="100%">';
        $itemnr = 0;
        foreach ($feedbackitems as $feedbackitem) {
            //get the values
            $value = get_record_select('feedback_value', 'completed =' . $feedbackcompleted->id . ' AND item=' . $feedbackitem->id);
            echo '<tr>';
            if ($feedbackitem->hasvalue == 1 and $feedback->autonumbering) {
                $itemnr++;
                echo '<td valign="top">' . $itemnr . '.&nbsp;</td>';
            } else {
                echo '<td>&nbsp;</td>';
            }
            if ($feedbackitem->typ != 'pagebreak') {
                $itemvalue = isset($value->value) ? $value->value : false;
                feedback_print_item($feedbackitem, $itemvalue, true);
            } else {
                echo '<td colspan="2"><hr /></td>';
            }
            echo '</tr>';
        }
        echo '<tr><td colspan="2" align="center">';
        echo '</td></tr>';
        echo '</table>';
        echo '</form>';
        // print_simple_box_end();
        print_box_end();
    }
}
/// Finish the page
///////////////////////////////////////////////////////////////////////////
Esempio n. 4
0
/**
* Print a detailed representation of what a  user has done with
* a given particular instance of this module, for user activity reports.
* @param object $course
* @param object $user
* @param object $mod
* @param object $feedback
* @return object
*/
function feedback_user_complete($course, $user, $mod, $feedback)
{
    global $USER;
    //todo: add check to see if this feedback is supposed to be anonymous and only show results when $USER == $user
    $feedbackitems = get_records('feedback_item', 'feedback', $feedback->id, 'position');
    $feedbackcompleted = get_record('feedback_completed', 'feedback', $feedback->id, 'userid', $user->id);
    if (is_array($feedbackitems)) {
        if ($feedbackcompleted) {
            print_box_start('generalbox boxaligncenter boxwidthnormal');
            echo '<form>';
            echo '<input type="hidden" name="sesskey" value="' . $USER->sesskey . '" />';
            echo '<table width="100%">';
            $itemnr = 0;
            foreach ($feedbackitems as $feedbackitem) {
                //get the values
                $value = get_record_select('feedback_value', 'completed =' . $feedbackcompleted->id . ' AND item=' . $feedbackitem->id);
                echo '<tr>';
                if ($feedbackitem->hasvalue == 1 and $feedback->autonumbering) {
                    $itemnr++;
                    echo '<td valign="top">' . $itemnr . '.&nbsp;</td>';
                } else {
                    echo '<td>&nbsp;</td>';
                }
                if ($feedbackitem->typ != 'pagebreak') {
                    $itemvalue = isset($value->value) ? $value->value : false;
                    feedback_print_item($feedbackitem, $itemvalue, true);
                } else {
                    echo '<td colspan="2"><hr /></td>';
                }
                echo '</tr>';
            }
            echo '<tr><td colspan="2" align="center">';
            echo '</td></tr>';
            echo '</table>';
            echo '</form>';
            print_box_end();
        }
    }
    return true;
}
Esempio n. 5
0
}
if (is_array($templateitems)) {
    $itemnr = 0;
    echo '<p align="center">' . get_string('preview', 'feedback') . '</p>';
    // print_simple_box_start('center', '75%');
    print_box_start('generalbox boxaligncenter boxwidthwide');
    echo '<div align="center"><table>';
    foreach ($templateitems as $templateitem) {
        echo '<tr>';
        if ($templateitem->hasvalue == 1 and $feedback->autonumbering) {
            $itemnr++;
            echo '<td valign="top">' . $itemnr . '.&nbsp;</td>';
        } else {
            echo '<td>&nbsp;</td>';
        }
        if ($templateitem->typ != 'pagebreak') {
            feedback_print_item($templateitem);
        } else {
            echo '<td><hr /></td><td>' . get_string('pagebreak', 'feedback') . '</td>';
        }
        echo '</tr>';
        echo '<tr><td>&nbsp;</td></tr>';
    }
    echo '</table></div>';
    // print_simple_box_end();
    print_box_end();
} else {
    // print_simple_box(get_string('no_items_available_at_this_template','feedback'),"center");
    print_box(get_string('no_items_available_at_this_template', 'feedback'), 'generalbox boxaligncenter boxwidthwide');
}
print_footer($course);