From 10e68915d82d8db4b39aaea790c3beea1848f905 Mon Sep 17 00:00:00 2001 From: yqbk Date: Thu, 12 May 2016 17:34:30 +0200 Subject: [PATCH 1/7] add key exercise_deadline_passed --- config/locales/de.yml | 2 ++ config/locales/en.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/config/locales/de.yml b/config/locales/de.yml index e7d78943..30f4f7ef 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -209,8 +209,10 @@ de: submit: Code zur Bewertung abgeben test: Testen timeout: 'Ausführung gestoppt. Ihr Code hat die erlaubte Ausführungszeit von %{permitted_execution_time} Sekunden überschritten.' + exercise_deadline_passed: 'Die Abgabefrist für diese Aufgabe ist bereits abgelaufen.' tooltips: save: Ihr Code wird automatisch gespeichert, wann immer Sie eine Datei herunterladen, ausführen oder testen. Explizites Speichern ist also selten notwendig. + exercise_deadline_passed: 'Die hier erzielten Punkten können nur bis zum Ablauf der Abgabefrist an die E-Learning-Plattform übertragen werden.' request_for_comments_sent: "Kommentaranfrage gesendet." editor_file_tree: file_root: Dateien diff --git a/config/locales/en.yml b/config/locales/en.yml index f2470fc8..6cc9dcaf 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -209,8 +209,10 @@ en: submit: Submit Code For Assessment test: Test timeout: 'Execution stopped. Your code exceeded the permitted execution time of %{permitted_execution_time} seconds.' + exercise_deadline_passed: 'The deadline for this exercise has already passed' tooltips: save: Your code is automatically saved whenever you download, run, or test it. Therefore, explicitly saving is rarely necessary. + exercise_deadline_passed: 'The results for this exercise can only be submitted to the e-learning platform before the deadline has passed.' request_for_comments_sent: "Request for comments sent." editor_file_tree: file_root: Files From e838f5a1b129c32ff94b73778abd84a4bcffec57 Mon Sep 17 00:00:00 2001 From: yqbk Date: Thu, 12 May 2016 17:35:09 +0200 Subject: [PATCH 2/7] fix submit-button when not active --- app/views/exercises/implement.html.slim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/views/exercises/implement.html.slim b/app/views/exercises/implement.html.slim index 728492b6..0c5e109b 100644 --- a/app/views/exercises/implement.html.slim +++ b/app/views/exercises/implement.html.slim @@ -78,6 +78,9 @@ br - if session[:lti_parameters].try(:has_key?, 'lis_outcome_service_url') p.text-center = render('editor_button', classes: 'btn-lg btn-success', data: {:'data-url' => submit_exercise_path(@exercise)}, icon: 'fa fa-send', id: 'submit', label: t('exercises.editor.submit')) + - else + p.text-center = render('editor_button', classes: 'btn-lg btn-warning-outline', data: {:'data-placement' => 'bottom', :'data-tooltip' => true} , icon: 'fa fa-clock-o', id: 'submit_outdated', label: t('exercises.editor.exercise_deadline_passed'), title: t('exercises.editor.tooltips.exercise_deadline_passed')) + - if qa_url #questions-column #questions-holder data-url="#{qa_url}/qa/index/#{@exercise.id}/#{@user_id}" From 5c9a9b8a476a8a1b7fe8d9d1b0e60acb6454d12b Mon Sep 17 00:00:00 2001 From: yqbk Date: Thu, 12 May 2016 17:53:21 +0200 Subject: [PATCH 3/7] add alert on submit-button click --- app/assets/javascripts/editor.js.erb | 8 ++++++++ app/views/exercises/_editor.html.slim | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/editor.js.erb b/app/assets/javascripts/editor.js.erb index c69551bb..3d9bb5cb 100644 --- a/app/assets/javascripts/editor.js.erb +++ b/app/assets/javascripts/editor.js.erb @@ -465,6 +465,7 @@ $(function() { $('#start').on('click', showWorkspaceTab); //$('#submit').on('click', confirmSubmission); $('#submit').on('click', submitCode); + $('#submit_outdated').on('click', submitOutdated); }; var initializeWorkspaceButtons = function() { @@ -751,6 +752,13 @@ $(function() { }); }; + var submitOutdated = function(event) { + $.flash.danger({ + icon: ['fa', 'fa-clock-o'], + text: $('#editor').data('message-deadline') + }); + }; + var sendError = function(message, submission_id) { showSpinner($('#render')); var jqxhr = ajax({ diff --git a/app/views/exercises/_editor.html.slim b/app/views/exercises/_editor.html.slim index 3340d6ac..39ef3bd1 100644 --- a/app/views/exercises/_editor.html.slim +++ b/app/views/exercises/_editor.html.slim @@ -1,4 +1,4 @@ -#editor.row data-exercise-id=exercise.id data-message-depleted=t('exercises.editor.depleted') data-message-timeout=t('exercises.editor.timeout', permitted_execution_time: @exercise.execution_environment.permitted_execution_time) data-errors-url=execution_environment_errors_path(exercise.execution_environment) data-submissions-url=submissions_path data-user-id=@current_user.id +#editor.row data-exercise-id=exercise.id data-message-depleted=t('exercises.editor.depleted') data-message-deadline=t('exercises.editor.deadline_alert') data-message-timeout=t('exercises.editor.timeout', permitted_execution_time: @exercise.execution_environment.permitted_execution_time) data-errors-url=execution_environment_errors_path(exercise.execution_environment) data-submissions-url=submissions_path data-user-id=@current_user.id div class=(@exercise.hide_file_tree ? 'hidden col-sm-3' : 'col-sm-3') = render('editor_file_tree', files: @files) div id='frames' class=(@exercise.hide_file_tree ? 'col-sm-12' : 'col-sm-9') - @files.sort{ |a,b| a[:group][:name] <=> b[:group][:name] }.each do |file| From 3189f615353309148ee9a56637ae25e2b635dc0c Mon Sep 17 00:00:00 2001 From: yqbk Date: Thu, 12 May 2016 18:03:33 +0200 Subject: [PATCH 4/7] no alert on outdated button --- app/assets/javascripts/editor.js.erb | 8 -------- app/views/exercises/_editor.html.slim | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/app/assets/javascripts/editor.js.erb b/app/assets/javascripts/editor.js.erb index 3d9bb5cb..c69551bb 100644 --- a/app/assets/javascripts/editor.js.erb +++ b/app/assets/javascripts/editor.js.erb @@ -465,7 +465,6 @@ $(function() { $('#start').on('click', showWorkspaceTab); //$('#submit').on('click', confirmSubmission); $('#submit').on('click', submitCode); - $('#submit_outdated').on('click', submitOutdated); }; var initializeWorkspaceButtons = function() { @@ -752,13 +751,6 @@ $(function() { }); }; - var submitOutdated = function(event) { - $.flash.danger({ - icon: ['fa', 'fa-clock-o'], - text: $('#editor').data('message-deadline') - }); - }; - var sendError = function(message, submission_id) { showSpinner($('#render')); var jqxhr = ajax({ diff --git a/app/views/exercises/_editor.html.slim b/app/views/exercises/_editor.html.slim index 39ef3bd1..b9c41863 100644 --- a/app/views/exercises/_editor.html.slim +++ b/app/views/exercises/_editor.html.slim @@ -1,4 +1,4 @@ -#editor.row data-exercise-id=exercise.id data-message-depleted=t('exercises.editor.depleted') data-message-deadline=t('exercises.editor.deadline_alert') data-message-timeout=t('exercises.editor.timeout', permitted_execution_time: @exercise.execution_environment.permitted_execution_time) data-errors-url=execution_environment_errors_path(exercise.execution_environment) data-submissions-url=submissions_path data-user-id=@current_user.id +#editor.row data-exercise-id=exercise.id data-message-depleted=t('exercises.editor.depleted') data-message-depleted=t('exercises.editor.depleted') data-message-timeout=t('exercises.editor.timeout', permitted_execution_time: @exercise.execution_environment.permitted_execution_time) data-errors-url=execution_environment_errors_path(exercise.execution_environment) data-submissions-url=submissions_path data-user-id=@current_user.id div class=(@exercise.hide_file_tree ? 'hidden col-sm-3' : 'col-sm-3') = render('editor_file_tree', files: @files) div id='frames' class=(@exercise.hide_file_tree ? 'col-sm-12' : 'col-sm-9') - @files.sort{ |a,b| a[:group][:name] <=> b[:group][:name] }.each do |file| From a2e1b08730daa61476d0c4cd426446cfe9d83e4f Mon Sep 17 00:00:00 2001 From: yqbk Date: Thu, 12 May 2016 18:40:42 +0200 Subject: [PATCH 5/7] delete duplicate depleted --- app/views/exercises/_editor.html.slim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/exercises/_editor.html.slim b/app/views/exercises/_editor.html.slim index b9c41863..3340d6ac 100644 --- a/app/views/exercises/_editor.html.slim +++ b/app/views/exercises/_editor.html.slim @@ -1,4 +1,4 @@ -#editor.row data-exercise-id=exercise.id data-message-depleted=t('exercises.editor.depleted') data-message-depleted=t('exercises.editor.depleted') data-message-timeout=t('exercises.editor.timeout', permitted_execution_time: @exercise.execution_environment.permitted_execution_time) data-errors-url=execution_environment_errors_path(exercise.execution_environment) data-submissions-url=submissions_path data-user-id=@current_user.id +#editor.row data-exercise-id=exercise.id data-message-depleted=t('exercises.editor.depleted') data-message-timeout=t('exercises.editor.timeout', permitted_execution_time: @exercise.execution_environment.permitted_execution_time) data-errors-url=execution_environment_errors_path(exercise.execution_environment) data-submissions-url=submissions_path data-user-id=@current_user.id div class=(@exercise.hide_file_tree ? 'hidden col-sm-3' : 'col-sm-3') = render('editor_file_tree', files: @files) div id='frames' class=(@exercise.hide_file_tree ? 'col-sm-12' : 'col-sm-9') - @files.sort{ |a,b| a[:group][:name] <=> b[:group][:name] }.each do |file| From d26d859df1e532fd8519020a1dd08ed6a689c52b Mon Sep 17 00:00:00 2001 From: yqbk Date: Thu, 12 May 2016 18:45:14 +0200 Subject: [PATCH 6/7] resolve confilts --- app/views/exercises/_editor.html.slim | 2 +- app/views/exercises/_file_form.html.slim | 2 +- app/views/exercises/show.html.slim | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/exercises/_editor.html.slim b/app/views/exercises/_editor.html.slim index 3340d6ac..0ce5b73f 100644 --- a/app/views/exercises/_editor.html.slim +++ b/app/views/exercises/_editor.html.slim @@ -1,7 +1,7 @@ #editor.row data-exercise-id=exercise.id data-message-depleted=t('exercises.editor.depleted') data-message-timeout=t('exercises.editor.timeout', permitted_execution_time: @exercise.execution_environment.permitted_execution_time) data-errors-url=execution_environment_errors_path(exercise.execution_environment) data-submissions-url=submissions_path data-user-id=@current_user.id div class=(@exercise.hide_file_tree ? 'hidden col-sm-3' : 'col-sm-3') = render('editor_file_tree', files: @files) div id='frames' class=(@exercise.hide_file_tree ? 'col-sm-12' : 'col-sm-9') - - @files.sort{ |a,b| a[:group][:name] <=> b[:group][:name] }.each do |file| + - @files.each do |file| = render('editor_frame', exercise: exercise, file: file) #autosave-label = t('exercises.editor.lastsaved') diff --git a/app/views/exercises/_file_form.html.slim b/app/views/exercises/_file_form.html.slim index 5cdfdc98..c737f068 100644 --- a/app/views/exercises/_file_form.html.slim +++ b/app/views/exercises/_file_form.html.slim @@ -4,7 +4,7 @@ li.panel.panel-default div.clearfix role="button" span = f.object.name a.pull-right data-toggle="collapse" data-parent="#files" href="#collapse#{id}" collapse - .panel-collapse.collapse id="collapse#{id}" role="tabpanel" + .panel-collapse.collapse.in id="collapse#{id}" role="tabpanel" .panel-body .clearfix = link_to(t('shared.destroy'), '#', class:'btn btn-warning btn-sm discard-file pull-right') .form-group diff --git a/app/views/exercises/show.html.slim b/app/views/exercises/show.html.slim index 85fb09cb..fc28272a 100644 --- a/app/views/exercises/show.html.slim +++ b/app/views/exercises/show.html.slim @@ -23,13 +23,13 @@ h1 h2 = t('activerecord.attributes.exercise.files') ul.list-unstyled.panel-group#files - - @exercise.files.order('name').each do |file| + - @exercise.files.each do |file| li.panel.panel-default .panel-heading role="tab" id="heading" div.clearfix role="button" span.panel-title = file.name_with_extension a.pull-right data-toggle="collapse" data-parent="#files" href="#collapse#{file.id}" collapse - .panel-collapse.collapse id="collapse#{file.id}" role="tabpanel" + .panel-collapse.collapse.in id="collapse#{file.id}" role="tabpanel" .panel-body - if policy(file).destroy? .clearfix = link_to(t('shared.destroy'), file, class:'btn btn-warning btn-sm pull-right', data: {confirm: t('shared.confirm_destroy')}, method: :delete) From a1ead9658e22f413eadd719a1c251bfbb49c9bce Mon Sep 17 00:00:00 2001 From: tstaubitz Date: Tue, 14 Jun 2016 17:27:15 +0200 Subject: [PATCH 7/7] Update de.yml --- config/locales/de.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/de.yml b/config/locales/de.yml index 30f4f7ef..ae7fb930 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -212,7 +212,7 @@ de: exercise_deadline_passed: 'Die Abgabefrist für diese Aufgabe ist bereits abgelaufen.' tooltips: save: Ihr Code wird automatisch gespeichert, wann immer Sie eine Datei herunterladen, ausführen oder testen. Explizites Speichern ist also selten notwendig. - exercise_deadline_passed: 'Die hier erzielten Punkten können nur bis zum Ablauf der Abgabefrist an die E-Learning-Plattform übertragen werden.' + exercise_deadline_passed: 'Die hier erzielten Punkte können nur bis zum Ablauf der Abgabefrist an die E-Learning-Plattform übertragen werden.' request_for_comments_sent: "Kommentaranfrage gesendet." editor_file_tree: file_root: Dateien