Incorrect number of release tokens
I'm currently in CS246. On the main page for submissions, it says I have 3 release tokens for A2Q4b, but there is actually only 1.
Could you post a copy (use pastebin or github gist) of the html of your A2Q4b latest submission test result page, and a print-screen of your A2Q4b's submission list page?
Thanks!
It looks like the issue occurs when there's less than 3 release tokens in total.
The script assumes that some tokens were spent (checking for less than 3 tokens), and then tries to match for when the other tokens will regen. Since there aren't any tokens to regen, that regex returns null, and so an error occurs. Thus the cell is set to 3 in the catch statement.
Checking for null, before accessing properties would be a quick fix, but the script shouldn't assume 3 release tokens.
@karlding it's been quite a while, but I remember the reason why we assumed it was 3 when we couldn't match anything is that some classes don't show any token information when you did not use any. Thus we kinda assumed the default (3).
Nobody has sent us HTML copies of their page showing 2 tokens, so if there was some kind of exceptions to the case, we couldn't have figured it out as none of our classes are exception to the rule.
Would you have the HTML of a page with less than 3 tokens, when our dashboard shows 3?
Yep! Here's a Gist of an example of a page with only 1 default token.
I was testing out some changes on my branch earlier today, which I think should fix the issue. I'll submit a pull request later, if you'd like?
Ah I see, so it seems that the regex for finding next token availability failed (because there was no string for it), which is causing the catch to fire.
Have you tested the case where the page does not say anything about release tokens? Some courses does that where if you have all 3 tokens unused, there won't be a string for release tokens. If you write N/A, could that be confusing to some people?
Do you have an example of a page where this is the case? Well, I guess the same argument could be made about both false positives and false negatives.
Right now, if the due date for an assignment has passed, I believe the page will not contain the release tokens string (since there are no release tokens available), but the script will incorrectly display that there are 3 release tokens available.
You can usually submit for testing after assignment due dates. I can still release-test courses I took almost two years ago! It will also use one of the tokens, though profs usually take the highest score (or latest submission) before the due date/time.
I haven't been using Marmoset as the profs in 3rd year courses rarely use it for testing, but you can probably take a look at an assignment of your own that should still have 3 tokens left. Last I remember, it does not show the string "You currently have ..." until you used the first token.
On Tue, Oct 20, 2015 at 1:47 AM, karlding [email protected] wrote:
Do you have an example of a page where this is the case? Well, I guess the same argument could be made about both false positives and false negatives.
Right now, if the due date for an assignment has passed, I believe the page will not contain the release tokens string (since there are no release tokens available), but the script will incorrectly display that there are 3 release tokens available.
— Reply to this email directly or view it on GitHub https://github.com/lishid/MarmoUI/issues/6#issuecomment-149440276.
Hmm I was wrong! It depends on the course. I can see some of my courses displaying 3 tokens available.
Hmm, if can't remember the details then, I only remember that there was a specific case where the string was not found, but the student should still have 3/3 tokens...
Were you referring to the case when there hasn't been any submissions yet?
That also happened, though I think there was some other weird case for the submission page to now show the string.