Skip to content

Conversation

@BiancaNecula
Copy link
Contributor

@BiancaNecula BiancaNecula commented Sep 18, 2020

Description

- This feature allows the ta to review and grade the homework directly on the code. They can leave multiple comments on every line (which will be highlighted) and change the score. The student can reply back.

Fixes #165

Testing

  • To do

Checklist

  • I have labeled this PR with the relevant Type labels
  • Tests (if they apply)

@BiancaNecula BiancaNecula added enhancement New feature or request student Bug/Feature for student worklfow teaching assistant Bug/Feature for teaching assistant workflow labels Sep 18, 2020
@codecov
Copy link

codecov bot commented Sep 28, 2020

Codecov Report

Merging #256 into master will increase coverage by 0.42%.
The diff coverage is 92.18%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #256      +/-   ##
==========================================
+ Coverage   86.08%   86.51%   +0.42%     
==========================================
  Files          19       19              
  Lines         891      949      +58     
  Branches       77       84       +7     
==========================================
+ Hits          767      821      +54     
- Misses        105      106       +1     
- Partials       19       22       +3     
Impacted Files Coverage Δ
interface/urls.py 100.00% <ø> (ø)
interface/views.py 91.40% <88.57%> (-1.27%) ⬇️
interface/scoring.py 97.10% <90.00%> (-1.24%) ⬇️
interface/codeview.py 100.00% <100.00%> (ø)
interface/forms.py 100.00% <100.00%> (ø)
interface/models.py 97.58% <100.00%> (+1.85%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 52e1ee4...e7e16c8. Read the comment docs.

for comment in submission.comments.all():
if (
comment.user
in submission.assignment.course.teaching_assistants.all()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: Could you save this variable before the outer for? and then do only

if comment.user in teaching_assistants:

<div class="col-lg-2"></div>
<div class="col-lg-9">
<pre>
/^--^\ /^--^\ /^--^\
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

 .       .
 |\_---_/|
/   o_o   \
|    U    |
\  ._I_.  /
 `-_____-'

)

review_message = "+10.0: Hacker"
response = client.post(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: Could you also put a test where the student comments with something like? 🙏

+10.0: I really did a nice job!

}

if (
file.getvalue() != "The file is missing!"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: Could you save that value to don't having to call the same method twice?
like

file_value = file.getValue()

and then you can do

if file_value not in ["The file is missing!", "The archive is missing!"]:

Copy link
Contributor

@Jokeswar Jokeswar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall 👍


tree = tree_view(request, submission)

if filename == "code":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might introduce the issue of actually having a file named code in the archive. A solution could be having two paths in our urlpatterns:

"submission/<int:pk>/code/",
"submission/<int:pk>/code/<path:filename>/",

Those two should point to different views. One will handle the if case and the other the else case. It will also make it clearer where you are in your logic (empty page / page with code).

Comment on lines +387 to +392
comment = form.save(commit=False)
comment.submission = submission
comment.user = request.user
comment.path = filename
comment.line = request.POST.get("line", "")
comment.save()
Copy link
Contributor

@Jokeswar Jokeswar Sep 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can add hidden inputs in your form so those can be filled in by form.save().

all_tas = submission.assignment.course.teaching_assistants.all()

if request.user not in all_tas and request.user is not submission.user:
return HttpResponse(status=403)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: Could you also add a test for this? 👍

Copy link
Collaborator

@gmuraru gmuraru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request student Bug/Feature for student worklfow teaching assistant Bug/Feature for teaching assistant workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Comment and grade directly on the code

4 participants