array_push($arrayOfNormalTemplates, array($questionload->getObjectID(), $text)); } break; } /* -------------------------------------------------------- */ } /* report messages ---------------------------------------------------- */ $td->cont($report); $td->cont($lib->createSelections($arrayOfPolTemplates, $arrayOfSkalaTemplates, $arrayOfNormalTemplates, $arrayOfFreeTemplates, $myuserid)); } else { /* NO template selection lists ---------------------------------------- */ /* a back button */ $form = new HTM("form"); $form->attr("action", URLHelper::getLink("?page=edit&evalID=" . $evalID)); $form->attr("method", "post"); $form->html(CSRFProtection::tokenTag()); $form->cont(Button::create(_('zurück'), 'template_back_button', array('title' => _('Zurück zur Auswahl')))); $td->cont($form); /* on the fly info message -------------------------------------------- */ if ($command == "create_question_answers" || Request::option('onthefly')) { $report = EvalCommon::createReportMessage(sprintf(_("Weisen Sie der links %sausgewählten%s Frage hier Antworten zu:"), "<span class=\"eval_highlight\">", "</span>"), EVAL_PIC_INFO, EVAL_CSS_INFO); } /* report messages ---------------------------------------------------- */ $td->cont($report); } $tr->cont($td); $table->cont($tr); $tdA->cont($table); $trA->cont($tdA); $tableA->cont($trA); if ($command) {
/** * create html for the meta-information about an evaluation. * @param Object $eval The evaluation * @param bool $isAssociated whether the current user has used the eval * @returns String a table row */ function createEvalMetaInfo($eval, $votedNow = NO, $votedEarlier = NO) { $html = ""; $stopdate = $eval->getRealStopdate(); $number = EvaluationDB::getNumberOfVotes($eval->getObjectID()); $voted = $votedNow || $votedEarlier; $html .= "<div align=\"left\" style=\"margin-left:3px; margin-right:3px;\">\n"; $html .= "<hr noshade=\"noshade\" size=\"1\">\n"; # $html .= $votedEarlier ? _("Sie haben an dieser Evaluation bereits teilgenommen.") : ""; # $html .= $votedNow ? _("Vielen Dank für Ihre Teilnahme.") : ""; # $html .= $voted ? "<hr noshade=\"noshade\" size=\"1\">\n" : ""; /* multiple choice? ----------------------------------------------------- */ # if ($eval->isMultipleChoice()) { # $html .= ($voted || $eval->isStopped()) # ? _("Sie konnten mehrere Antworten auswählen.") # : _("Sie können mehrere Antworten auswählen."); # $html .= " \n"; # } /* ---------------------------------------------------------------------- */ $html .= EvalShow::getNumberOfVotesText($eval, $voted); $html .= "<br>"; $html .= EvalShow::getAnonymousText($eval, $voted); $html .= "<br>"; $html .= EvalShow::getStopdateText($eval, $voted); $html .= "<br>\n"; $html .= "</div>\n"; /* ---------------------------------------------------------------------- */ /* create html tr object ------------------------------------------------ */ $tr = new HTM("tr"); $td = new HTM("td"); $td->attr("align", "left"); $td->attr("style", "font-size:0.8em;"); $td->html($html); $tr->cont($td); return $tr; }
/** * Creates the form for the Polskala templates * @param */ function createTemplateFormFree(&$question) { global $evalID; $answer = $question->getNextChild(); $tableA = new HTM("table"); $tableA->attr("border", "0"); $tableA->attr("cellpadding", "2"); $tableA->attr("cellspacing", "0"); $tableA->attr("width", "100%"); $trA = new HTM("tr"); $tdA = new HTM("td"); $tdA->attr("class", "table_header_bold"); $tdA->attr("align", "left"); $tdA->html("<b>" . (strstr($this->getPageCommand(), "create") ? _("Freitextvorlage erstellen") : _("Freitextvorlage bearbeiten")) . "</b>"); $trA->cont($tdA); $tableA->cont($trA); $trA = new HTM("tr"); $tdA = new HTM("td"); $form = new HTM("form"); $form->attr("action", URLHelper::getLink("?page=edit&evalID=" . $evalID)); $form->attr("method", "post"); $form->html(CSRFProtection::tokenTag()); $b = new HTM("b"); $b->cont(_("Name") . ": "); $form->cont($b); $input = new HTMpty("input"); $input->attr("type", "text"); $input->attr("name", "template_name"); $name = $question->getText(); $input->attr("value", $question->getText()); // $input->attr( "value", $name ); $input->attr("style", "vertical-align:middle;"); $input->attr("size", 22); $input->attr("maxlength", 22); $form->cont($input); $input = new HTMpty("input"); $input->attr("type", "hidden"); $input->attr("name", "template_id"); $input->attr("value", $question->getObjectID()); $form->cont($input); $input = new HTMpty("input"); $input->attr("type", "hidden"); $input->attr("name", "template_type"); $input->attr("value", $question->getType()); $form->cont($input); $input = new HTMpty("input"); $input->attr("type", "hidden"); $input->attr("name", "template_multiple"); $input->attr("value", NO); $form->cont($input); $img = new HTMpty("img"); $img->attr("src", Icon::create('info-circle', 'inactive')->asImagePath(16)); $img->attr("class", "middle"); $img->stri(tooltip(_("Geben Sie hier einen Namen für Ihre Vorlage ein. Ändern Sie den Namen, um eine neue Vorlage anzulegen."), FALSE, TRUE)); $form->cont($img); $form->cont($this->BR); //$answer = $question->getNextChild(); //$answer->toString(); /* Anzahl Zeilen------------------------------------------------------ */ $form->cont($this->createSubHeadline(_("Anzahl Zeilen") . ": ")); $select = new HTM("select"); $select->attr("name", "template_add_num_answers"); $select->attr("size", "1"); $select->attr("style", "vertical-align:middle;"); for ($i = 1; $i <= 25; $i++) { $option = new HTM("option"); $option->attr("value", $i); $option->cont($i); if ($i == $answer->getRows()) { $option->addAttr("selected", "selected"); } $select->cont($option); } $form->cont($select); $form->cont($this->BR); /* uebernehmen / loeschen Button ---------------------------- */ $input = Button::create(_('Übernehmen'), 'template_savefree_button'); $odb = new EvaluationObjectDB(); //if($odb->getGlobalPerm()=="root"){ // $myuserid = 0; //} //else{ // $myuserid = $user->id; //} //if($question->getParentID()==$myuserid){ // $loesch=1; if (!strstr($this->command, "create")) { $showDelete = YES; $input2 = Button::createAccept(_('Löschen'), 'template_delete_button'); } $table = new HTM("table"); $table->attr("border", "0"); $table->attr("align", "center"); $table->attr("cellspacing", "0"); $table->attr("cellpadding", "3"); $table->attr("width", "100%"); $tr = new HTM("tr"); $td = new HTM("td"); $td->attr("class", "content_body"); $td->attr("align", "center"); $td->cont($input); $tr->cont($td); if ($showDelete) { $td = new HTM("td"); $td->attr("class", "content_body"); $td->attr("align", "center"); $td->cont($input2); $tr->cont($td); } $table->cont($tr); $form->cont($table); $tdA->cont($form); $trA->cont($tdA); $tableA->cont($trA); return $tableA; }