Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow file reupload exploration #4

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions openassessment/workflow/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class AssessmentWorkflow(TimeStampedModel, StatusModel):
"waiting",
"done", # Complete
"cancelled" # User submission has been cancelled.
#"to_correct" # User submission has been market for re send
]

STATUS_VALUES = STEPS + STATUSES
Expand Down
27 changes: 26 additions & 1 deletion openassessment/xblock/submission_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,8 @@ def submission_path_and_context(self):
user_preferences = get_user_preferences(self.runtime.service(self, 'user'))
course_id = self.location.course_key if hasattr(self, 'location') else None

#workflow["status"] = "to_correct" # test variable

path = 'openassessmentblock/response/oa_response.html'
context = {
'enable_delete_files': False,
Expand Down Expand Up @@ -981,6 +983,28 @@ def submission_path_and_context(self):
)
context["student_submission"] = create_submission_dict(student_submission, self.prompts)
path = 'openassessmentblock/response/oa_response_graded.html'

# Dado un nuevo estado llamado to_correct, el contexto agrupa todas las respuestas suministradas
# por el estudiante, se cambia el flag para activar el boton de eliminacion de archivos y
# finalmente selecciona el path al template correcto para renderizar las funcionalidades necesarias
elif workflow["status"] == "to_correct":

student_submission = self.get_user_submission(
workflow["submission_uuid"]
)
peer_in_workflow = "peer" in workflow["status_details"]
self_in_workflow = "self" in workflow["status_details"]
context["peer_incomplete"] = peer_in_workflow and not workflow["status_details"]["peer"]["complete"]
context["self_incomplete"] = self_in_workflow and not workflow["status_details"]["self"]["complete"]
context["enable_delete_files"] = True
context["student_submission"] = create_submission_dict(student_submission, self.prompts)
path = 'openassessmentblock/response/oa_response.html'

# Esta solucion permite la edicion del archivo que se sube, sin embargo, existen varios casos y
# temas de Frontend que evaluar con detenimiento. El boton de Submit esta ligado por front a cada step
# de la actividad, por lo cual, lo recomendable es adaptar un poco la interface en un nuevo file para
# eliminarlo

else:
student_submission = self.get_user_submission(
workflow["submission_uuid"]
Expand All @@ -991,5 +1015,6 @@ def submission_path_and_context(self):
context["self_incomplete"] = self_in_workflow and not workflow["status_details"]["self"]["complete"]
context["student_submission"] = create_submission_dict(student_submission, self.prompts)
path = 'openassessmentblock/response/oa_response_submitted.html'


print('\n\n\n', path,'\n\n\n')
return path, context