} } $grade_form->set_data($data); echo '<div id="vpl_grade_view" style="height:220px">'; echo '<div id="vpl_grade_form" style="float:left">'; $grade_form->display(); echo '</div>'; echo '<div id="vpl_grade_comments" style="float:left;width:40%;overflow:auto">'; $comments = $vpl->get_grading_help(); if ($comments > '') { echo $OUTPUT->box_start(); echo '<b>' . get_string('listofcomments', VPL) . '</b><hr />'; echo $comments; echo $OUTPUT->box_end(); } echo '</div>'; echo '</div>'; echo '<div id="vpl_submission_view" style="clear:both;overflow:auto;" >'; echo '<hr />'; $vpl->print_variation($subinstance->userid); $submission->print_submission(); echo '</div>'; $jscript .= 'VPL.hlrow(' . $submissionid . ');'; $jscript .= 'window.onunload= function(){VPL.unhlrow(' . $submissionid . ');};'; } } } else { vpl_inmediate_redirect(vpl_mod_href('forms/submissionview.php', 'id', $id, 'userid', $userid)); } $vpl->print_footer_simple(); echo vpl_include_js($jscript);
if ($vpl->get_instance()->restrictededitor) { $vpl->require_capability(VPL_MANAGE_CAPABILITY); } $vpl->require_capability(VPL_SUBMIT_CAPABILITY); $vpl->network_check(); $vpl->password_check(); } else { //Make other user submission $vpl->require_capability(VPL_MANAGE_CAPABILITY); } $instance = $vpl->get_instance(); $vpl->print_header(get_string('submission', VPL)); $vpl->print_view_tabs(basename(__FILE__)); $mform = new mod_vpl_submission_form('submission.php', $vpl); if ($mform->is_cancelled()) { vpl_inmediate_redirect(vpl_mod_href('view.php', 'id', $id)); die; } if ($fromform = $mform->get_data()) { $raw_POST_size = strlen(file_get_contents("php://input")); if ($_SERVER['CONTENT_LENGTH'] != $raw_POST_size) { $error = "NOT SAVED (Http POST error: CONTENT_LENGTH expected " . $_SERVER['CONTENT_LENGTH'] . " found {$raw_POST_size})"; notice($error, vpl_mod_href('forms/submission.php', 'id', $id, 'userid', $userid), $vpl->get_course()); die; } $rfn = $vpl->get_required_fgm(); $minfiles = count($rfn->getFilelist()); $files = array(); for ($i = 0; $i < $instance->maxfiles; $i++) { $attribute = 'file' . $i; $name = $mform->get_new_filename($attribute);
//update record if ($DB->get_record(VPL_VARIATIONS, array('id' => $fromform->varid, 'vpl' => $vplid))) { //Check consistence $fromform->vpl = $vplid; $fromform->id = $fromform->varid; vpl_truncate_VARIATIONS($fromform); $DB->update_record(VPL_VARIATIONS, $fromform); \mod_vpl\event\variation_updated::log(array('objectid' => $fromform->varid, 'context' => $vpl->get_context())); } else { $vpl->print_header(get_string('variations', VPL)); $vpl->print_heading_with_help('variations'); print_error(VPL_VARIATIONS . ' record inconsistence', VPL, $href); } } } vpl_inmediate_redirect($href); } } //Display page $vpl->print_configure_tabs(basename(__FILE__)); if (isset($oform)) { $oform->display(); } //Get list of variations $list = $DB->get_records('vpl_variations', array('vpl' => $vplid)); //Generate and show forms $number = 1; foreach ($list as $variation) { $aform = new mod_vpl_variation_form($href, $number, $variation->id); $variation->varid = $variation->id; $variation->id = $id;