SEBSERV-527 temporary fix
This commit is contained in:
		
							parent
							
								
									dc8a21daaf
								
							
						
					
					
						commit
						5008fbcd19
					
				
					 1 changed files with 9 additions and 2 deletions
				
			
		|  | @ -32,11 +32,12 @@ import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.AttributeValueCon | ||||||
| @WebServiceProfile | @WebServiceProfile | ||||||
| public class RealNumberConverter implements AttributeValueConverter { | public class RealNumberConverter implements AttributeValueConverter { | ||||||
| 
 | 
 | ||||||
|     private static final Logger log = LoggerFactory.getLogger(IntegerConverter.class); |     private static final Logger log = LoggerFactory.getLogger(RealNumberConverter.class); | ||||||
| 
 | 
 | ||||||
|     public static final Set<String> SUPPORTED_ATTR_NAMES = Utils.immutableSetOf( |     public static final Set<String> SUPPORTED_ATTR_NAMES = Utils.immutableSetOf( | ||||||
|             "defaultPageZoomLevel", |             "defaultPageZoomLevel", | ||||||
|             "defaultTextZoomLevel"); |             "defaultTextZoomLevel", | ||||||
|  |             "screenProctoringImageDownscale"); | ||||||
| 
 | 
 | ||||||
|     private static final String XML_TEMPLATE = "<key>%s</key><real>%s</real>"; |     private static final String XML_TEMPLATE = "<key>%s</key><real>%s</real>"; | ||||||
|     private static final String JSON_TEMPLATE = "\"%s\":%s"; |     private static final String JSON_TEMPLATE = "\"%s\":%s"; | ||||||
|  | @ -89,6 +90,12 @@ public class RealNumberConverter implements AttributeValueConverter { | ||||||
|             realVal = 0; |             realVal = 0; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  |         // NOTE: this is a special case for screenProctoringImageDownscale selector to get the selected real value | ||||||
|  |         //       from the selection-index instead using the index. See SEBSERV-527 | ||||||
|  |         if ("screenProctoringImageDownscale".equals(attribute.name)) { | ||||||
|  |             realVal = realVal / 10.0 + 1.0; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         out.write(Utils.toByteArray(String.format( |         out.write(Utils.toByteArray(String.format( | ||||||
|                 template, |                 template, | ||||||
|                 AttributeValueConverter.extractName(attribute), |                 AttributeValueConverter.extractName(attribute), | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 anhefti
						anhefti