Skip to content

Conversation

oldclesleycode
Copy link
Contributor

No description provided.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@oldclesleycode
Copy link
Contributor Author

I signed it!

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

Copy link

@erickoledadevrel erickoledadevrel left a comment

Choose a reason for hiding this comment

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

Off to a good start! I've added a bunch of comments, please take a look.

FYI, it looks like you're committing this to the wrong repo. Apps Script Samples should go here:

https://github.com/gsuitedevs/apps-script-samples

* See the License for the specific language governing permissions and
* limitations under the License.
*/
// [START classroom_quickstart]

Choose a reason for hiding this comment

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

These START and END comments must use unique names. This should be something like "classroom_update_course" in this case. Fix here and for the other samples.

course['room'] = '302';
var course = Classroom.Courses.update(body=course, id=course_id);
Logger.log('Course "%s" updated.', course.name);
}

Choose a reason for hiding this comment

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

You are missing the END comment.

* See the License for the specific language governing permissions and
* limitations under the License.
*/
// [START classroom_quickstart]

Choose a reason for hiding this comment

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

For our other snippets we've been excluding the method signature and only including the body of the method.

*/
function courseUpdate() {
var course_id = '123456';
var course = Classroom.Courses.get(id=course_id);

Choose a reason for hiding this comment

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

The id=course_id format doesn't work as intended in Apps Script / JavaScript. Just pass course_id directly. Ditto for other samples.

var course = Classroom.Courses.get(id=course_id);
Logger.log('Course %s found. ', course.name);
}
catch (err) {

Choose a reason for hiding this comment

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

Should be on the same line as the closing brace (}).

var course_id = '123456';
try {
var course = Classroom.Courses.get(id=course_id);
Logger.log('Course %s found. ', course.name);

Choose a reason for hiding this comment

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

Surround the name with quotes.

Logger.log('Course %s found. ', course.name);
}
catch (err) {
Logger.log("Course with id %s not found", course_id);

Choose a reason for hiding this comment

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

Surround the ID with quotes.

while (true) {
var response = Classroom.Courses.list(optionalArgs);
var courses = response['courses'];
if (! page_token) {

Choose a reason for hiding this comment

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

No space between the bang (!) and the variable.

}
else {
Logger.log("Courses:");
for (course in courses) {

Choose a reason for hiding this comment

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

We avoid using for-in loops. Use a traditional for loop or courses.forEach()

@@ -0,0 +1,32 @@
/**

Choose a reason for hiding this comment

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

You can put all of these snippets into one file, perhaps called courseSnippets.gs.

@grant
Copy link
Contributor

grant commented Nov 19, 2018

Hi @lesley2958,
Do you want to finish this PR? It looks like a great contribution!

@oldclesleycode
Copy link
Contributor Author

@grant submitted a new PR to the proper repo here! googleworkspace/apps-script-samples#82

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants