diff --git a/apiclients/easikit/classes/requests/getcomponentgrade.php b/apiclients/easikit/classes/requests/getcomponentgrade.php index c111c13..030ab22 100644 --- a/apiclients/easikit/classes/requests/getcomponentgrade.php +++ b/apiclients/easikit/classes/requests/getcomponentgrade.php @@ -83,7 +83,7 @@ public function process_response($response): array { 'MAB_SEQ' => $value['sequence_number'], 'AST_CODE' => $value['assessment_component_type']['code'], 'MAB_PERC' => $matches[1], - 'MAB_NAME' => $value['name'], + 'MAB_NAME' => preg_replace('/\s*\(\d+%?\)$/', '', $value['name']), 'MKS_CODE' => $value['mark_scheme']['code'], 'APA_ROMC' => $value['schedule']['location']['room']['identifier'], ]; diff --git a/classes/manager.php b/classes/manager.php index 1ace78a..24a8e56 100644 --- a/classes/manager.php +++ b/classes/manager.php @@ -854,7 +854,8 @@ public function get_transfer_logs (int $assessmentmappingid, int $userid, string } // Get the latest record for each push type, e.g. grade push, submission log push. - $sql = "SELECT t1.id, t1.type, t1.request, t1.response, t1.timecreated, t1.errlogid, errlog.errortype, errlog.message + $sql = "SELECT t1.id, t1.type, t1.request, t1.response, t1.requestbody, t1.timecreated, t1.errlogid, + errlog.errortype, errlog.message FROM {" . self::TABLE_TRANSFER_LOG . "} t1 INNER JOIN ( SELECT type, assessmentmappingid, MAX(timecreated) AS latest_time diff --git a/classes/output/pushrecord.php b/classes/output/pushrecord.php index 83275f4..1fda240 100644 --- a/classes/output/pushrecord.php +++ b/classes/output/pushrecord.php @@ -80,6 +80,12 @@ class pushrecord { /** @var bool Is submission log pushed */ public bool $issublogpushed = false; + /** @var bool Is marks updated after transfer */ + public bool $marksupdatedaftertransfer = false; + + /** @var string Transferred mark */ + public string $transferredmark = '-'; + /** @var manager|null Grade push manager */ protected ?manager $manager; @@ -188,6 +194,12 @@ protected function set_transfer_records(int $assessmentmappingid, int $studentid $this->componentgrade = $matches[1]; } if ($log->type == manager::PUSH_GRADE) { + // Check if marks updated after transfer. + if ($response->code == '0') { + $requestbody = json_decode($log->requestbody); + $this->transferredmark = $requestbody->actual_mark; + $this->marksupdatedaftertransfer = $this->marks != $requestbody->actual_mark; + } $this->lastgradepushresult = $result; $this->lastgradepusherrortype = $errortype; $this->lastgradepushtime = $timecreated; diff --git a/lang/en/local_sitsgradepush.php b/lang/en/local_sitsgradepush.php index 8c32917..f299fc6 100644 --- a/lang/en/local_sitsgradepush.php +++ b/lang/en/local_sitsgradepush.php @@ -81,6 +81,7 @@ $string['index:submissiondate'] = 'Submission date'; $string['index:lastmarktransfer'] = 'Mark Transferred'; $string['index:lastsublogtransfer'] = 'Submission Date recorded in SITS'; +$string['index:mark_changed_to'] = 'Mark changed to {$a}'; // Marks transfer dashboard page. $string['dashboard:header'] = 'SITS assessment mapping and mark transfer'; @@ -92,6 +93,7 @@ $string['dashboard:seq'] = 'SEQ'; $string['dashboard:sits_assessment'] = 'SITS assessment'; $string['dashboard:weight'] = 'Weight'; +$string['dashboard:mab_perc'] = '{$a}%'; $string['dashboard:asttype'] = 'AST TYPE'; $string['dashboard:source'] = 'Source'; $string['dashboard:moodle_activity'] = 'Moodle activity'; diff --git a/templates/dashboard.mustache b/templates/dashboard.mustache index da4546c..eaf4cd0 100644 --- a/templates/dashboard.mustache +++ b/templates/dashboard.mustache @@ -129,6 +129,7 @@ + @@ -138,11 +139,9 @@ {{#componentgrades}} - - + + + - + {{#showsublogcolumn}}
{{#str}} dashboard:seq, local_sitsgradepush {{/str}} {{#str}} dashboard:sits_assessment, local_sitsgradepush {{/str}} {{#str}} dashboard:weight, local_sitsgradepush {{/str}} {{#str}} dashboard:moodle_activity, local_sitsgradepush {{/str}}
- {{mabseq}} - {{mabname}} - {{mabperc}}{{mabseq}}{{mabname}}{{#str}} dashboard:mab_perc, local_sitsgradepush, {{mabperc}} {{/str}} {{#assessmentmapping}}

diff --git a/templates/marks_transfer_history_table.mustache b/templates/marks_transfer_history_table.mustache index 5cad254..6b07639 100644 --- a/templates/marks_transfer_history_table.mustache +++ b/templates/marks_transfer_history_table.mustache @@ -42,7 +42,9 @@ "firstname":"Test", "lastname":"User", "idnumber":"1234567", - "marks":"0", + "marksupdatedaftertransfer":"true", + "transferredmark":"77", + "marks":"66", "handindatetime":"2019-01-01 00:00:00", "lastgradepushresultlabel":"Success ", "lastgradepushtime":"2019-01-01 00:00:00", @@ -80,7 +82,12 @@

{{firstname}} {{lastname}} {{idnumber}}{{marks}}{{^marksupdatedaftertransfer}}{{marks}}{{/marksupdatedaftertransfer}} + {{#marksupdatedaftertransfer}} + {{transferredmark}}
+ {{#str}} index:mark_changed_to, local_sitsgradepush, {{marks}} {{/str}} + {{/marksupdatedaftertransfer}} +
{{handindatetime}} {{{lastgradepushresultlabel}}}{{lastgradepushtime}}