Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assignment toolbar #1

Merged
merged 19 commits into from
Oct 9, 2014
Merged

Assignment toolbar #1

merged 19 commits into from
Oct 9, 2014

Conversation

jhamrick
Copy link
Member

Add javascript and css for the nbgrader toolbar for creating assignments.

@takluyver
Copy link
Member

@jhamrick it looks like you're not a collaborator on this repo. I've just made an nbgrader team and invited you to join it. You may decide to work through pull requests anyway - that's up to you and @ellisonbg - but it seems right that you should have full access to this repo.

@jhamrick
Copy link
Member Author

Awesome, thanks! 😃

@Carreau
Copy link
Member

Carreau commented Sep 15, 2014

Agreed, Jess should at least be admin and have right to add people to nbgrader team. In roughly two days I should be able to help again. For now last rehearsal... :-P

Le 15 sept. 2014 à 07:53, "Jessica B. Hamrick" notifications@github.com a écrit :

Awesome, thanks!


Reply to this email directly or view it on GitHub.

@ellisonbg
Copy link
Contributor

Great, I will review this today!

@ellisonbg
Copy link
Contributor

Here is the metadata @jhamrick and I talked about this celltoolbar setting:

  • cell.metadata['nbgrader']['solution']=True|False to set that a cell is a solution and should be replaced by a stub in the version sent to students.
  • cell.metadata['nbgrader']['grade']=True|False indicates that a code or markdown cell will be graded. If this is a code cell, it will usually be autograded, if a markdown cell it will be graded by a human using a Google Form.
  • cell.metadata['nbgrader']['points']=int how many points should be assigned to that cell for autograding purposes. This MUST be on all code cell with grade=True and MAY be on markdown cell (still thinking about that.

@ellisonbg
Copy link
Contributor

One other metadata field:

  • cell.metadata['nbgrader']['id'] will be a human readable id for each cell with grade=True for display to human graders.

@jhamrick
Copy link
Member Author

Ok, this has been update and is ready for review again.

* Add a display class to the cell element, depending on the
* nbgrader cell type.
*/
var display_cell_type = function (cell) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because cells already have a cell_type attribute in the document format, I find that using that name here is a bit confusing. Originally I was expecting to have two separate boolean attributes solution and grade. Trying to think if you would ever want a cell that was both solution and grade. Actually I think there is one. If you asked the students to write the tests themselves. Then you would want both to stub the cell in the student version, but still autograde it later. Based on this, I think we should use metadata.nbgrader.solution=true/false and metadata.nbgrader.grade=true|false. Then the UI for each would be a checkbox. Does this make sense?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes, good point -- I'll change it to be this way. I think I must have been too tired when I was working on this last night as I totally missed that you had it that way in your comment!

@jhamrick
Copy link
Member Author

Ok, I think I addressed all your comments. I went with grader_id for the cell id but can just as easily change it to something else, too.

@jhamrick
Copy link
Member Author

One thing I realized though is that having the solution checkbox is a little confusing -- for cells that use the comment syntax, should the solution checkbox be checked? Currently (based on this PR and the other one) I think the behavior is that if solution == True, the contents of the entire cell will be replaced with the stub. However, it feels natural (at least to me) to also check the solution checkbox for cells that use the comment syntax -- but in those cases I don't want to replace the entire contents of the cell.

Perhaps we could do something where if there is the comment syntax, then only the subregion of the cell is replaced -- even if solution == True (and so in those cases the entire cell contents would not be replaced).

@jhamrick
Copy link
Member Author

Hmm, this is actually reeeeallly slow to load for long notebooks (I have one notebook for which it actually times out). This seems problematic enough that I want to fiddle with it a bit before this is merged.

@jhamrick
Copy link
Member Author

Ok, done fiddling. The issue was in how I was loading it in my custom.js; I've modified the instructions at the top of nbgrader.js accordingly.

@jhamrick
Copy link
Member Author

Build is failing here because .travis.yml doesn't exist yet.

} else {
return cell.metadata.nbgrader.grade;
}
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh. Yes, but it would only be used in two places so I'm not sure I want to include a dependency just for that.

@Carreau
Copy link
Member

Carreau commented Sep 26, 2014

Looks good, a few suggestions inline. s/ipython/jupyter/g.

@jhamrick
Copy link
Member Author

You mean the ipython in load_ipython_extension? At least for the moment, that is a special name used by IPython.load_extensions, so that has to stay.

@Carreau
Copy link
Member

Carreau commented Sep 26, 2014

You mean the ipython in load_ipython_extension? At least for the moment, that is a special name used by IPython.load_extensions, so that has to stay.

Yep, that was a comment for the future :-) I should have added a :-) or a :-P.

@jhamrick
Copy link
Member Author

Ah, ok :-)

And yeah, bootstrap might be a good idea given that ipython is already using it anyway. I'll play with it a bit...

@jhamrick
Copy link
Member Author

Seems like bootstrap doesn't play all that nicely with how the celltoolbar is styled by default, so I'm going to leave it for now.

link.type = 'text/css';
link.rel = 'stylesheet';
link.href = require.toUrl('./nbgrader.css');
console.log(link);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debug

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@jhamrick
Copy link
Member Author

jhamrick commented Oct 1, 2014

@ellisonbg I think this is ready for merge -- do you want to do another review of this or should I just go ahead and merge it?

@jhamrick jhamrick mentioned this pull request Oct 1, 2014
text.addClass('nbgrader-id-input');
text.attr("value", cell.metadata.nbgrader.grader_id);
text.keyup(function () {
cell.metadata.nbgrader.grader_id = text.val();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have been using a grader_id in the context of peer grading, where there it is a uuid assigned to a person who is peer grading. Maybe grade_id instead in this context?

@ellisonbg
Copy link
Contributor

OK, digging out of everything now...this looks awesome! I just tried it out and it works really well. Other than the one comment I just made about grader_id -> grade_id it is ready to go. I can also just merge and we can fix that in a later PR if you want.

@jhamrick
Copy link
Member Author

jhamrick commented Oct 9, 2014

I'll go ahead and change it now, it's not too much trouble to do that.

jhamrick added a commit that referenced this pull request Oct 9, 2014
@jhamrick jhamrick merged commit 6fc0bce into jupyter:master Oct 9, 2014
@jhamrick jhamrick deleted the assignment-toolbar branch October 9, 2014 01:27
@ellisonbg
Copy link
Contributor

thanks, great work!

On Wed, Oct 8, 2014 at 6:27 PM, Jessica B. Hamrick <notifications@github.com

wrote:

Merged #1 #1.


Reply to this email directly or view it on GitHub
#1 (comment).

Brian E. Granger
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
bgranger@calpoly.edu and ellisonbg@gmail.com

jdfreder added a commit that referenced this pull request Mar 25, 2015
@jhamrick jhamrick modified the milestone: 1.0 Apr 1, 2015
ryanlovett added a commit to ryanlovett/nbgrader that referenced this pull request Feb 20, 2018
willingc pushed a commit that referenced this pull request May 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants