Commit c2c2729e authored by Lückemeyer's avatar Lückemeyer
Browse files

added competency table to detail result view

parent 0e32e48b
Showing with 168 additions and 28 deletions
+168 -28
No preview for this file type
......@@ -21,22 +21,105 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$string["pluginname"] = "Dockerized Testing Agent";
// General.
$string["pluginname"] = "Dockerized Testing Agent (DTA)";
$string["enabled"] = $string["pluginname"];
// Dialog field labels.
$string["submission_label"] = "DTA submission configuration or zip-packed project";
$string["submission_label_help"] = "Either upload a single textfile containing one DTA URI pointing to the repository with your submission or pack your project as zip and upload it directly. Using the textfile you can additionally add as many unified-ticketing URI (one per line) as you wish for feedback into one or more ticketsystems.";
$string["submission_settings_label"] = "DTA test configuration";
$string["submission_settings_label_help"] = "single text file with DTA test URI";
$string["backendHost_help"] = "Address/Name and Port of backend server";
$string["backendHost_not_set"] = "The Dockerized Testing Agent backend URL is not configured";
$string["enabled"] = $string["pluginname"];
$string["enabled_help"] = "If enabled, you will have to upload a textfile containing a valid DTA URI pointing to the repository with your test logic and defining a docker image on dockerhub used as testrunner. Your students will have to either upload their code in a zip archive resembling the expected repository structure or as well by providing a textifle with a valid DTA URI pointing to the repository with their submission logic";
$string["no_submissionfile_warning"] = "Submission type is \"Dockerized Testing Agent\" but no configuration file or submission archive uploaded";
// Content.
$string["tests_successful"] = " tests successful";
$string["failures"] = " failures";
$string["compilation_errors"] = " compilation error(s)";
$string["unknown_state"] = " test(s) with unknown state";
$string["sucess_competencies"] = "Successfully tested competency profile";
$string["summary"] = "Summary";
$string["total_items"] = "Total items";
$string["success_rate"] = "Success rate";
$string["details"] = "Details";
$string["competencies"] = "Competencies";
$string["package_name"] = "Package Name";
$string["unit_name"] = "Unit Name";
$string["test_name"] = "Test Name";
$string["status"] = "Status";
$string["failure_type"] = "Failure Type";
$string["failure_reason"] = "Failure Reason";
$string["line_no"] = "Line Number";
$string["col_no"] = "Column Number";
$string["pos"] = "Position";
$string["stacktrace"] = "Stack Trace";
// Comeptencies.
$string["comp_statement"] = "Statement";
$string["comp_block"] = "Block";
$string["comp_flow"] = "Flow of Control";
$string["comp_loop"] = "Repetition";
$string["comp_const"] = "Constant";
$string["comp_var"] = "Variable";
$string["comp_type"] = "Type";
$string["comp_datastructure"] = "Data Structure";
$string["comp_interface"] = "Interface";
$string["comp_unit"] = "Unit of Code";
$string["comp_proc_usage"] = "Procedure Usage";
$string["comp_proc_sign"] = "Procedure Signature";
$string["comp_library"] = "Library Usage";
$string["comp_ext_api"] = "External API Usage";
$string["comp_simple"] = "Simplicity";
$stirng["comp_abstraction"] = "Abstraction";
// Competencies for index calculation.
$string["comp1"] = $string["comp_statement"];
$string["comp2"] = $string["comp_block"];
$string["comp3"] = $string["comp_flow"];
$string["comp4"] = $string["comp_loop"];
$string["comp5"] = $string["comp_const"];
$string["comp6"] = $string["comp_var"];
$string["comp7"] = $string["comp_type"];
$string["comp8"] = $string["comp_datastructure"];
$string["comp9"] = $string["comp_interface"];
$string["comp10"] = $string["comp_unit"];
$string["comp11"] = $string["comp_proc_usage"];
$string["comp12"] = $string["comp_proc_sign"];
$string["comp13"] = $string["comp_library"];
$string["comp14"] = $string["comp_ext_api"];
$string["comp15"] = $string["comp_simple"];
$string["comp16"] = $stirng["comp_abstraction"];
// Competency explanations.
$string["comp_statement_expl"] = "formulate a syntactically correct statement that contributes to the solution of the given problem.";
$string["comp_block_expl"] = "structure code into syntactically correct small unnamed units that contribute to the solution of the given problem.";
$string["comp_flow_expl"] = "formulate syntax elements guiding the control flow such that it contributes to the solution of the given problem.";
$string["comp_loop_expl"] = "use syntax elements repeating statements such that it contributes to the solution of the given problem.";
$string["comp_const_expl"] = "identify and syntactically correctly define constants that contribute to the understanding and solution of the given problem.";
$string["comp_var_expl"] = "identify and syntactically correctly define variables that contribute to the solution of the given problem.";
$string["comp_type_expl"] = "define and/or choose appropriate data types for data elements such that they contribute to the solution of the given problem.";
$string["comp_datastructure_expl"] = "define and/or choose appropriate data structures for data elements such that they contribute to the solution of the given problem.";
$string["comp_interface_expl"] = "define and use interfaces for larger units of code such that it contributes to the solution of the given problem.";
$string["comp_unit_expl"] = "define and larger units of code such that it contributes to the solution of the given problem.";
$string["comp_proc_usage_expl"] = "use existing named structure blocks with a pre-defined behavior and signature such that it contributes to the solution of the given problem.";
$string["comp_proc_sign_expl"] = "define named structure blocks with a pre-defined behavior and signature such that it contributes to the solution of the given problem.";
$string["comp_library_expl"] = "use existing larger collections of named structure blocks with a pre-defined behavior and signature such that it contributes to the solution of the given problem.";
$string["comp_ext_api_expl"] = "use standardized existing external collections of named structure blocks with a pre-defined behavior and signature such that it contributes to the solution of the given problem.";
$string["comp_simple_expl"] = "create a simple solution of the given problem.";
$string["comp_abstraction_expl"] = "create a sufficiently abstract solution for the given problem.";
// Warnings.
$string["no_testfile_warning"] = "Submission type is \"Dockerized Testing Agent\" but no configuration file uploaded";
// Error messages.
$string["backendHost_not_set"] = "The Dockerized Testing Agent backend URL is not configured";
$string["no_submissionfile_warning"] = "Submission type is \"Dockerized Testing Agent\" but no configuration file or submission archive uploaded";
$string["http_client_error_msg"] = "A client error occured (HTTP 4xx)";
$string["http_server_error_msg"] = "A server error occured (HTTP 5xx)";
$string["http_unknown_error_msg"] = "An unknown HTTP error occured on backend transfer";
// Admin Settings.
// Admin settings.
$string["default"] = "Enabled by default";
$string["default_help"] = "If set, this submission method will be enabled by default for all new assignments.";
$string["backendHost"] = "Backend Server Address";
$string["backendHost_help"] = "Address/Name and Port of backend server";
......@@ -67,6 +67,7 @@ class assign_submission_dta extends assign_submission_plugin {
$mform->addHelpButton(
// Form-unique element id to which to add button.
self::ASSIGNSUBMISSION_DTA_DRAFT_FILEAREA_TEST,
// Key.
"submission_settings_label",
// Language file to use.
self::COMPONENT_NAME
......
......@@ -16,6 +16,9 @@
class ViewSubmissionUtils {
// Broadly used in logic, parametrized for easier change.
const COMPONENT_NAME = "assignsubmission_dta";
/**
* generates a short summary html
*
......@@ -43,17 +46,17 @@ class ViewSubmissionUtils {
$html .= ($summary->compilationErrorCount() == 0 && $summary->unknownCount() == 0)
? $summary->resultCount() . " (" . $successrate . "%)"
: "?";
$html .= " tests successful<br>";
$html .= get_string("tests_successful", self::COMPONENT_NAME) . "<br>";
if ($summary->compilationErrorCount() > 0) {
$html .= $summary->compilationErrorCount() . " compilation error(s)<br>";
$html .= $summary->compilationErrorCount() . get_string("compilation_errors", self::COMPONENT_NAME) . "<br>";
}
if ($summary->unknownCount() > 0) {
$html .= $summary->unknownCount() . " test(s) with unknown state<br>";
$html .= $summary->unknownCount() . get_string("unknown_state", self::COMPONENT_NAME) . "<br>";
}
$html .= $summary->successfulTestCompetencyProfile . " successfully tested competency profile<br>";
$html .= $summary->successfulTestCompetencyProfile . get_string("success_competencies", self::COMPONENT_NAME) . "<br>";
return html_writer::div($html, "dtaSubmissionSummary");
}
......@@ -84,7 +87,7 @@ class ViewSubmissionUtils {
// Summary table.
$tmp = "";
$tmp .= html_writer::tag("th", "Summary", ["class" => "dtaTableHeader"]);
$tmp .= html_writer::tag("th", get_string("summary", self::COMPONENT_NAME), ["class" => "dtaTableHeader"]);
$tmp .= html_writer::empty_tag("th", ["class" => "dtaTableHeader"]);
$header = html_writer::tag("tr", $tmp, $tableheaderrowattributes);
$header = html_writer::tag("thead", $header);
......@@ -94,7 +97,7 @@ class ViewSubmissionUtils {
$attributes = ["class" => "dtaTableData"];
$tmp .= html_writer::tag(
"td",
"result items in sum",
get_string("total_items", self::COMPONENT_NAME),
$attributes);
$tmp .= html_writer::tag(
......@@ -108,7 +111,7 @@ class ViewSubmissionUtils {
$body .= html_writer::tag("tr", $tmp, $resultrowattributes);
$tmp = "";
$tmp .= html_writer::tag("td", "successes", $attributes);
$tmp .= html_writer::tag("td", get_string("tests_successful", self::COMPONENT_NAME), $attributes);
$tmp .= html_writer::tag( "td", $summary->successfulCount(), $attributes);
$resultrowattributes = $tablerowattributes;
......@@ -129,7 +132,7 @@ class ViewSubmissionUtils {
$body .= html_writer::tag("tr", $tmp, $resultrowattributes);
$tmp = "";
$tmp .= html_writer::tag("td", "failures", $attributes);
$tmp .= html_writer::tag("td", get_string("failures", self::COMPONENT_NAME), $attributes);
$tmp .= html_writer::tag("td", $summary->failedCount(), $attributes);
$resultrowattributes = $tablerowattributes;
......@@ -141,7 +144,7 @@ class ViewSubmissionUtils {
$body .= html_writer::tag("tr", $tmp, $resultrowattributes);
$tmp = "";
$tmp .= html_writer::tag("td", "compilation errors", $attributes);
$tmp .= html_writer::tag("td", get_string("compilation_errors", self::COMPONENT_NAME), $attributes);
$tmp .= html_writer::tag("td", $summary->compilationErrorCount(), $attributes);
$resultrowattributes = $tablerowattributes;
......@@ -153,7 +156,7 @@ class ViewSubmissionUtils {
$body .= html_writer::tag("tr", $tmp, $resultrowattributes);
$tmp = "";
$tmp .= html_writer::tag("td", "unknown state", $attributes);
$tmp .= html_writer::tag("td", get_string("unknown_state", self::COMPONENT_NAME), $attributes);
$tmp .= html_writer::tag("td", $summary->unknownCount(), $attributes);
$resultrowattributes = $tablerowattributes;
......@@ -165,7 +168,7 @@ class ViewSubmissionUtils {
$body .= html_writer::tag("tr", $tmp, $resultrowattributes);
$tmp = "";
$tmp .= html_writer::tag("td", html_writer::tag("b", "success rate"), $attributes);
$tmp .= html_writer::tag("td", html_writer::tag("b", get_string("success_rate", self::COMPONENT_NAME)), $attributes);
$tmp .= html_writer::tag(
"td",
html_writer::tag("b", $summary->successfulCount()
......@@ -193,12 +196,45 @@ class ViewSubmissionUtils {
$html .= $table;
// Add empty div for spacing between summary and details table.
// Add empty div for spacing between summary and compentency table.
$html .= html_writer::empty_tag("div", ["class" => "dtaSpacer"]);
$tmp = "";
$tmp .= html_writer::tag("th", get_string("competencies", self::COMPONENT_NAME), ["class" => "dtaTableHeader"]);
$tmp .= html_writer::empty_tag("th", ["class" => "dtaTableHeader"]);
$header = html_writer::tag("tr", $tmp, $tableheaderrowattributes);
$header = html_writer::tag("thead", $header);
$showncompetencies = explode(";", $summary->successfultestcompetencies);
$overallcompetencies = explode(";", $summary->overalltestcompetencies);
$index=1;
foreach ($overallcompetencies as $comp) {
// If the competency was actually assessed by the assignment and tests, add a row in the table.
if($comp!="0") {
// New copy of base attributes array.
$resultrowattributes = $tablerowattributes;
$tmp = "";
$tmp .= html_writer::tag("td", get_string("comp" . $index, self::COMPONENT_NAME), $resultrowattributes);
$tmp = "";
$tmp .= html_writer::tag("td",
floatval($showncompetencies[index])/floatval ($comp) . "%
(" . $showncompetencies[index] . " / " . $comp . ")",
$resultrowattributes);
$body .= html_writer::tag("tr", $tmp, $resultrowattributes);
}
$index = $index + 1;
}
$body = html_writer::tag("tbody", $body);
$html .= html_writer::tag("table", $header . $body, ["class" => "dtaTable"]);
// Add empty div for spacing between competency and details table.
$html .= html_writer::empty_tag("div", ["class" => "dtaSpacer"]);
// Details table.
$tmp = "";
$tmp .= html_writer::tag("th", "Details", ["class" => "dtaTableHeader"]);
$tmp .= html_writer::tag("th", get_string("details", self::COMPONENT_NAME), ["class" => "dtaTableHeader"]);
$tmp .= html_writer::empty_tag("th", ["class" => "dtaTableHeader"]);
$header = html_writer::tag("tr", $tmp, $tableheaderrowattributes);
$header = html_writer::tag("thead", $header);
......@@ -228,7 +264,27 @@ class ViewSubmissionUtils {
$tmp = "";
$tmp .= html_writer::tag(
"td",
"name",
get_string("package_name", self::COMPONENT_NAME),
$attributes);
$tmp .= html_writer::tag(
"td",
$r->packagename,
$attributes);
$tmp .= html_writer::tag(
"td",
get_string("unit_name", self::COMPONENT_NAME),
$attributes);
$tmp .= html_writer::tag(
"td",
$r->classname,
$attributes);
$tmp .= html_writer::tag(
"td",
get_string("test_name", self::COMPONENT_NAME),
$attributes);
$tmp .= html_writer::tag(
......@@ -240,7 +296,7 @@ class ViewSubmissionUtils {
$tmp = "";
$tmp .= html_writer::tag(
"td",
"state",
get_string("status", self::COMPONENT_NAME),
$attributes);
$tmp .= html_writer::tag(
......@@ -254,7 +310,7 @@ class ViewSubmissionUtils {
$tmp = "";
$tmp .= html_writer::tag(
"td",
"failure type",
get_string("failure_type", self::COMPONENT_NAME),
$attributes);
$tmp .= html_writer::tag(
......@@ -266,7 +322,7 @@ class ViewSubmissionUtils {
$tmp = "";
$tmp .= html_writer::tag(
"td",
"failure reason",
get_string("failure_reason", self::COMPONENT_NAME),
$attributes);
$tmp .= html_writer::tag(
......@@ -280,7 +336,7 @@ class ViewSubmissionUtils {
$tmp = "";
$tmp .= html_writer::tag(
"td",
"line number",
get_string("line_no", self::COMPONENT_NAME)"line number",
$attributes);
$tmp .= html_writer::tag(
......@@ -294,7 +350,7 @@ class ViewSubmissionUtils {
$tmp = "";
$tmp .= html_writer::tag(
"td",
"column number",
get_string("col_no", self::COMPONENT_NAME),
$attributes);
$tmp .= html_writer::tag(
......@@ -308,7 +364,7 @@ class ViewSubmissionUtils {
$tmp = "";
$tmp .= html_writer::tag(
"td",
"position",
get_string("pos", self::COMPONENT_NAME),
$attributes);
$tmp .= html_writer::tag(
......@@ -321,7 +377,7 @@ class ViewSubmissionUtils {
$tmp = "";
$tmp .= html_writer::tag(
"td",
"stacktrace",
get_string("stacktrace", self::COMPONENT_NAME),
$attributes);
$tmp .= html_writer::tag(
......@@ -331,7 +387,7 @@ class ViewSubmissionUtils {
$body .= html_writer::tag("tr", $tmp, $resultrowattributes);
}
// Set spacerrow value if null for next rount separation.
// Set spacerrow value if null for next round separation.
if (is_null($spacerrow)) {
$spacerrow = html_writer::empty_tag("tr", ["class" => "dtaTableSpacer"]);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment