Skip to content
John Sullivan edited this page Jul 4, 2013 · 3 revisions

Classes are light-weight objects within Galah and fulfill a mostly organizational role. Keep in mind that in typical installations, only administrators can create or delete classes, so you may not have the appropriate permissions to use most of these commands.

Tip: there is a convenient shortcut for referencing classes described on the shortcuts page.

Command Name Description
class_info Get a list of any assignments attached to the class.
create_class / modify_class Create or modify a class.
delete_class Delete a class, all of its assignments, and all of the submissions for those assignments (needless to say, dangerous!).
find_class Tool for finding a particular class.

class_info

Lists all assignments for a class along with any other class info.

Reference

class_info for_class
name
The class to get info on.

Example Usage

Here we will get all assignments for the class CS 10.

$ class_info "CS 10"
--Acting as user jsull003@ucr.edu--
Class [id = 509066e855c448134f67b3e4, name = CS 10] has assignments:
    Assignment [id = 50907cca55c4481a5027103c, name = World Domination Domination]

Permissions

admin and teacher users can use this command.

create_class / modify_class

Creates a class.

Reference

create_class name
modify_class the_class name
the_class
The class to modify.
<dt>name</dt>
<dd>The (new) name of the class.</dd>

Example Usage

Here we will create a class CS 9001.

$ create_class CS\ 9001
--Acting as user jsull003@ucr.edu--
Success! Class [id = 5090729955c448184a8ffabd, name = CS 9001] created.

Here we will change the name of the class CS 9000 to CS 9001.

$ modify_class "CS 9000" "CS 9001"
--Acting as user jsull003@ucr.edu--
Success! Class [id = 5090634855c448134f67b3e3, name = CS 9000] has been renamed to 'CS 9001'

Permissions

admin users can use this command.

delete_class

Deletes a given class and all of its assignments.

Because deletion of assignments is a very expensive process (because all of the submissions made to that assignment need to be deleted from the database AND the filesystem), this call will pass off the task to Galah's errand boy, galah.sisyphus, and return immediately.

Reference

delete_class to_delete
to_delete
The class to delete.

Example Usage

Here we will delete the class CS 9001.

$ delete_class 9001
--Acting as user jsull003@ucr.edu--
Class [id = 5090734255c448184a8ffabe, name = CS 9001] has been queued for deletion. Please allow a few minutes for the task to complete.

Permissions

admin users can use this command.

find_class

Finds a classes or classes that match the given query and displays information on them. Instructor will default to the current user, meaning by default only classes you are teaching will be displayed (this is not the case for admins).

Reference

find_class [name_contains = ''] [enrollee = '']
name_contains
A part of (or the whole) name of the class. Case insensitive.
<dt>enrollee</dt>
<dd>Someone enrolled in the class. Defaults to the current user (unless you are an admin). "any" may be specified to search all classes.</dd>

Example Usage

When you call :func:find_class without parameters, all classes you are enrolled in/teaching are listed (unless you are an admin).

$ find_class
find_class
--Acting as user teacher@ucr.edu--
You are teaching 1 class(es) with '' in their name.
    Class [id = 5090634855c448134f67b3e3, name = CS 9000]

If we would like to find all classes, you can specify any for enrollee.

$ find_class "" any
--Acting as user teacher@ucr.edu--
Anyone is teaching 3 class(es) with '' in their name.
    Class [id = 5090634855c448134f67b3e3, name = CS 9000]
    Class [id = 509066e855c448134f67b3e4, name = CS 10]
    Class [id = 5090671655c448134f67b3e5, name = Woodshop 101]

Finally, we can find all CS classes Galah knows about.

$ find_class CS any
--Acting as user teacher@ucr.edu--
Anyone is teaching 2 class(es) with 'CS' in their name.
    Class [id = 5090634855c448134f67b3e3, name = CS 9000]
    Class [id = 509066e855c448134f67b3e4, name = CS 10]

Permissions

admin and teacher users can use this command.