 
   # For pdfs
   API =
-    getUnprocessedSolutionSample: ->
-      rdb
-      .table("Solutions")
-      .eqJoin("exercise", rdb.table("Exercises"))
-      .filter(
-        # Is due, not processed so far and not in process?
-        rdb.row("right")("dueDate").lt(new Date()).and(
-          rdb.row("left")("processed").default(false).ne(true)
-        ).and(
-          rdb.row("left")("processingLock").default(false).ne(true)
-        )
-      ).sample(1)("left").nth(0).default(null).run con
-
     storeTutor: (tutor) ->
       if !tutor.name? or !tutor.password? or !tutor.contingent?
         Promise.reject("You must provide a name, password and contingent field")

              s.merge({"solution": s("_data")}).without("_data")
            } , {nonAtomic: true})
          ).run(con)

            solution.without("processed").without("processingLock").without("pdf")
          ).run con
      )

    resetPdfForAllSolutions: () ->
      rdb.table("Solutions").replace((solution) ->
        solution.without("processed").without("processingLock").without("pdf")
      ).run con

    # Save the finished pdf file into the solution
    insertFinishedPdf: (solutionId, pdfData)->
