Conversation
…y/Submitty into validate_admin_gradeable
wangj35
left a comment
There was a problem hiding this comment.
- alert box appears whenever a max score 0 is attempted
- code looks good as well, I would just move the location of the fix so it's more similar to the rest of the checkForm function
| alert("Max score cannot be 0 [Question "+ numOfNumeric + "]"); | ||
| return false; | ||
| } | ||
| } |
There was a problem hiding this comment.
With the way the rest of this function is formatted, I think it'd make more sense if the checking for a max 0 entry were under an if(check3) statement.
There was a problem hiding this comment.
We'd actually want to wrap the for loop with check3 around all of it since it's used in all if statements statically.
if (check3) {
for (var i = 0; i < $('#numeric_num-items').val(); i++) {
...
}
}
There was a problem hiding this comment.
Yeah, that's what I meant.
|
|
||
| <div class="modal-body" style="/*padding-bottom:80px;*/ overflow:visible;"> | ||
| What is the unique id of this gradeable? (e.g., <kbd>hw01</kbd>, <kbd>lab_12</kbd>, or <kbd>midterm</kbd>): <input style='width: 200px' type='text' name='gradeable_id' class="required" value="{$gradeable_submission_id}" placeholder="(Required)"/> | ||
| What is the unique id of this gradeable? (e.g., <kbd>hw01</kbd>, <kbd>lab_12</kbd>, or <kbd>midterm</kbd>): <input style='width: 200px' type='text' name='gradeable_id' id="gradeable_id" class="required" value="{$gradeable_submission_id}" placeholder="(Required)"/> |
There was a problem hiding this comment.
This input (and any inputs that cannot be empty) would probably benefit from having the HTML Required attribute.
|
|
||
| var numOfNumeric = 0; | ||
| var wrapper = $('.numerics-table'); | ||
| var i; |
There was a problem hiding this comment.
Put the var inside the for loop for this variable as we're not using i outside of the loop.
(for (var i = 0; i < $('#numeric_num-items').val(); i++) {)
| alert("Max score cannot be 0 [Question "+ numOfNumeric + "]"); | ||
| return false; | ||
| } | ||
| } |
There was a problem hiding this comment.
We'd actually want to wrap the for loop with check3 around all of it since it's used in all if statements statically.
if (check3) {
for (var i = 0; i < $('#numeric_num-items').val(); i++) {
...
}
}
closes #1037