Skip to content

Commit

Permalink
NEW: Allow student task files to be downloaded
Browse files Browse the repository at this point in the history
* Show as Resource URL on submissions
  • Loading branch information
macite committed Jun 6, 2016
1 parent 9fd8f29 commit 97fbe3c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app/api/models/task-feedback.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ angular.module("doubtfire.api.models.task-feedback", [])

TaskFeedback.getTaskUrl = (task) ->
"#{api}/projects/#{task.project().project_id}/task_def_id/#{task.definition.id}/submission?auth_token=#{currentUser.authenticationToken}"

TaskFeedback.getTaskFilesUrl = (task) ->
"#{api}/projects/#{task.project().project_id}/task_def_id/#{task.definition.id}/submission_files?auth_token=#{currentUser.authenticationToken}"

TaskFeedback.openFeedback = (task) ->
$window.open TaskFeedback.getTaskUrl(task), "_blank"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ angular.module('doubtfire.tasks.task-submission-viewer', [])
return unless newTask?
newTask.getSubmissionDetails()
$scope.taskUrl = TaskFeedback.getTaskUrl newTask
$scope.taskFilesURL = TaskFeedback.getTaskFilesUrl newTask
)
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<div ng-if="task.has_pdf">
<pdf-panel-viewer
pdf-url="taskUrl"
resources-url="taskFilesURL"
footer-text="{{task.status != 'ready_to_mark' ? 'Annotated comments are viewable once PDF is downloaded' : 'Comments will be available once your tutor has assessed your submission'}}"
ng-hide="notSubmitted(task) || task.processing_pdf">
</pdf-panel-viewer>
Expand Down

0 comments on commit 97fbe3c

Please sign in to comment.