Update deadline string shown to users

This commit is contained in:
Sebastian Serth
2021-02-09 00:20:05 +01:00
parent 6db37f0360
commit 41ae6c2880
3 changed files with 24 additions and 23 deletions

View File

@ -208,6 +208,18 @@ CodeOceanEditorEvaluation = {
}
},
getDeadlineInformation: function(deadline, translation_key, otherwise) {
if (deadline !== undefined) {
let li = document.createElement("li");
this.submission_deadline = new Date(deadline);
const bullet_point = I18n.t('exercises.editor.hints.' + translation_key,
{ deadline: I18n.l("time.formats.long", this.submission_deadline), otherwise: otherwise })
let text = $.parseHTML(bullet_point);
$(li).append(text);
return li;
}
},
initializeDeadlines: function () {
const deadline = $('#deadline');
if (deadline) {
@ -216,27 +228,14 @@ CodeOceanEditorEvaluation = {
const ul = document.createElement("ul");
if (submission_deadline) {
this.submission_deadline = new Date(submission_deadline);
const date = `<b>${I18n.l("time.formats.long", this.submission_deadline)}</b>: ${I18n.t('activerecord.attributes.exercise.submission_deadline')}`;
const bullet_point = `${date}<br/><small>${I18n.t('exercises.editor.hints.submission_deadline')}</small>`;
let li = document.createElement("li");
let text = $.parseHTML(bullet_point);
$(li).append(text);
ul.append(li);
if (submission_deadline && late_submission_deadline) {
ul.append(this.getDeadlineInformation(submission_deadline, 'submission_deadline', ''));
ul.append(this.getDeadlineInformation(late_submission_deadline, 'late_submission_deadline', ''));
} else {
const otherwise_no_points = I18n.t('exercises.editor.hints.otherwise');
ul.append(this.getDeadlineInformation(submission_deadline, 'submission_deadline', otherwise_no_points));
}
if (late_submission_deadline) {
this.late_submission_deadline = new Date(late_submission_deadline);
const date = `<b>${I18n.l("time.formats.long", this.late_submission_deadline)}</b>: ${I18n.t('activerecord.attributes.exercise.late_submission_deadline')}`;
const bullet_point = `${date}<br/><small>${I18n.t('exercises.editor.hints.late_submission_deadline')}</small>`;
let li = document.createElement("li");
let text = $.parseHTML(bullet_point);
$(li).append(text);
ul.append(li);
}
$(ul).insertAfter($(deadline).children()[0]);
}
}

View File

@ -339,8 +339,9 @@ de:
exercise_deadline_passed: 'Entweder ist die Abgabefrist bereits abgelaufen oder Sie haben die Aufgabe nicht direkt über die E-Learning Plattform gestartet. (Möglicherweise haben Sie den Zurück Button Ihres Browsers benutzt nachdem Sie Ihre Aufgabe abgegeben haben?)'
request_for_comments_sent: "Kommentaranfrage gesendet."
hints:
submission_deadline: Abgaben nach der Abgabefrist werden als verspätet gekennzeichnet und die Punktzahl wird bei der Übertragung an die E-Learning-Plattform auf 0 Punkte reduziert.
late_submission_deadline: Abgaben nach der Abgabefrist und vor der verspäteten Abgabefrist werden als verspätet gekennzeichnet und mit einem 20%-Punktabzug gewertet. Abgaben nach der verspäteten Abgabefrist werden mit 0 Punkten an die E-Learning-Plattform gesendet.
submission_deadline: Diese Abgabe ist am <b>%{deadline}</b> fällig.<br/><small>Klicken Sie daher rechtzeitig auf 'Abgeben', um Ihre Punktzahl an die E-Learning-Plattform zu übertragen. %{otherwise}</small>
late_submission_deadline: Bis <b>%{deadline}</b> werden 80% Ihrer Punktzahl anerkannt.<br/><small>Wenn Sie diese erweiterte Frist ungenutzt verstreichen lassen und Ihre Abgabe später einreichen, werden 0 Punkte übertragen.</small>
otherwise: Nach der Abgabefrist werden 0 Punkte übertragen.
disclaimer: Bei Fragen zu Deadlines wenden Sie sich bitte an das Teaching Team. Die hier angezeigte Abgabefrist dient nur zur Information und Angaben auf der jeweiligen Kursseite in der E-Learning-Plattform sollen immer Vorrang haben.
editor_file_tree:
file_root: Dateien

View File

@ -339,8 +339,9 @@ en:
exercise_deadline_passed: 'Either the deadline has already passed or you did not directly access this page from the e-learning platform. (Did you use the Back button of your browser after submitting the score?)'
request_for_comments_sent: "Request for comments sent."
hints:
submission_deadline: Any submission obtained after the deadline will be considered late and a score of 0 points will be sent to the e-learning platform.
late_submission_deadline: Any submission obtained after the deadline but before the late submission deadline will be considered as late and will only be scored with a penality of 20%. Any submission obtained after the late submission deadline will have its score reduced by 100%.
submission_deadline: This exercise is due <b>%{deadline}</b>.<br/><small>Click 'submit' to transfer your score to the e-learning platform before this deadline passes. %{otherwise}</small>
late_submission_deadline: Until <b>%{deadline}</b>, 80% of your score will be awareded.<br/><small>If you miss this extended deadline and submit your score afterwards, 0 points will be transmitted.</small>
otherwise: Otherwise, a score of 0 points will be transmitted.
disclaimer: If unsure about a deadline, please contact a course instructor. The deadline shown here is only informational and information from the e-learning platform should always take precedence.
editor_file_tree:
file_root: Files