Reduce score sent via LTI if too late
This commit is contained in:
@ -155,8 +155,6 @@ module Lti
|
|||||||
|
|
||||||
if provider.nil?
|
if provider.nil?
|
||||||
{status: 'error'}
|
{status: 'error'}
|
||||||
elsif submission.after_late_deadline?
|
|
||||||
{status: 'too late'}
|
|
||||||
elsif provider.outcome_service?
|
elsif provider.outcome_service?
|
||||||
Raven.extra_context({
|
Raven.extra_context({
|
||||||
provider: provider.inspect,
|
provider: provider.inspect,
|
||||||
@ -165,8 +163,20 @@ module Lti
|
|||||||
session: session.to_hash,
|
session: session.to_hash,
|
||||||
exercise_id: submission.exercise_id
|
exercise_id: submission.exercise_id
|
||||||
})
|
})
|
||||||
response = provider.post_replace_result!(submission.normalized_score)
|
normalized_lit_score = submission.normalized_score
|
||||||
{code: response.response_code, message: response.post_response.body, status: response.code_major}
|
if submission.before_deadline?
|
||||||
|
# Keep the full score
|
||||||
|
elsif submission.within_grace_period?
|
||||||
|
# Reduce score by 20%
|
||||||
|
normalized_lit_score *= 0.8
|
||||||
|
elsif submission.after_late_deadline?
|
||||||
|
# Reduce score by 100%
|
||||||
|
normalized_lit_score *= 0.0
|
||||||
|
else # no deadline
|
||||||
|
# Keep the full score
|
||||||
|
end
|
||||||
|
response = provider.post_replace_result!(normalized_lit_score)
|
||||||
|
{code: response.response_code, message: response.post_response.body, status: response.code_major, score_sent: normalized_lit_score}
|
||||||
else
|
else
|
||||||
{status: 'unsupported'}
|
{status: 'unsupported'}
|
||||||
end
|
end
|
||||||
|
@ -529,10 +529,11 @@ class ExercisesController < ApplicationController
|
|||||||
response = send_score(@submission)
|
response = send_score(@submission)
|
||||||
|
|
||||||
if response[:status] == 'success'
|
if response[:status] == 'success'
|
||||||
redirect_after_submit
|
if response[:score_sent] != @submission.normalized_score
|
||||||
elsif response[:status] == 'too late'
|
# Score has been reduced due to the passed deadline
|
||||||
flash[:warning] = I18n.t('exercises.submit.too_late')
|
flash[:warning] = I18n.t('exercises.submit.too_late')
|
||||||
flash.keep(:warning)
|
flash.keep(:warning)
|
||||||
|
end
|
||||||
redirect_after_submit
|
redirect_after_submit
|
||||||
else
|
else
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
@ -336,9 +336,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?)'
|
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."
|
request_for_comments_sent: "Kommentaranfrage gesendet."
|
||||||
hints:
|
hints:
|
||||||
submission_deadline: Abgaben nach der Abgabefrist werden als verspätet gekennzeichnet.
|
submission_deadline: Abgaben nach der Abgabefrist werden als verspätet gekennzeichnet und die Punktzahl wird nicht an die E-Learning-Plattform übertragen.
|
||||||
late_submission_deadline: Abgaben nach der Abgabefrist und vor der verspäteten Abgabefrist werden als verspätet gekennzeichnet und möglicherweise nur mit Punktabzug gewertet. Abgaben nach der verspäteten Abgabefrist werden möglicherweise nicht berücksichtigt.
|
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 nicht mehr bepunktet.
|
||||||
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 Platform sollen immer Vorrang haben.
|
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:
|
editor_file_tree:
|
||||||
file_root: Dateien
|
file_root: Dateien
|
||||||
import_codeharbor:
|
import_codeharbor:
|
||||||
@ -375,8 +375,8 @@ de:
|
|||||||
no_execution_environment_selected: Bitte eine Ausführungsumgebung auswählen, bevor die Aufgabe aktiviert wird.
|
no_execution_environment_selected: Bitte eine Ausführungsumgebung auswählen, bevor die Aufgabe aktiviert wird.
|
||||||
none: Keine
|
none: Keine
|
||||||
hints:
|
hints:
|
||||||
submission_deadline: Ein Zeitpunkt in UTC, zu dem die Abgabe geschlossen wird. Abgaben nach der Abgabefrist werden als verspätet gekennzeichnet.
|
submission_deadline: Ein Zeitpunkt in UTC, zu dem die Abgabe geschlossen wird. Abgaben nach der Abgabefrist werden als verspätet gekennzeichnet und nur mit 20% Punktabzug an die E-Learning-Plattform übertragen.
|
||||||
late_submission_deadline: Eine Gnadenfrist für Abgaben in UTC. Die verlängerte Abgabefrist soll nicht vor der eigentlichen Abgabefrist liegen. Abgaben nach der Abgabefrist werden deutlich gekennzeichnet.
|
late_submission_deadline: Eine Gnadenfrist für Abgaben in UTC. Die verlängerte Abgabefrist soll nicht vor der eigentlichen Abgabefrist liegen. Abgaben nach der Abgabefrist werden deutlich gekennzeichnet und mit 100% Punktabzug an die E-Learning-Plattform übertragen.
|
||||||
implement:
|
implement:
|
||||||
alert:
|
alert:
|
||||||
text: 'Ihr Browser unterstützt nicht alle Funktionalitäten, die %{application_name} benötigt. Bitte nutzen Sie einen modernen Browser, um %{application_name} zu besuchen.'
|
text: 'Ihr Browser unterstützt nicht alle Funktionalitäten, die %{application_name} benötigt. Bitte nutzen Sie einen modernen Browser, um %{application_name} zu besuchen.'
|
||||||
|
@ -336,8 +336,8 @@ 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?)'
|
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."
|
request_for_comments_sent: "Request for comments sent."
|
||||||
hints:
|
hints:
|
||||||
submission_deadline: Any submission obtained after the deadline will be considered late.
|
submission_deadline: Any submission obtained after the deadline will be considered late and no score 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 might only be scored with a penality. Any submission obtained after the late submission deadline might not be considered.
|
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 not be scored at all.
|
||||||
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.
|
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:
|
editor_file_tree:
|
||||||
file_root: Files
|
file_root: Files
|
||||||
@ -375,8 +375,8 @@ en:
|
|||||||
no_execution_environment_selected: Select an execution environment before publishing the exercise.
|
no_execution_environment_selected: Select an execution environment before publishing the exercise.
|
||||||
none: None
|
none: None
|
||||||
hints:
|
hints:
|
||||||
submission_deadline: A date and time in UTC to close the submission. Any submission obtained after the deadline will be considered late.
|
submission_deadline: A date and time in UTC to close the submission. Any submission obtained after the deadline will be considered late and the score sent to the e-learning platform will be reduced by 20%.
|
||||||
late_submission_deadline: A grace period for submissions in UTC. The late submission deadline should not be set or any timestamp before the original submission deadline. Any submission obtained after the deadline will be clearly marked.
|
late_submission_deadline: A grace period for submissions in UTC. The late submission deadline should not be set or any timestamp before the original submission deadline. Any submission obtained after the deadline will be clearly marked and the score sent to the e-learning platform will be reduced by 100%.
|
||||||
implement:
|
implement:
|
||||||
alert:
|
alert:
|
||||||
text: 'Your browser does not support features required for using %{application_name}. Please access %{application_name} using a modern browser.'
|
text: 'Your browser does not support features required for using %{application_name}. Please access %{application_name} using a modern browser.'
|
||||||
|
Reference in New Issue
Block a user