Skip to content

Grading Throw Error when the Project is not Properly Graded #9

@scott-yj-yang

Description

@scott-yj-yang

How to replicate this error?

  1. When grading a GitHub issue that is not correctly formatted with the desire score

Error Message

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[23], line 8
      5 # Temporary Fix. Issue Page 
      6 # https://github.com/FleischerResearchLab/CanvasGroupy/issues/5
      7 try:
----> 8     grading.grade_project(
      9         repo=repo,
     10         component="proposal",
     11         assignment_id=693724,
     12         post=True
     13     )
     14 except KeyError:
     15     problem_groups.append(repo_name)

File ~/anaconda3/lib/python3.10/site-packages/CanvasGroupy/grading.py:106, in Grading.grade_project(self, repo, component, assignment_id, canvas_group_name, canvas_group_category, post)
    104 if canvas_group_category is not None:
    105     self.cg.set_group_category(canvas_group_category)
--> 106 score = self.parse_score_from_issue(repo, component)
    107 # create mapping from GitHub repo name to canvas group name
    108 if canvas_group_name is not None:

File ~/anaconda3/lib/python3.10/site-packages/CanvasGroupy/grading.py:59, in Grading.parse_score_from_issue(self, repo, component)
     57 body = issue.body
     58 score = 0
---> 59 for line in body.split("\n"):
     60     if "Score =" in line and "[comment]" not in line:
     61         score = literal_eval(line.split("=")[1])

AttributeError: 'NoneType' object has no attribute 'split'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentationenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions