Skip to content

Add Graph.get_assessment_rules() #3939

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

Merged
merged 1 commit into from
May 21, 2025
Merged
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
40 changes: 40 additions & 0 deletions econplayground/main/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,46 @@ def clone(self):
g.save()
return g

def get_assessment_rules(self):
line_actions = [
'up',
'down',
'slope up',
'slope down',
]

rules = {
'line1': {
'name': 'Orange line',
'possible_values': line_actions,
},

'line2': {
'name': 'Blue line',
'possible_values': line_actions,
},

'line1 label': 'Orange line label',
'line2 label': 'Blue line label',
'intersectionLabel': 'Intersection label',
'intersectionHorizLineLabel':
'Orange-Blue intersection horizontal',
'intersectionVertLineLabel': 'Orange-Blue intersection vertical',
'x-axis label': 'X-axis label',
'y-axis label': 'Y-axis label',
}

# TODO: extend possible rules for the various other graph types
if self.graph_type == 8:
rules.update({
'line3': {
'name': 'Green line',
'possible_values': line_actions,
}
})

return rules


class JXGLine(models.Model):
class Meta:
Expand Down