diff --git a/app/assets/javascripts/editor/evaluation.js b/app/assets/javascripts/editor/evaluation.js index af06c4c2..cbcc688c 100644 --- a/app/assets/javascripts/editor/evaluation.js +++ b/app/assets/javascripts/editor/evaluation.js @@ -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 = `${I18n.l("time.formats.long", this.submission_deadline)}: ${I18n.t('activerecord.attributes.exercise.submission_deadline')}`; - const bullet_point = `${date}
${I18n.t('exercises.editor.hints.submission_deadline')}`; - - 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 = `${I18n.l("time.formats.long", this.late_submission_deadline)}: ${I18n.t('activerecord.attributes.exercise.late_submission_deadline')}`; - const bullet_point = `${date}
${I18n.t('exercises.editor.hints.late_submission_deadline')}`; - - let li = document.createElement("li"); - let text = $.parseHTML(bullet_point); - $(li).append(text); - ul.append(li); - } $(ul).insertAfter($(deadline).children()[0]); } } diff --git a/config/locales/de.yml b/config/locales/de.yml index a15f370f..d21a2e1d 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -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 %{deadline} fällig.
Klicken Sie daher rechtzeitig auf 'Abgeben', um Ihre Punktzahl an die E-Learning-Plattform zu übertragen. %{otherwise} + late_submission_deadline: Bis %{deadline} werden 80% Ihrer Punktzahl anerkannt.
Wenn Sie diese erweiterte Frist ungenutzt verstreichen lassen und Ihre Abgabe später einreichen, werden 0 Punkte übertragen. + 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 diff --git a/config/locales/en.yml b/config/locales/en.yml index 2cb63ed6..2f8f2413 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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 %{deadline}.
Click 'submit' to transfer your score to the e-learning platform before this deadline passes. %{otherwise} + late_submission_deadline: Until %{deadline}, 80% of your score will be awareded.
If you miss this extended deadline and submit your score afterwards, 0 points will be transmitted. + 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