Skip to content

Commit

Permalink
Adding Additional Check to Construct Link
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ryvaru committed Nov 15, 2024
1 parent 8362f62 commit 10d30cd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -663,9 +663,13 @@ void start_table_output( bool /*for_instructor*/,
std::string fullUrl = base_url + "courses/" + semester + "/" + course + "/gradeable/" + gradeable_id;

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

if (gradeable_name == "")
Expand Down

0 comments on commit 10d30cd

Please sign in to comment.