Skip to content

JLM Server requests

GreatWizard edited this page May 9, 2012 · 24 revisions

Definition of the JLM Server different requests, sent in JSON

Answer

Contains the different states of answers returned by the server

  • ALL_IS_FINE : All is working fine :-)
  • WRONG_PASSWORD : The password for the course is wrong.
  • WRONG_TEACHER_PASSWORD : The password of the teacher for the course is wrong.
  • COURSE_NAME_ALREADY_USED : This name is already taken by another course.
  • DATA_NOT_IN_DATABASE : This data/object is not in the database.

StudentServlet (/student)

The user executed an exercise:

Request

  • action = executed
  • username = username
  • course = course id
  • password = course password
  • exoname = exo name
  • exolang = exo language
  • passedtests = number of passed tests
  • source = source code of the exercise
  • totaltests = total number of tests

Answer

  • Answer (defined at the top)

The user joined a module:

Request

  • action = join
  • username = username
  • course = course id
  • password = course passord

Answer

  • Answer (defined at the top)

The user is still working in JLM (every 60 seconds):

Request

  • action = heartbeat
  • username = username
  • course = course id
  • password = course passord

Answer

  • Answer (defined at the top)

The user exited JLM or changed current module:

Request

  • action = leave
  • username = username
  • course = course id
  • password = course passord

Answer

  • Answer (defined at the top)

The user changed of exercise:

Request

  • action = switch
  • username = username
  • course = course id
  • password = course passord
  • exoname = exo name
  • exolang = exo language

Answer

  • Answer (defined at the top)

Help request to the teacher

Issued when the student clicks on the "request help from the teacher" button. The teacher pull the list of students requesting for help every X seconds.

Request

  • action = help
  • username = username
  • course = course id
  • password = course password
  • status = true if the student is still requesting help, false if he cancelled the request

Answer

  • Answer (defined at the top)

CourseServlet (/course)

Get the list of all existing courses:

Request

  • action = allids

Answer

  • Array String = ids

TeacherServlet (/teacher)

Create a new course:

Request

  • action = new
  • course = course id
  • password = course password (for the students)
  • teacher_password = course teacher password (to administrate courses)

Answer

  • Answer (defined at the top)

Download updated courses data:

This is how the teacher requests for information to the server to detect the students needing some attention. This selection involves some intelligence on the filtering that can be done either on the server ("tell me who I should see now"), or on the teacher's console ("gime all the data and let me determine who needs me"). The second one induces some extra communication load, while the first one is more binded to Google App Engine since we need to execute some code on the server.

A good compromise would be an intermediate solution where redundant or less relevant information is removed (such as the source code given by the students). But trying to replace the teacher expertise with a prototypical expert system seems dangerous.

Request

  • action = refresh
  • course = course id
  • teacher_password = course password

Answer

  • Array 1 String =
  • Array 2 String =
  • Array 3 String =
  • Array 4 String =

Delete a course:

Request

  • action = remove
  • course = course id
  • teacher_password = teacher password

Answer

  • Answer (defined at the top)