Skip to content

Commit 10d30cd

Browse files
committed
Adding Additional Check to Construct Link
Made an extra check to see that the gradeable has actually been released to view the link to the gradeable itself, otherwise this would be useless. Also, added the blue box permanently to be displayed along with the gradeable names that have links.
1 parent 8362f62 commit 10d30cd

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

output.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -663,9 +663,13 @@ void start_table_output( bool /*for_instructor*/,
663663
std::string fullUrl = base_url + "courses/" + semester + "/" + course + "/gradeable/" + gradeable_id;
664664

665665
if (GRADEABLES[g].hasCorrespondence(gradeable_id)) {
666-
gradeable_name = GRADEABLES[g].getCorrespondence(gradeable_id).second;
667-
gradeable_name = gradeable_name + " <i class='fa-solid fa-arrow-up-right-from-square' style='color:blue;'></i>";
668-
gradeable_name = "<a href=\"" + fullUrl + "\" style=\"color:black; text-decoration:none;\" title=\"View Gradeable\">" + gradeable_name + "</a>";
666+
gradeable_name = GRADEABLES[g].getCorrespondence(gradeable_id).second;
667+
bool checkReleased = GRADEABLES[g].isReleased(gradeable_id);
668+
if(checkReleased){
669+
// g != GRADEABLE_ENUM::LAB ...
670+
gradeable_name = gradeable_name + " <i class='fa-solid fa-arrow-up-right-from-square' style='color:blue;'></i>";
671+
gradeable_name = "<a href=\"" + fullUrl + "\" style=\"color:black; text-decoration:none;\" title=\"View Gradeable\">" + gradeable_name + "</a>";
672+
}
669673
}
670674

671675
if (gradeable_name == "")

0 commit comments

Comments
 (0)