Get problem
(&self, rfid: i32)
| 107 | |
| 108 | /// Get problem |
| 109 | pub fn get_problem(&self, rfid: i32) -> Result<Problem, Error> { |
| 110 | let p: Problem = problems.filter(fid.eq(rfid)).first(&mut self.conn()?)?; |
| 111 | if p.category != "algorithms" { |
| 112 | return Err(anyhow!("No support for database and shell questions yet").into()); |
| 113 | } |
| 114 | |
| 115 | Ok(p) |
| 116 | } |
| 117 | |
| 118 | /// Get problem from name |
| 119 | pub fn get_problem_id_from_name(&self, problem_name: &String) -> Result<i32, Error> { |