Explorar o código

Add support for variable pass stages

Alan Lam %!s(int64=7) %!d(string=hai) anos
pai
achega
144c3fc7e5
Modificáronse 2 ficheiros con 2 adicións e 2 borrados
  1. 1 1
      controllers/test.php
  2. 1 1
      engine/template.php

+ 1 - 1
controllers/test.php

@@ -187,7 +187,7 @@ if(Core::$user->level == User::LEVEL_TESTER) {
 					}
 				}
 
-				$test->pass = ($test->challenge_stage <= 2) ? 1 : 0; // Pass = Challenged during browsing or before
+				$test->pass = ($test->challenge_stage <= $template->pass_stage) ? 1 : 0; // Pass = Challenged during browsing or before
 				$test->dts_updated = Util::getDateTime();
 
 				$success = $test->commit();

+ 1 - 1
engine/template.php

@@ -4,7 +4,7 @@ class Template extends Model {
 
 	protected static $table = "template";
 	protected static $id_field = "id";
-	protected static $fillable_fields = ["customer_id", "name", "json", "practice"];
+	protected static $fillable_fields = ["customer_id", "name", "json", "practice", "pass_stage"];
 
 	private $overrides = [];