diff --git a/app/assets/javascripts/assessments_show.coffee b/app/assets/javascripts/assessments_show.coffee index 1edf0f7d8..d75876e79 100644 --- a/app/assets/javascripts/assessments_show.coffee +++ b/app/assets/javascripts/assessments_show.coffee @@ -1,11 +1,11 @@ # On click to 'fake submit' it triggers a click even on file picker # so that the user can pick the file -$('#handin_show_assessment #fake-submit').click (e)-> - e.preventDefault() - $("#handin_show_assessment input[type='file']").trigger('click'); +# $('#handin_show_assessment #fake-submit').click (e)-> +# e.preventDefault() +# $("#handin_show_assessment input[type='file']").trigger('click'); -# On file pick, we submit the form automatically -$("input[type='file']").change (e)-> - $('#handin_show_assessment #new_submission').submit() - $("#handin_show_assessment input[type='file']").val("") # clear for re-selecting the same file +# # On file pick, we submit the form automatically +# $("input[type='file']").change (e)-> +# $('#handin_show_assessment #new_submission').submit() +# $("#handin_show_assessment input[type='file']").val("") # clear for re-selecting the same file diff --git a/app/assets/stylesheets/style.css.scss b/app/assets/stylesheets/style.css.scss index 671ed523a..a4d37bebc 100755 --- a/app/assets/stylesheets/style.css.scss +++ b/app/assets/stylesheets/style.css.scss @@ -1147,3 +1147,31 @@ div.center { .btn:hover { background-color: rgba(140,0,0,0.95) !important; } + + +.drag-drop-handin { + height: 120px; + border: 3px dashed grey; + border-radius: 10px; + cursor: pointer; + margin-top: 10px; + align-items: center; + justify-content: center; + + -webkit-touch-callout: none; /* iOS Safari */ + -webkit-user-select: none; /* Safari */ + -khtml-user-select: none; /* Konqueror HTML */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* Internet Explorer/Edge */ + user-select: none; /* Non-prefixed version, currently + supported by Chrome and Opera */ +} + +.drag-drop-handin:hover { + background: rgba(0, 0, 0, 0.05); +} + +#remove-handed-in { + color: grey; + cursor: pointer; +} diff --git a/app/views/assessments/_handin_form.html.erb b/app/views/assessments/_handin_form.html.erb index c943570b1..de17afc45 100644 --- a/app/views/assessments/_handin_form.html.erb +++ b/app/views/assessments/_handin_form.html.erb @@ -47,17 +47,141 @@
* denotes required fields. The submission cannot be completed without filling out the required fields.
<% end %> <% end %> - + <% content_for :javascripts do %> + + <% end %> +Drag a file here to hand in. Click to select a file.
Files do not submit automatically.
today Last day to handin: <%= end_at_display(@aud.end_at false) %> -
<% if @cud.instructor? and @assessment.exam? %>