Scoring class for tests. More...
Inheritance diagram for ilTestScoringGUI:
Collaboration diagram for ilTestScoringGUI:Public Member Functions | |
| ilTestScoringGUI ($a_object) | |
| ilTestScoringGUI constructor | |
| selectParticipant () | |
| Selects a participant for manual scoring. | |
| manscoring ($active_id=0) | |
| Shows the test scoring GUI. | |
| setPointsManual () | |
| Sets the points of a question manually. | |
| setFeedbackManual () | |
Scoring class for tests.
Definition at line 36 of file class.ilTestScoringGUI.php.
| ilTestScoringGUI::ilTestScoringGUI | ( | $ | a_object | ) |
ilTestScoringGUI constructor
The constructor takes the test object reference as parameter
| object | $a_object Associated ilObjTest class public |
Definition at line 47 of file class.ilTestScoringGUI.php.
References ilTestServiceGUI::ilTestServiceGUI().
{
parent::ilTestServiceGUI($a_object);
$this->ctrl->saveParameter($this, "active_id");
$this->ctrl->saveParameter($this, "pass");
}
Here is the call graph for this function:| ilTestScoringGUI::manscoring | ( | $ | active_id = 0 |
) |
Shows the test scoring GUI.
| integer | $active_id The acitve ID of the participant to score |
Definition at line 67 of file class.ilTestScoringGUI.php.
References $_GET, $data, ilObjAssessmentFolder::_getManualScoring(), ilRTE::_getRTEClassname(), ilObject::_lookupObjectId(), ilObject::_lookupType(), ilTestServiceGUI::getPassListOfAnswersWithScoring(), ilTestServiceGUI::getPassOverview(), and ilUtil::sendInfo().
Referenced by selectParticipant(), and setPointsManual().
{
global $ilAccess;
if (!$ilAccess->checkAccess("write", "", $this->ref_id))
{
// allow only write access
ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
$this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
}
include_once "./classes/class.ilObjAssessmentFolder.php";
$scoring = ilObjAssessmentFolder::_getManualScoring();
if (count($scoring) == 0)
{
// allow only if question types are marked for manual scoring
ilUtil::sendInfo($this->lng->txt("manscoring_not_allowed"));
return;
}
if ((!($active_id > 0)) && (array_key_exists("active_id", $_GET)))
{
if (strlen($_GET["active_id"])) $active_id = $_GET["active_id"];
}
$pass = $this->object->_getResultPass($active_id);
if (array_key_exists("pass", $_GET))
{
if (strlen($_GET["pass"]))
{
$maxpass = $this->object->_getMaxPass($active_id);
if ($_GET["pass"] <= $maxpass) $pass = $_GET["pass"];
}
}
$participants =& $this->object->getTestParticipants();
if (count($participants) == 0)
{
ilUtil::sendInfo($this->lng->txt("tst_participants_no"));
return;
}
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_manual_scoring.html", "Modules/Test");
if (array_key_exists("question", $_POST))
{
$keys = array_keys($_POST["question"]);
$question_id = $keys[0];
$this->tpl->setCurrentBlock("lastchanged");
$this->tpl->setVariable("LAST_CHANGED", $question_id);
$this->tpl->parseCurrentBlock();
}
$counter = 1;
foreach ($participants as $participant_active_id => $data)
{
$this->tpl->setCurrentBlock("participants");
$this->tpl->setVariable("ID_PARTICIPANT", $data->active_id);
$suffix = "";
if ($this->object->getAnonymity())
{
$suffix = " " . $counter++;
}
if ($active_id > 0)
{
if ($active_id == $data->active_id)
{
$this->tpl->setVariable("SELECTED_PARTICIPANT", " selected=\"selected\"");
}
}
$this->tpl->setVariable("TEXT_PARTICIPANT", $this->object->userLookupFullName($data->usr_id, FALSE, TRUE, $suffix));
$this->tpl->parseCurrentBlock();
}
$this->tpl->setVariable("PLEASE_SELECT", $this->lng->txt("please_select"));
$this->tpl->setVariable("BUTTON_SELECT", $this->lng->txt("select"));
$this->tpl->setVariable("TEXT_SELECT_USER", $this->lng->txt("manscoring_select_user"));
if ($active_id > 0)
{
// print pass overview
if ($this->object->getNrOfTries() != 1)
{
$overview = $this->getPassOverview($active_id, "iltestscoringgui", "manscoring");
$this->tpl->setVariable("PASS_OVERVIEW", $overview);
}
// print pass details with scoring
if (strlen($pass))
{
$result_array =& $this->object->getTestResult($active_id, $pass);
$scoring = $this->getPassListOfAnswersWithScoring($result_array, $active_id, $pass, TRUE);
$this->tpl->setVariable("SCORING_DATA", $scoring);
}
}
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this, "selectParticipant"));
include_once "./Services/RTE/classes/class.ilRTE.php";
$rtestring = ilRTE::_getRTEClassname();
include_once "./Services/RTE/classes/class.$rtestring.php";
$rte = new $rtestring();
$rte->addPlugin("latex");
$rte->addButton("latex"); $rte->addButton("pastelatex");
include_once "./classes/class.ilObject.php";
$obj_id = ilObject::_lookupObjectId($_GET["ref_id"]);
$obj_type = ilObject::_lookupType($_GET["ref_id"], TRUE);
$rte->addRTESupport($obj_id, "fdb", "assessment");
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilTestScoringGUI::selectParticipant | ( | ) |
Selects a participant for manual scoring.
Definition at line 57 of file class.ilTestScoringGUI.php.
References manscoring().
{
$this->manscoring($_POST["participants"]);
}
Here is the call graph for this function:| ilTestScoringGUI::setFeedbackManual | ( | ) |
Definition at line 196 of file class.ilTestScoringGUI.php.
References $_GET, ilObjAdvancedEditing::_getUsedHTMLTagsAsString(), ilUtil::sendInfo(), setPointsManual(), and ilUtil::stripSlashes().
{
if (array_key_exists("feedback", $_POST))
{
$feedbacks = array_keys($_POST["feedback"]);
$question_id = $feedbacks[0];
include_once "./classes/class.ilObjAdvancedEditing.php";
$feedback = ilUtil::stripSlashes($_POST["feedback"][$question_id], FALSE, ilObjAdvancedEditing::_getUsedHTMLTagsAsString("assessment"));
$result = $this->object->saveManualFeedback($_GET["active_id"], $question_id, $_GET["pass"], $feedback);
if ($result)
{
ilUtil::sendInfo($this->lng->txt("tst_set_feedback_done"));
}
else
{
ilUtil::sendInfo($this->lng->txt("tst_set_feedback_not_done"));
}
}
$this->setPointsManual();
}
Here is the call graph for this function:| ilTestScoringGUI::setPointsManual | ( | ) |
Sets the points of a question manually.
Definition at line 174 of file class.ilTestScoringGUI.php.
References $_GET, assQuestion::_getMaximumPoints(), assQuestion::_setReachedPoints(), manscoring(), and ilUtil::sendInfo().
Referenced by setFeedbackManual().
{
if (array_key_exists("question", $_POST))
{
$keys = array_keys($_POST["question"]);
$question_id = $keys[0];
$points = $_POST["question"][$question_id];
include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
$maxpoints = assQuestion::_getMaximumPoints($question_id);
$result = assQuestion::_setReachedPoints($_GET["active_id"], $question_id, $points, $maxpoints, $_GET["pass"]);
if ($result)
{
ilUtil::sendInfo($this->lng->txt("tst_change_points_done"));
}
else
{
ilUtil::sendInfo($this->lng->txt("tst_change_points_not_done"));
}
}
$this->manscoring();
}
Here is the call graph for this function:
Here is the caller graph for this function:
1.7.1