Skip to content
This repository has been archived by the owner on Jun 30, 2024. It is now read-only.

Commit

Permalink
Change: Complete is now Finished
Browse files Browse the repository at this point in the history
* **WARNING** - This is a breaking change for the assignment progress, you will need to run a query to update the grades table changing ‘Complete’ to ‘Finished’ in the is_submit column.
  • Loading branch information
bnmnetp committed Dec 14, 2022
1 parent 1593ac2 commit 02dd938
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
12 changes: 6 additions & 6 deletions controllers/assignments.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,8 @@ def update_submit():
# keep this clause for backward compatibility
if is_submit is None:
if grade.is_submit == "In Progress":
is_submit = "Complete"
elif grade.is_submit == "Complete":
is_submit = "Finished"
elif grade.is_submit == "Finished":
is_submit = "Not Started"
else:
is_submit = "In Progress"
Expand Down Expand Up @@ -852,7 +852,7 @@ def doAssignment():
db.grades.update_or_insert(
auth_user=auth.user.id,
assignment=assignment_id,
is_submit="Not Started", # set is_submit variable to incomplete
is_submit="", # set is_submit variable to incomplete
)
grade = (
db(
Expand Down Expand Up @@ -965,7 +965,7 @@ def chooseAssignment():
else:
score.append("Not Graded")

if deadline <= datetime.datetime.utcnow() and grade.is_submit != "Complete":
if deadline <= datetime.datetime.utcnow() and grade.is_submit != "Finished":
ontime.append(False)
else:
ontime.append(True)
Expand All @@ -975,11 +975,11 @@ def chooseAssignment():
elif timestamp > deadline and assignment.enforce_due:
status.append("Past Due")
else:
status.append("Not Started")
status.append("")
elif timestamp > deadline and assignment.enforce_due:
status.append("Past Due")
else:
status.append("Not Started")
status.append("")

# Convert the duedate for current assignment to string
duedates.append(date2String(deadline))
Expand Down
10 changes: 8 additions & 2 deletions views/assignments/chooseAssignment.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ <h1>Assignments</h1><h2></h2>
<table class="table table-striped">
<tr><th>Name</th><th>My Progress</th><th>Due</th><th>Score<th>Description</th></tr>
{{i=0}}
<style>
select:invalid { color: gray; }
</style>
{{for assignment in assignments:}}
<tr>
<td><a href="doAssignment?assignment_id={{=assignment['id']}}">{{=assignment['name']}}</a></td>
<th>
<select onchange="updateAssignmentProgress(this.value, {{=assignment['id']}})">
{{for option in ["Not Started", "In Progress", "Complete"]:}}
<select required onchange="updateAssignmentProgress(this.value, {{=assignment['id']}})">
<option disabled selected value="">Track my Progress</option>
{{for option in ["Not Started", "In Progress", "Finished"]:}}
<option
{{ if status[i] == option: }}
selected
Expand All @@ -38,3 +42,5 @@ <h1>Assignments</h1><h2></h2>
</tr>
{{pass}}
</table>

<p><strong>Hint: </strong>You can help yourself stay organized by tracking your progress on an assignment. Use the dropdown menu to quickly mark your assignment as Not Started, In Progress, or Complete. When your instructor grades the assignment it will be graded regardless of the value in the dropdown menu. You can also get a preliminary score by clicking on the "Compute Score for Assignment" button on the assignment page.</p>
14 changes: 7 additions & 7 deletions views/assignments/doAssignment.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ <h2 style='margin-left:1cm;'>Due: {{=assignment['duedate']}}</h2>
<p style='margin-left:0.5cm; margin-right:0.5cm;'>Description: {{=assignment['description']}}</p>
</div>
<div>
{{if is_submit == "Complete" or is_graded or enforce_pastdue:}}
{{if is_submit == "Finished": }}
<div style='background-color:rgb(146, 207, 165); margin-left:2cm; margin-right:2cm;'>
<p style='margin-left:0.5cm; margin-right:0.5cm;'>You have marked this assignment Complete. Click to mark it <button onclick="updateAssignmentProgress('In Progress', assignmentId)" class="btn btn-info">In Progress</button></p>
<p style='margin-left:0.5cm; margin-right:0.5cm;'>You have marked this assignment Finished. Click to mark it <button onclick="updateAssignmentProgress('In Progress', assignmentId)" class="btn btn-info">In Progress</button></p>
</div>
{{elif is_submit == "In Progress":}}
<div style='background-color:rgb(247, 238, 158); margin-left:2cm; margin-right:2cm;'>
<p style='margin-left:0.5cm; margin-right:0.5cm;'>You have marked this assignment as In Progress. Click to mark it as <button onclick="updateAssignmentProgress('Complete', assignmentId)" class="btn btn-info">Complete</button></p>
<p style='margin-left:0.5cm; margin-right:0.5cm;'>You have marked this assignment as In Progress. Click to mark it as <button onclick="updateAssignmentProgress('Finished', assignmentId)" class="btn btn-info">Finished</button></p>
</div>
{{else:}}
<div style='background-color:rgb(236, 189, 189); margin-left:2cm; margin-right:2cm;'>
Expand Down Expand Up @@ -123,9 +123,9 @@ <h5 style='text-align:center;'>Not yet graded</h5>
{{pass}}
</div>
<div>
{{if is_submit == "Complete" or is_graded or enforce_pastdue:}}
{{if is_submit == "Finished":}}
<div style='background-color:rgb(146, 207, 165); margin-left:2cm; margin-right:2cm;'>
<p style='margin-left:0.5cm; margin-right:0.5cm;'>You have marked this assignment Complete. Click to mark it <button onclick="updateAssignmentProgress('In Progress', assignmentId)" class="btn btn-info">In Progress</button></p>
<p style='margin-left:0.5cm; margin-right:0.5cm;'>You have marked this assignment Finished. Click to mark it <button onclick="updateAssignmentProgress('In Progress', assignmentId)" class="btn btn-info">In Progress</button></p>
</div>
{{if is_graded:}}
<div style='background-color:powderblue; margin-left:2cm; margin-right:2cm;'>
Expand All @@ -141,7 +141,7 @@ <h5 style='text-align:center;'>Not yet graded</h5>
{{pass}}
{{elif is_submit == "In Progress":}}
<div style='background-color:rgb(247, 238, 158); margin-left:2cm; margin-right:2cm;'>
<p style='margin-left:0.5cm; margin-right:0.5cm;'>You have marked this assignment as In Progress. Click to mark it as <button onclick="updateAssignmentProgress('Complete', assignmentId)" class="btn btn-info">Complete</button></p>
<p style='margin-left:0.5cm; margin-right:0.5cm;'>You have marked this assignment as In Progress. Click to mark it as <button onclick="updateAssignmentProgress('Finished', assignmentId)" class="btn btn-info">Finished</button></p>
</div>
{{else:}}
<div style='background-color:rgb(236, 189, 189); margin-left:2cm; margin-right:2cm;'>
Expand All @@ -166,7 +166,7 @@ <h5 style='text-align:center;'>Not yet graded</h5>
{{if is_submit == "Not Started":}}
Mark In Progress
{{elif is_submit == "In Progress":}}
Mark Complete
Mark Finished
{{else:}}
Mark Incomplete
{{pass}}
Expand Down

0 comments on commit 02dd938

Please sign in to comment.